:root {
    --sidebar-width: 250px;
    --navbar-height: 68px;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
    --primary-hover: #5a6fd6;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --bg-page: #f8fafc;
    --border-color: #e2e8f0;
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-page);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Top Navbar */
.navbar {
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--navbar-height);
    border-bottom: 1px solid var(--border-color);
}

.navbar-inner {
    width: 100%;
    height: 100%;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle-btn {
    display: none;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    color: var(--text-main);
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sidebar-toggle-btn:hover {
    background: #f1f5f9;
}

.nav-brand {
    font-size: 22px;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(102, 126, 234, 0.08);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color);
}

.brand-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

/* Dashboard Container */
.dashboard-container {
    display: flex;
    flex: 1;
    min-height: calc(100vh - var(--navbar-height));
    position: relative;
}

/* Sidebar Left Panel */
.sidebar-panel {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: #ffffff;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px 14px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 90;
}

.sidebar-brand-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.06) 0%, rgba(118, 75, 162, 0.06) 100%);
    border: 1px solid rgba(102, 126, 234, 0.15);
    border-radius: 12px;
    margin-bottom: 24px;
}

.brand-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary-gradient);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.brand-meta {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.brand-meta-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-meta-status {
    font-size: 11px;
    color: #10b981;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sidebar-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #94a3b8;
    font-weight: 700;
    padding: 0 12px;
    margin-bottom: 8px;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    position: relative;
}

.menu-item:hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

.menu-item.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.12) 100%);
    color: var(--primary-color);
    font-weight: 600;
}

.menu-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--primary-gradient);
}

.menu-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: inherit;
    flex-shrink: 0;
}

.menu-badge {
    margin-left: auto;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    line-height: 1;
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
}

/* Main Content Area */
.dashboard-main {
    flex: 1;
    padding: 28px 36px;
    overflow-y: auto;
    background: #f8fafc;
}

.pane-header {
    margin-bottom: 24px;
}

.pane-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-main);
    margin: 0 0 6px 0;
}

.pane-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 20px 22px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.purple { background: rgba(102, 126, 234, 0.12); color: #667eea; }
.stat-icon.green  { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.stat-icon.blue   { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }
.stat-icon.amber  { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }

.stat-details {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Card Container */
.content-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    padding: 32px;
    margin-bottom: 24px;
}

/* Banner Container */
.wip-banner {
    background: var(--primary-gradient);
    border-radius: 16px;
    padding: 36px 32px;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.25);
}

.wip-banner-left {
    max-width: 600px;
}

.wip-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 12px;
    backdrop-filter: blur(4px);
}

.wip-banner-title {
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 8px 0;
}

.wip-banner-desc {
    font-size: 14px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.6;
}

/* Feature Placeholder List */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.feature-box {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: all 0.2s;
}

.feature-box:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.feature-box h4 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.feature-box p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.6;
}

/* Form Details Grid */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* Message List */
.message-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 16px 20px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: background-color 0.2s;
}

.message-item:hover {
    background: #ffffff;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(102, 126, 234, 0.15);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message-content h5 {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
}

.message-content p {
    margin: 0 0 6px 0;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.message-time {
    font-size: 11px;
    color: #94a3b8;
}

/* Mobile Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    z-index: 80;
}

#detailImageGrid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

#detailImageGrid > div {
    aspect-ratio: 16 / 9 !important;
}

/* Responsiveness */
@media (max-width: 900px) {
    .sidebar-toggle-btn {
        display: flex;
    }

    .sidebar-panel {
        position: fixed;
        top: var(--navbar-height);
        bottom: 0;
        left: 0;
        transform: translateX(-100%);
        box-shadow: 8px 0 24px rgba(0, 0, 0, 0.12);
    }

    .sidebar-panel.open {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .dashboard-main {
        padding: 20px 18px;
    }

    .wip-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    #detailImageGrid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* Loading Spinner */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

.page-transition {
    transition: opacity 0.3s ease-in-out;
    opacity: 0;
}

.page-transition.fade-in {
    opacity: 1;
}

.page-transition.fade-out {
    opacity: 0;
}
