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

:root {
    --primary: #0f172a;
    --primary-light: #1e293b;
    --accent: #0ea5e9;
    --accent-light: #38bdf8;
    --accent-gradient: linear-gradient(135deg, #0ea5e9 0%, #14b8a6 100%);
    --bg-gradient: radial-gradient(circle at 10% 20%, rgba(15, 23, 42, 0.03) 0%, rgba(14, 165, 233, 0.05) 100%);
    --surface: #ffffff;
    --surface-glass: rgba(255, 255, 255, 0.75);
    --border: rgba(226, 232, 240, 0.8);
    --text: #0f172a;
    --text-muted: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius: 16px;
    --shadow-sm: 0 2px 8px -2px rgba(15, 23, 42, 0.05);
    --shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 40px -15px rgba(15, 23, 42, 0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Overrides */
[data-theme="dark"] {
    --primary: #f8fafc;
    --primary-light: #e2e8f0;
    --bg-gradient: radial-gradient(circle at 10% 20%, #090d16 0%, #0f172a 100%);
    --surface: #1e293b;
    --surface-glass: rgba(30, 41, 59, 0.7);
    --border: rgba(51, 65, 85, 0.8);
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    transition: var(--transition);
}

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

aside.sidebar {
    width: 280px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    transition: var(--transition);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] aside.sidebar {
    background: rgba(15, 23, 42, 0.98);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 3rem;
}

.brand-logo {
    background: var(--accent-gradient);
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    box-shadow: 0 8px 16px rgba(14, 165, 233, 0.3);
}

.brand-text h2 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.brand-text span {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #94a3b8;
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    cursor: pointer;
}

.nav-item a:hover, .nav-item.active a {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.nav-item.active a {
    background: var(--accent-gradient);
    box-shadow: 0 4px 15px -3px rgba(14, 165, 233, 0.3);
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
}

.theme-toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: #ffffff;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Main Content Area */
main.main-content {
    flex-grow: 1;
    margin-left: 280px;
    padding: 2rem 3rem;
    transition: var(--transition);
    max-width: 1600px;
}

/* Top bar / Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.page-title h1 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.page-title p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Cards & Grid Systems */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-gradient);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-info h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.stat-info p {
    font-size: 2rem;
    font-weight: 800;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: rgba(14, 165, 233, 0.1);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

@media (max-width: 992px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
    aside.sidebar {
        width: 80px;
        padding: 2rem 0.75rem;
    }
    aside.sidebar .brand-text, 
    aside.sidebar .nav-item span,
    aside.sidebar .theme-toggle-btn span {
        display: none;
    }
    main.main-content {
        margin-left: 80px;
        padding: 2rem 1.5rem;
    }
    .brand {
        justify-content: center;
    }
}

.card {
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title i {
    color: var(--accent);
}

/* Forms & UI Inputs */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 0.95rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.4);
    color: var(--text);
    transition: var(--transition);
}

[data-theme="dark"] .form-control {
    background: rgba(15, 23, 42, 0.2);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px -3px rgba(14, 165, 233, 0.3);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -3px rgba(14, 165, 233, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 12px 24px;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Surveys Specific Emojis/Rating buttons */
.rating-group {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 8px;
}

.rating-btn {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.5);
    padding: 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}

[data-theme="dark"] .rating-btn {
    background: rgba(30, 41, 59, 0.3);
}

.rating-btn .emoji {
    font-size: 1.75rem;
    transition: var(--transition);
}

.rating-btn span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.rating-btn:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.rating-btn.active[data-val="1"] { background: rgba(239, 68, 68, 0.15); border-color: var(--danger); }
.rating-btn.active[data-val="2"] { background: rgba(245, 158, 11, 0.15); border-color: var(--warning); }
.rating-btn.active[data-val="3"] { background: rgba(14, 165, 233, 0.15); border-color: var(--accent); }
.rating-btn.active[data-val="4"] { background: rgba(16, 185, 129, 0.15); border-color: var(--success); }

.rating-btn.active span {
    color: var(--text);
}

/* Survey indicators grid */
.survey-question-card {
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.survey-question-card:last-child {
    border: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.survey-question-card h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Timeline Tracking */
.tracking-timeline {
    position: relative;
    padding: 1.5rem 0;
    margin-top: 1.5rem;
}

.tracking-timeline::before {
    content: '';
    position: absolute;
    left: 19px;
    top: 0;
    height: 100%;
    width: 2px;
    background: var(--border);
    z-index: 1;
}

.timeline-step {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

.timeline-step:last-child {
    margin-bottom: 0;
}

.step-marker {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--text-muted);
    transition: var(--transition);
}

.timeline-step.active .step-marker {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}

.timeline-step.completed .step-marker {
    background: var(--success);
    border-color: transparent;
    color: white;
}

.step-details h4 {
    font-size: 0.95rem;
    font-weight: 700;
}

.step-details p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Data Tables for Admin */
.table-container {
    overflow-x: auto;
    margin-top: 1rem;
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

table.data-table th, table.data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

table.data-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
}

table.data-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] table.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.badge-pending { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-process { background: rgba(14, 165, 233, 0.15); color: var(--accent); }
.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--success); }

/* Feedback messages */
.alert-msg {
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-msg-success { background: rgba(16, 185, 129, 0.15); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }
.alert-msg-danger { background: rgba(239, 68, 68, 0.15); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    width: 100%;
    max-width: 600px;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9);
    transition: var(--transition);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

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