@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #0b0d10;
    --surface-color: #151820;
    --surface-hover: #1e222d;
    --card-bg: #151820;
    --text-primary: #f1f5f9;
    --text-secondary: #8b95a8;
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --accent-color: #ec4899;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --border-color: #252a36;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.4);
    --sidebar-width: 280px;
    --topbar-height: 68px;
    --glass-bg: rgba(21, 24, 32, 0.85);
    --input-bg: rgba(0, 0, 0, 0.25);
    --hover-overlay: rgba(255, 255, 255, 0.03);
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
}

:root.light-mode {
    --bg-color: #f8fafc;
    --surface-color: #ffffff;
    --surface-hover: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --accent-color: #db2777;
    --border-color: #e2e8f0;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --input-bg: rgba(0, 0, 0, 0.05);
    --hover-overlay: rgba(0, 0, 0, 0.02);
}

.light-mode [style*="rgba(26, 30, 36, 0.4)"] {
    background: rgba(0, 0, 0, 0.02) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

.light-mode [style*="rgba(255,255,255,0.05)"],
.light-mode [style*="rgba(255, 255, 255, 0.05)"] {
    background: rgba(0, 0, 0, 0.06) !important;
}

.light-mode [style*="rgba(0,0,0,0.2)"],
.light-mode [style*="rgba(0,0,0,0.3)"] {
    background: rgba(0, 0, 0, 0.04) !important;
}

.light-mode [style*="rgba(255,255,255,0.1)"] {
    background: rgba(0, 0, 0, 0.08) !important;
    color: var(--text-primary) !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: var(--text-primary);
}

ul {
    list-style: none;
}

/* Authentication Page */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at top left, var(--surface-hover), var(--bg-color));
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: var(--primary-color);
    border-radius: 50%;
    filter: blur(150px);
    opacity: 0.3;
    top: -100px;
    left: -100px;
}

.auth-container::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: var(--accent-color);
    border-radius: 50%;
    filter: blur(150px);
    opacity: 0.2;
    bottom: -50px;
    right: -50px;
}

.auth-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 3rem;
    border-radius: 1.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    z-index: 10;
    animation: fadeIn 0.6s ease-out;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(to right, #6366f1, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s;
}

select.form-control {
    background-color: var(--surface-color);
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
    appearance: none;
}

.light-mode select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
}

select.form-control option {
    background-color: var(--surface-color);
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.btn {
    display: inline-block;
    width: 100%;
    padding: 0.8rem 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 1rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* Dashboard Layout */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--surface-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 200;
    transition: transform 0.3s ease;
}

.sidebar-header {
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar-header h2 {
    font-weight: 700;
    font-size: 1.15rem;
    background: linear-gradient(to right, #818cf8, #f472b6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.brand-tagline {
    font-size: 0.7rem;
    color: var(--text-secondary);
    display: block;
    font-weight: 400;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.4rem;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.75rem;
}

.nav-section {
    margin-bottom: 1.25rem;
}

.nav-section-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
    opacity: 0.7;
}

.nav-item {
    margin-bottom: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    border: 1px solid transparent;
}

.nav-link:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.nav-link.active {
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary-color);
    border-color: rgba(99, 102, 241, 0.25);
}

.nav-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.nav-link.active .nav-icon {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-color);
}

.nav-step {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #818cf8);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-step.muted {
    background: var(--surface-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.nav-link.active .nav-step {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.nav-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.nav-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: inherit;
    line-height: 1.3;
}

.nav-desc {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1.2;
}

.nav-link.active .nav-desc {
    color: rgba(99, 102, 241, 0.7);
}

.sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid var(--border-color);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
}

.sidebar-user-info strong {
    font-size: 0.85rem;
}

.sidebar-user-info span {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.logout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.75rem;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    color: #f87171;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.15);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    height: var(--topbar-height);
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 90;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1rem;
    align-items: center;
    justify-content: center;
}

.topbar-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.2;
}

.topbar-breadcrumb {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.1rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.75rem 0.35rem 0.35rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.avatar.sm {
    width: 30px;
    height: 30px;
    font-size: 0.75rem;
}

.page-content {
    padding: 2rem;
    flex: 1;
    animation: fadeIn 0.4s ease-out;
}

/* Base Components */
.card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

/* Decorative Stat Cards */
.stat-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.stat-info h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Data Tables */
.table-container {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tr:hover {
    background: var(--hover-overlay);
}

/* Empty State / Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 1rem;
    padding: 4rem 2rem;
    text-align: center;
    transition: all 0.3s;
    background: var(--input-bg);
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.upload-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.upload-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1024px) {
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}


@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .sidebar-close {
        display: block;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 199;
        backdrop-filter: blur(2px);
    }

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

    .sidebar {
        transform: translateX(-100%);
    }

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

    .main-content {
        margin-left: 0;
    }

    .grid-cols-4,
    .grid-cols-2 {
        grid-template-columns: 1fr;
    }

    .user-chip span {
        display: none;
    }
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
    animation: modalFadeIn 0.3s ease-out;
}

.modal-content {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: modalSlideUp 0.3s ease-out;
}

.modal-header {
    padding: 0.9rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   DASHBOARD — Modern UI Components
   ============================================================ */

.dash-hero {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(236, 72, 153, 0.08) 50%, transparent 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    position: relative;
    overflow: hidden;
}

.dash-hero::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.2), transparent 70%);
    pointer-events: none;
}

.dash-greeting {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.4rem;
}

.dash-hero-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary), #a5b4fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.dash-hero-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    max-width: 520px;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.dash-hero-progress {
    max-width: 400px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.progress-header strong {
    color: var(--primary-color);
}

.progress-bar {
    height: 8px;
    background: var(--input-bg);
    border-radius: 99px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 99px;
    transition: width 0.6s ease;
}

.dash-hero-stats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex-shrink: 0;
}

.hero-stat {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.1rem;
    min-width: 160px;
}

.hero-stat i {
    font-size: 1.25rem;
    color: var(--primary-color);
}

.hero-stat strong {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
}

.hero-stat span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Stat Grid v2 */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card-v2 {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
}

.stat-card-v2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.stat-card-v2.stat-indigo::before { background: linear-gradient(90deg, #6366f1, #818cf8); }
.stat-card-v2.stat-pink::before { background: linear-gradient(90deg, #ec4899, #f472b6); }
.stat-card-v2.stat-green::before { background: linear-gradient(90deg, #10b981, #34d399); }
.stat-card-v2.stat-amber::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

.stat-card-v2:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: rgba(99, 102, 241, 0.3);
}

.stat-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.stat-icon-v2 {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.stat-indigo .stat-icon-v2 { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.stat-pink .stat-icon-v2 { background: rgba(236, 72, 153, 0.15); color: #f472b6; }
.stat-green .stat-icon-v2 { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.stat-amber .stat-icon-v2 { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

.stat-trend {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    background: var(--input-bg);
    padding: 0.2rem 0.5rem;
    border-radius: 99px;
    border: 1px solid var(--border-color);
}

.stat-trend.live {
    color: #34d399;
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-value small {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Section header */
.section-header {
    margin-bottom: 1.25rem;
}

.section-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.section-header h2 i {
    color: var(--primary-color);
}

.section-header p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Workflow cards */
.workflow-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.workflow-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s;
    display: flex;
    flex-direction: column;
}

.workflow-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: rgba(99, 102, 241, 0.35);
}

.workflow-card.done {
    border-color: rgba(16, 185, 129, 0.3);
    background: linear-gradient(135deg, var(--surface-color), rgba(16, 185, 129, 0.04));
}

.workflow-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.workflow-step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--input-bg);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.workflow-step.done {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--success-color);
    color: var(--success-color);
}

.workflow-icon {
    font-size: 1.25rem;
    color: var(--text-secondary);
    opacity: 0.5;
}

.workflow-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.workflow-card p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    flex: 1;
    line-height: 1.5;
}

.workflow-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.workflow-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.workflow-arrow {
    color: var(--primary-color);
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.workflow-card:hover .workflow-arrow {
    opacity: 1;
}

/* Dashboard panels */
.dash-panels {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.dash-panel {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--input-bg);
}

.panel-header h3 {
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-link {
    font-size: 0.75rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.panel-link:hover {
    text-decoration: underline;
}

.panel-body {
    padding: 0.75rem;
}

.panel-subheader {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    padding: 0.75rem 0.5rem 0.25rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.activity-item:hover {
    background: var(--hover-overlay);
}

.activity-item.muted {
    opacity: 0.7;
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.activity-icon.online { background: rgba(16, 185, 129, 0.12); color: #34d399; }
.activity-icon.offline { background: rgba(239, 68, 68, 0.1); color: #f87171; }
.activity-icon.play { background: rgba(99, 102, 241, 0.12); color: #818cf8; }
.activity-icon.track { background: rgba(245, 158, 11, 0.12); color: #fbbf24; }

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-content strong {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-content span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.activity-time {
    font-size: 0.7rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.status-pill {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.status-pill.online {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
}

.status-pill.offline {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

.empty-state-sm {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
}

.empty-state-sm i {
    font-size: 2rem;
    opacity: 0.3;
    margin-bottom: 0.75rem;
    display: block;
}

.empty-state-sm p {
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.btn-sm {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-sm:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

/* Tips banner */
.tips-banner {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.tips-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.tips-banner strong {
    color: var(--text-primary);
}

.tips-banner em {
    color: var(--primary-color);
    font-style: normal;
    font-weight: 600;
}

/* Status badge (shared) */
.status-badge {
    background: var(--input-bg);
    color: var(--text-secondary);
    padding: 0.15rem 0.5rem;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    border: 1px solid var(--border-color);
}

/* Pagination */
.pagination {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    text-decoration: none;
}

.pagination a:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination .active span {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

@media (max-width: 1200px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .workflow-grid { grid-template-columns: repeat(2, 1fr); }
    .dash-panels { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .dash-hero {
        flex-direction: column;
    }

    .dash-hero-stats {
        flex-direction: row;
        width: 100%;
    }

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

    .stat-grid { grid-template-columns: 1fr 1fr; }
    .workflow-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .stat-grid { grid-template-columns: 1fr; }
    .dash-hero-stats { flex-direction: column; }
}

/* ============================================================
   SHARED PAGE COMPONENTS
   ============================================================ */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.page-step-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    margin-bottom: 0.5rem;
}

.page-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 0.35rem;
    line-height: 1.2;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    max-width: 560px;
    line-height: 1.5;
}

.page-header-actions {
    display: flex;
    gap: 0.6rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* Button variants */
.btn-auto {
    width: auto !important;
    padding: 0.65rem 1.25rem !important;
    font-size: 0.875rem !important;
    display: inline-flex !important;
    align-items: center;
    gap: 0.5rem;
}

.btn-success { background: linear-gradient(135deg, #10b981, #059669) !important; }
.btn-teal { background: linear-gradient(135deg, #0d9488, #0f766e) !important; }
.btn-danger { background: linear-gradient(135deg, #ef4444, #dc2626) !important; }
.btn-ghost {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
}
.btn-ghost:hover { border-color: var(--primary-color) !important; box-shadow: none !important; }

/* Alerts */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.alert i { font-size: 1.1rem; margin-top: 0.1rem; flex-shrink: 0; }
.alert ul { margin: 0; padding-left: 1.2rem; }
.alert-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.25); color: #34d399; }
.alert-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.25); color: #f87171; }
.alert-info { background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.25); color: #60a5fa; }
.mono-creds { font-family: monospace; font-size: 0.8rem; margin-top: 0.4rem; line-height: 1.8; }

/* Card variants */
.card-accent { border-top: 3px solid var(--primary-color); }
.card-accent.blue { border-top-color: #3b82f6; }
.card-accent.pink { border-top-color: var(--accent-color); }
.card-accent.teal { border-top-color: #0d9488; }

.card-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.card-toolbar h3 {
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-bar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.search-bar .form-control {
    width: 220px;
    font-size: 0.875rem;
}

.search-input-wrap {
    position: relative;
}

.search-input-wrap i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 0.8rem;
    pointer-events: none;
}

.search-input-wrap .form-control {
    padding-left: 2.25rem;
}

/* Type badges */
.type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.type-badge.song { background: rgba(99,102,241,0.15); color: #818cf8; }
.type-badge.jingles { background: rgba(236,72,153,0.15); color: #f472b6; }
.type-badge.announcement { background: rgba(245,158,11,0.15); color: #fbbf24; }
.type-badge.advertisement { background: rgba(16,185,129,0.15); color: #34d399; }

/* Action icon buttons in tables */
.btn-icon-action {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.btn-icon-action:hover { border-color: var(--primary-color); color: var(--primary-color); }
.btn-icon-action.play { color: #3b82f6; border-color: rgba(59,130,246,0.3); background: rgba(59,130,246,0.08); }
.btn-icon-action.play:hover { background: rgba(59,130,246,0.15); }
.btn-icon-action.danger { color: #ef4444; border-color: rgba(239,68,68,0.3); }
.btn-icon-action.danger:hover { background: rgba(239,68,68,0.1); border-color: #ef4444; }

.action-group { display: flex; gap: 0.4rem; align-items: center; }

/* Icon button (devices, groups lists) */
.btn-icon {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--surface-hover);
}

/* Track type icon in table */
.track-name-cell {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 500;
}

.track-type-icon {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* List items (devices, groups) */
.list-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.15rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--input-bg);
    transition: all 0.2s;
    margin-bottom: 0.6rem;
}

.list-item:hover {
    border-color: rgba(99,102,241,0.35);
    background: var(--surface-hover);
}

.list-item-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.list-item-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.list-item-icon.online { background: rgba(16,185,129,0.12); color: #34d399; }
.list-item-icon.offline { background: rgba(239,68,68,0.1); color: #f87171; }
.list-item-icon.group { background: rgba(236,72,153,0.12); color: var(--accent-color); }

.list-item-title { font-weight: 600; font-size: 0.9rem; }
.list-item-meta { font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.15rem; }

/* Map card */
.map-card { margin-bottom: 1.75rem; }
.map-card .card-toolbar h3 { color: #3b82f6; }
#fleetMap { height: 320px; width: 100%; border-radius: var(--radius-md); border: 1px solid var(--border-color); }

/* Help tip inline */
.help-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: rgba(99,102,241,0.06);
    border: 1px solid rgba(99,102,241,0.15);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.help-tip i { color: var(--primary-color); margin-top: 0.1rem; }

/* Empty table state */
.table-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-secondary);
}

.table-empty i { font-size: 2.5rem; opacity: 0.25; display: block; margin-bottom: 0.75rem; }

/* Playlist page accent override */
.playlist-accent-btn {
    background: linear-gradient(135deg, #c2410c, #9a3412) !important;
}

@media (max-width: 768px) {
    .page-header { flex-direction: column; }
    .search-bar .form-control { width: 100%; }
    .search-bar { width: 100%; }
}