/**
 * DigiMark Corp – Dashboard & Component Supplemental CSS
 * Extends style.css with page-specific and interactive component styles
 */

/* ============================================================
   1. MESSAGING LAYOUT & CHAT UI
   ============================================================ */

.dmc-messages-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    height: calc(100vh - var(--topbar-height) - 48px);
    min-height: 500px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

/* --- Thread Sidebar --- */
.dmc-threads-sidebar {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    background: var(--gray-50);
}

.dmc-threads-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    background: var(--white);
}

.dmc-threads-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 12px;
}

.dmc-thread-search {
    position: relative;
}

.dmc-thread-search input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 13px;
    background: var(--gray-50);
    transition: border-color 0.2s, background 0.2s;
}

.dmc-thread-search input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
}

.dmc-thread-search i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 13px;
}

.dmc-threads-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.dmc-thread-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
    border-left: 3px solid transparent;
}

.dmc-thread-item:hover {
    background: var(--gray-100);
}

.dmc-thread-item.active {
    background: var(--primary-light);
    border-left-color: var(--primary);
}

.dmc-thread-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--white);
    flex-shrink: 0;
}

.dmc-thread-body {
    flex: 1;
    min-width: 0;
}

.dmc-thread-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dmc-thread-preview {
    font-size: 12px;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.dmc-thread-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.dmc-thread-time {
    font-size: 11px;
    color: var(--gray-400);
}

.dmc-thread-unread {
    background: var(--primary);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

#dmc-threads-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--gray-400);
    font-size: 13px;
}

/* --- Chat Panel --- */
.dmc-chat-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.dmc-chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--white);
    flex-shrink: 0;
}

.dmc-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--white);
}

.dmc-chat-info {
    flex: 1;
}

.dmc-chat-partner-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
}

.dmc-chat-partner-status {
    font-size: 12px;
    color: var(--success);
}

.dmc-chat-actions {
    display: flex;
    gap: 8px;
}

/* --- Messages Body --- */
.dmc-messages-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--gray-50);
}

.dmc-messages-loader {
    text-align: center;
    padding: 40px;
    color: var(--gray-400);
    font-size: 14px;
}

.dmc-empty-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    gap: 12px;
    padding: 40px;
}

.dmc-empty-messages i {
    font-size: 48px;
    opacity: 0.4;
}

.dmc-empty-messages p {
    font-size: 14px;
}

.dmc-no-more-messages {
    text-align: center;
    font-size: 12px;
    color: var(--gray-400);
    padding: 8px;
}

/* --- Message Bubbles --- */
.dmc-message {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    max-width: 75%;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s, transform 0.2s;
}

.dmc-message.dmc-msg-visible,
.dmc-message:not(.dmc-msg-animate) {
    opacity: 1;
    transform: none;
}

.dmc-message--sent {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.dmc-message--received {
    align-self: flex-start;
}

.dmc-msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--white);
    flex-shrink: 0;
}

.dmc-msg-bubble {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px 16px 16px 4px;
    padding: 10px 14px;
    box-shadow: var(--shadow-xs);
    max-width: 100%;
}

.dmc-message--sent .dmc-msg-bubble {
    background: var(--primary);
    border-color: var(--primary);
    border-radius: 16px 16px 4px 16px;
    color: var(--white);
}

.dmc-msg-text {
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    word-break: break-word;
}

.dmc-message--sent .dmc-msg-text {
    color: var(--white);
}

.dmc-msg-time {
    display: block;
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 4px;
    text-align: right;
}

.dmc-message--sent .dmc-msg-time {
    color: rgba(255,255,255,0.7);
}

/* --- Message Attachments --- */
.dmc-msg-attachment {
    margin-bottom: 6px;
}

.dmc-msg-image img {
    max-width: 240px;
    max-height: 200px;
    border-radius: 8px;
    display: block;
    cursor: pointer;
    transition: opacity 0.2s;
}

.dmc-msg-image img:hover {
    opacity: 0.9;
}

.dmc-msg-file {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0,0,0,0.05);
    border-radius: 8px;
    font-size: 13px;
}

.dmc-msg-file i {
    font-size: 18px;
    color: var(--primary);
}

.dmc-message--sent .dmc-msg-file i {
    color: rgba(255,255,255,0.8);
}

.dmc-msg-file a {
    color: inherit;
    text-decoration: underline;
    word-break: break-all;
}

/* --- Attachment Preview (above input) --- */
.dmc-attachment-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--gray-100);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    font-size: 13px;
}

.dmc-attach-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
}

.dmc-attach-icon {
    font-size: 24px;
    color: var(--primary);
}

.dmc-attach-name {
    font-weight: 500;
    color: var(--gray-800);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dmc-attach-size {
    color: var(--gray-500);
    white-space: nowrap;
}

.dmc-attach-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.dmc-attach-remove:hover {
    color: var(--danger);
    background: var(--danger-light);
}

/* --- Chat Input Area --- */
.dmc-chat-input-area {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: var(--white);
    flex-shrink: 0;
}

.dmc-chat-input-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.dmc-chat-input-wrap {
    flex: 1;
    position: relative;
}

#dmc-message-input {
    width: 100%;
    min-height: 42px;
    max-height: 120px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 21px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    line-height: 1.5;
    transition: border-color 0.2s;
    overflow-y: auto;
}

#dmc-message-input:focus {
    outline: none;
    border-color: var(--primary);
}

#dmc-message-input:disabled {
    background: var(--gray-100);
    cursor: not-allowed;
}

.dmc-chat-input-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

#dmc-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background 0.2s, transform 0.1s;
    flex-shrink: 0;
}

#dmc-send-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: scale(1.05);
}

#dmc-send-btn:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    transform: none;
}

#dmc-attach-btn,
#dmc-emoji-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: none;
    border: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    font-size: 15px;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

#dmc-attach-btn:hover,
#dmc-emoji-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-light);
}

/* --- Empty / No Chat Selected State --- */
.dmc-chat-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    gap: 16px;
    padding: 40px;
}

.dmc-chat-empty-state i {
    font-size: 64px;
    opacity: 0.3;
}

.dmc-chat-empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-600);
}

.dmc-chat-empty-state p {
    font-size: 14px;
    text-align: center;
    max-width: 280px;
}

/* ============================================================
   2. FILE MANAGER
   ============================================================ */

.dmc-files-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* --- Toolbar --- */
.dmc-files-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: var(--white);
    padding: 14px 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.dmc-files-filter-tabs {
    display: flex;
    gap: 4px;
    background: var(--gray-100);
    padding: 4px;
    border-radius: var(--radius-md);
}

.dmc-files-filter-tab {
    padding: 6px 14px;
    border: none;
    background: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.dmc-files-filter-tab.active,
.dmc-files-filter-tab:hover {
    background: var(--white);
    color: var(--primary);
    box-shadow: var(--shadow-xs);
}

.dmc-files-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.dmc-view-toggle {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    background: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    font-size: 14px;
    transition: all 0.15s;
}

.dmc-view-toggle.active,
.dmc-view-toggle:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

/* --- Bulk Actions Bar --- */
#dmc-bulk-actions-bar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    background: var(--primary-light);
    border: 1px solid var(--primary);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--primary-dark);
}

#dmc-bulk-actions-bar.active {
    display: flex;
}

/* --- File Grid --- */
#dmc-files-grid {
    display: grid;
    gap: 16px;
}

#dmc-files-grid.dmc-view-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

#dmc-files-grid.dmc-view-list {
    grid-template-columns: 1fr;
}

/* --- File Card (Grid View) --- */
.dmc-file-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
    position: relative;
}

.dmc-file-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary);
}

.dmc-file-card.dmc-card-deleting {
    opacity: 0.5;
    pointer-events: none;
}

.dmc-file-card-header {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 2;
}

.dmc-file-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

.dmc-file-direction {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.dmc-file-direction--sent {
    background: var(--primary-light);
    color: var(--primary);
}

.dmc-file-direction--received {
    background: var(--success-light);
    color: var(--success);
}

.dmc-file-thumb {
    width: 100%;
    height: 140px;
    background-size: cover;
    background-position: center;
    background-color: var(--gray-100);
}

.dmc-file-thumb--icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-50);
}

.dmc-file-thumb--icon i {
    font-size: 48px;
    color: var(--gray-300);
}

.dmc-file-info {
    padding: 12px;
}

.dmc-file-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0 0 4px;
}

.dmc-file-meta {
    font-size: 11px;
    color: var(--gray-500);
    margin: 0 0 4px;
}

.dmc-file-client,
.dmc-file-project {
    font-size: 11px;
    color: var(--gray-500);
    margin: 0 0 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.dmc-file-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border-top: 1px solid var(--border);
    background: var(--gray-50);
}

/* --- File Card (List View) --- */
.dmc-view-list .dmc-file-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
}

.dmc-view-list .dmc-file-card-header {
    position: static;
    flex-shrink: 0;
}

.dmc-view-list .dmc-file-thumb {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.dmc-view-list .dmc-file-thumb--icon {
    width: 48px;
    height: 48px;
}

.dmc-view-list .dmc-file-thumb--icon i {
    font-size: 24px;
}

.dmc-view-list .dmc-file-info {
    flex: 1;
    padding: 0;
    min-width: 0;
}

.dmc-view-list .dmc-file-actions {
    border-top: none;
    background: none;
    padding: 0;
    flex-shrink: 0;
}

/* --- Drop Zone --- */
#dmc-drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: var(--gray-50);
}

#dmc-drop-zone:hover,
#dmc-drop-zone.dmc-drop-active {
    border-color: var(--primary);
    background: var(--primary-light);
}

#dmc-drop-zone i {
    font-size: 40px;
    color: var(--gray-300);
    margin-bottom: 12px;
    display: block;
    transition: color 0.2s;
}

#dmc-drop-zone:hover i,
#dmc-drop-zone.dmc-drop-active i {
    color: var(--primary);
}

#dmc-drop-zone p {
    font-size: 14px;
    color: var(--gray-500);
    margin: 0 0 4px;
}

#dmc-drop-zone span {
    font-size: 12px;
    color: var(--gray-400);
}

/* --- Drag Overlay --- */
#dmc-drag-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(79, 70, 229, 0.08);
    border: 3px dashed var(--primary);
    z-index: 9999;
    pointer-events: none;
    border-radius: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    font-size: 20px;
    font-weight: 600;
    color: var(--primary);
}

#dmc-drag-overlay.active {
    display: flex;
}

/* --- Upload Queue --- */
#dmc-upload-queue {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--gray-50);
}

.dmc-queue-empty {
    padding: 24px;
    text-align: center;
    color: var(--gray-400);
    font-size: 13px;
    margin: 0;
}

.dmc-queue-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--white);
    transition: background 0.15s;
}

.dmc-queue-item:last-child {
    border-bottom: none;
}

.dmc-queue-thumb-wrap {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dmc-queue-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dmc-queue-icon {
    font-size: 20px;
    color: var(--gray-400);
}

.dmc-queue-info {
    flex: 1;
    min-width: 0;
}

.dmc-queue-name {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dmc-queue-size {
    font-size: 11px;
    color: var(--gray-500);
}

.dmc-queue-progress {
    width: 80px;
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
}

.dmc-queue-progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.2s;
}

.dmc-bar-success { background: var(--success) !important; }
.dmc-bar-error   { background: var(--danger)  !important; }

.dmc-queue-status {
    flex-shrink: 0;
    width: 28px;
    text-align: center;
}

.dmc-upload-spinner { color: var(--primary); }
.dmc-upload-success { color: var(--success); font-size: 16px; }
.dmc-upload-error   { color: var(--danger);  font-size: 16px; }

/* --- Lightbox --- */
#dmc-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
}

#dmc-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
}

#dmc-lightbox-content {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    padding: 60px 80px 40px;
}

#dmc-lightbox-media {
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#dmc-lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

#dmc-lightbox-caption {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    text-align: center;
    max-width: 600px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#dmc-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: none;
    color: var(--white);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

#dmc-lightbox-close:hover {
    background: rgba(255,255,255,0.3);
}

#dmc-lightbox-prev,
#dmc-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: none;
    color: var(--white);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

#dmc-lightbox-prev { left: 20px; }
#dmc-lightbox-next { right: 20px; }

#dmc-lightbox-prev:hover,
#dmc-lightbox-next:hover {
    background: rgba(255,255,255,0.3);
}

.dmc-lightbox-file-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: var(--white);
}

.dmc-lightbox-file-icon i {
    font-size: 80px;
    opacity: 0.7;
}

.dmc-lightbox-file-icon p {
    font-size: 16px;
    font-weight: 500;
}

body.dmc-lightbox-open {
    overflow: hidden;
}

/* ============================================================
   3. ONBOARDING WIZARD
   ============================================================ */

.dmc-wizard-container {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
    max-width: 760px;
    margin: 0 auto;
}

.dmc-wizard-steps {
    display: flex;
    background: var(--gray-50);
    border-bottom: 1px solid var(--border);
    padding: 0;
}

.dmc-wizard-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px 12px;
    position: relative;
    cursor: default;
}

.dmc-wizard-step::after {
    content: '';
    position: absolute;
    top: 28px;
    right: -50%;
    width: 100%;
    height: 2px;
    background: var(--border);
    z-index: 0;
}

.dmc-wizard-step:last-child::after {
    display: none;
}

.dmc-step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-500);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    transition: background 0.3s, color 0.3s;
}

.dmc-wizard-step.active .dmc-step-number {
    background: var(--primary);
    color: var(--white);
}

.dmc-wizard-step.completed .dmc-step-number {
    background: var(--success);
    color: var(--white);
}

.dmc-wizard-step.completed .dmc-step-number::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

.dmc-wizard-step.completed .dmc-step-number span {
    display: none;
}

.dmc-step-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-500);
    text-align: center;
    transition: color 0.3s;
}

.dmc-wizard-step.active .dmc-step-label {
    color: var(--primary);
    font-weight: 600;
}

.dmc-wizard-step.completed .dmc-step-label {
    color: var(--success);
}

.dmc-wizard-body {
    padding: 32px 40px;
}

.dmc-wizard-pane {
    display: none;
}

.dmc-wizard-pane.active {
    display: block;
    animation: fadeInUp 0.25s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dmc-wizard-pane h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 6px;
}

.dmc-wizard-pane > p {
    font-size: 14px;
    color: var(--gray-500);
    margin: 0 0 24px;
}

.dmc-wizard-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 40px;
    border-top: 1px solid var(--border);
    background: var(--gray-50);
}

/* --- Review Step --- */
.dmc-review-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.dmc-review-section {
    background: var(--gray-50);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
}

.dmc-review-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 12px;
}

.dmc-review-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.dmc-review-row:last-child {
    border-bottom: none;
}

.dmc-review-label {
    color: var(--gray-500);
    flex-shrink: 0;
}

.dmc-review-value {
    color: var(--gray-900);
    font-weight: 500;
    text-align: right;
}

/* --- Success State --- */
.dmc-wizard-success {
    text-align: center;
    padding: 48px 40px;
}

.dmc-success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--success-light);
    color: var(--success);
    font-size: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    animation: successPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes successPop {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.dmc-wizard-success h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 8px;
}

.dmc-wizard-success p {
    font-size: 15px;
    color: var(--gray-500);
    margin: 0 0 32px;
}

/* ============================================================
   4. INVOICE STYLES
   ============================================================ */

.dmc-invoice-preview {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    font-size: 14px;
}

.dmc-invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
}

.dmc-invoice-logo {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
}

.dmc-invoice-logo span {
    color: var(--gray-900);
}

.dmc-invoice-meta {
    text-align: right;
}

.dmc-invoice-number {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
}

.dmc-invoice-date {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 4px;
}

.dmc-invoice-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 28px;
}

.dmc-invoice-party h4 {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin: 0 0 8px;
}

.dmc-invoice-party p {
    font-size: 13px;
    color: var(--gray-700);
    margin: 0 0 2px;
    line-height: 1.6;
}

.dmc-invoice-party strong {
    color: var(--gray-900);
    font-weight: 600;
}

.dmc-invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}

.dmc-invoice-table th {
    background: var(--gray-50);
    padding: 10px 12px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--border);
}

.dmc-invoice-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--gray-700);
}

.dmc-invoice-table td:last-child,
.dmc-invoice-table th:last-child {
    text-align: right;
}

.dmc-invoice-totals {
    display: flex;
    justify-content: flex-end;
}

.dmc-invoice-totals-table {
    width: 260px;
}

.dmc-totals-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    color: var(--gray-600);
    border-bottom: 1px solid var(--border);
}

.dmc-totals-row:last-child {
    border-bottom: none;
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
    padding-top: 10px;
}

.dmc-invoice-notes {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--gray-500);
}

.dmc-invoice-notes strong {
    color: var(--gray-700);
}

/* --- Line Items Builder --- */
.dmc-line-items {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.dmc-line-item-header {
    display: grid;
    grid-template-columns: 1fr 80px 100px 100px 36px;
    gap: 8px;
    padding: 8px 12px;
    background: var(--gray-50);
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
}

.dmc-line-item-row {
    display: grid;
    grid-template-columns: 1fr 80px 100px 100px 36px;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    align-items: center;
}

.dmc-line-item-row:last-child {
    border-bottom: none;
}

.dmc-line-item-row input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    transition: border-color 0.2s;
}

.dmc-line-item-row input:focus {
    outline: none;
    border-color: var(--primary);
}

.dmc-line-item-total {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-800);
    text-align: right;
}

.dmc-remove-line-item {
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--gray-400);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
}

.dmc-remove-line-item:hover {
    color: var(--danger);
    background: var(--danger-light);
}

.dmc-add-line-item {
    padding: 10px 12px;
    background: var(--gray-50);
    border-top: 1px solid var(--border);
}

/* ============================================================
   5. PROJECT CARDS & PROGRESS
   ============================================================ */

.dmc-project-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}

.dmc-project-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary);
}

.dmc-project-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.dmc-project-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 4px;
}

.dmc-project-client {
    font-size: 12px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 4px;
}

.dmc-project-progress-wrap {
    margin: 14px 0;
}

.dmc-project-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 6px;
}

.dmc-project-progress-bar {
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.dmc-project-progress-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.dmc-project-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--gray-500);
    flex-wrap: wrap;
}

.dmc-project-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dmc-project-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

/* ============================================================
   6. TICKET STYLES
   ============================================================ */

.dmc-ticket-accordion {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 8px;
    transition: box-shadow 0.2s;
}

.dmc-ticket-accordion:hover {
    box-shadow: var(--shadow-sm);
}

.dmc-ticket-accordion-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.dmc-ticket-accordion-header:hover {
    background: var(--gray-50);
}

.dmc-ticket-accordion-header.active {
    background: var(--primary-light);
}

.dmc-ticket-accordion-body {
    display: none;
    padding: 16px;
    border-top: 1px solid var(--border);
    background: var(--gray-50);
    font-size: 14px;
    color: var(--gray-700);
    line-height: 1.6;
}

.dmc-ticket-accordion-body.active {
    display: block;
    animation: fadeInUp 0.2s ease;
}

.dmc-ticket-subject {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-800);
}

.dmc-ticket-chevron {
    color: var(--gray-400);
    transition: transform 0.2s;
}

.dmc-ticket-accordion-header.active .dmc-ticket-chevron {
    transform: rotate(180deg);
}

/* ============================================================
   7. STAT CARDS ENHANCED
   ============================================================ */

.dmc-stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: box-shadow 0.2s, transform 0.2s;
    position: relative;
    overflow: hidden;
}

.dmc-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.2s;
}

.dmc-stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.dmc-stat-card:hover::before {
    opacity: 1;
}

.dmc-stat-card--success::before { background: var(--success); }
.dmc-stat-card--warning::before { background: var(--warning); }
.dmc-stat-card--danger::before  { background: var(--danger);  }
.dmc-stat-card--info::before    { background: var(--info);    }

.dmc-stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.dmc-stat-icon--primary { background: var(--primary-light); color: var(--primary); }
.dmc-stat-icon--success { background: var(--success-light); color: var(--success); }
.dmc-stat-icon--warning { background: var(--warning-light); color: var(--warning); }
.dmc-stat-icon--danger  { background: var(--danger-light);  color: var(--danger);  }
.dmc-stat-icon--info    { background: var(--info-light);    color: var(--info);    }

.dmc-stat-body {
    flex: 1;
    min-width: 0;
}

.dmc-stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1;
    margin-bottom: 4px;
}

.dmc-stat-label {
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 500;
}

.dmc-stat-change {
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 3px;
    margin-top: 4px;
}

.dmc-stat-change--up   { color: var(--success); }
.dmc-stat-change--down { color: var(--danger);  }

/* ============================================================
   8. NOTIFICATIONS PANEL
   ============================================================ */

.dmc-notifications-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    overflow: hidden;
    display: none;
}

.dmc-notifications-panel.active {
    display: block;
    animation: fadeInDown 0.2s ease;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dmc-notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.dmc-notif-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.dmc-notif-list {
    max-height: 320px;
    overflow-y: auto;
}

.dmc-notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
    cursor: pointer;
}

.dmc-notif-item:hover {
    background: var(--gray-50);
}

.dmc-notif-item.unread {
    background: var(--primary-light);
}

.dmc-notif-item.unread:hover {
    background: #e0e7ff;
}

.dmc-notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.dmc-notif-body {
    flex: 1;
    min-width: 0;
}

.dmc-notif-text {
    font-size: 13px;
    color: var(--gray-700);
    line-height: 1.4;
    margin: 0 0 3px;
}

.dmc-notif-time {
    font-size: 11px;
    color: var(--gray-400);
}

.dmc-notif-footer {
    padding: 10px 16px;
    text-align: center;
    border-top: 1px solid var(--border);
}

.dmc-notif-footer a {
    font-size: 13px;
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
}

.dmc-notif-footer a:hover {
    text-decoration: underline;
}

/* ============================================================
   9. RESPONSIVE OVERRIDES
   ============================================================ */

@media (max-width: 1024px) {
    .dmc-messages-layout {
        grid-template-columns: 280px 1fr;
    }

    .dmc-review-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dmc-messages-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .dmc-threads-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border);
        max-height: 240px;
    }

    .dmc-chat-panel {
        height: 60vh;
    }

    .dmc-wizard-body {
        padding: 24px 20px;
    }

    .dmc-wizard-footer {
        padding: 16px 20px;
    }

    .dmc-wizard-steps {
        overflow-x: auto;
    }

    .dmc-wizard-step {
        min-width: 80px;
    }

    .dmc-invoice-header,
    .dmc-invoice-parties {
        grid-template-columns: 1fr;
    }

    .dmc-invoice-header {
        flex-direction: column;
        gap: 16px;
    }

    .dmc-invoice-meta {
        text-align: left;
    }

    .dmc-line-item-header,
    .dmc-line-item-row {
        grid-template-columns: 1fr 60px 80px 80px 28px;
    }

    #dmc-files-grid.dmc-view-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .dmc-notifications-panel {
        width: 300px;
        right: -60px;
    }
}

@media (max-width: 480px) {
    .dmc-messages-layout {
        border-radius: 0;
    }

    .dmc-files-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .dmc-files-toolbar-right {
        margin-left: 0;
        justify-content: space-between;
    }

    #dmc-files-grid.dmc-view-grid {
        grid-template-columns: 1fr 1fr;
    }

    .dmc-wizard-step::after {
        display: none;
    }

    .dmc-step-label {
        display: none;
    }
}

/* ============================================================
   10. PRINT STYLES
   ============================================================ */

@media print {
    .dmc-sidebar,
    .dmc-topbar,
    .dmc-chat-input-area,
    .dmc-threads-sidebar,
    .dmc-file-actions,
    .dmc-files-toolbar,
    .dmc-wizard-footer,
    .dmc-btn,
    button {
        display: none !important;
    }

    .dmc-main-content {
        margin: 0 !important;
        padding: 0 !important;
    }

    .dmc-invoice-preview {
        box-shadow: none;
        border: none;
        padding: 0;
    }

    .dmc-invoice-table th {
        background: #f5f5f5 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}