/* ===== TumaMaoni - Clean Modern Layout System ===== */

/* ===== CSS Variables ===== */
:root {
    /* Colors */
    --primary: #34a8d3;
    --primary-dark: #2a8db3;
    --primary-light: rgba(52, 168, 211, 0.09);
    --secondary: var(--accent);
    --accent: var(--accent);
    --success: var(--accent);
    --warning: #f59e0b;
    --error: #ef4444;
    --neutral-50: #ffffff;
    --neutral-100: #f8fafc;
    --neutral-200: #e2e8f0;
    --neutral-300: #cbd5e1;
    --neutral-400: #94a3b8;
    --neutral-500: #64748b;
    --neutral-600: #475569;
    --neutral-700: #334155;
    --neutral-800: #1e293b;
    --neutral-900: #0f172a;
    --white: #ffffff;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;

    /* Border Radius */
    --radius: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.5;
    color: var(--neutral-800);
    background: var(--neutral-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Layout System ===== */
.dashboard-page {
    display: flex;
    min-height: 100vh;
    background: #ffffff;
}

/* ===== Sidebar ===== */
.sidebar {
    width: 280px;
    background: var(--white);
    border-right: 1px solid var(--neutral-200);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 2000;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.sidebar-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--neutral-200);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: transparent;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neutral-800);
    font-weight: 700;
    font-size: var(--text-lg);
    flex-shrink: 0;
}

.logo h1 {
    font-size: var(--text-xl);
    font-weight: 800;
    color: var(--neutral-900);
    margin: 0;
}

.logo h1 span {
    color: var(--secondary);
}

.sidebar-menu {
    flex: 1;
    padding: var(--space-4);
    overflow-y: auto;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-2);
    border-radius: var(--radius-lg);
    color: var(--neutral-600);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.84rem;
    transition: var(--transition);
    position: relative;
}

.menu-item:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateX(4px);
}

.menu-item.active {
    background: var(--primary);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.menu-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.sidebar-footer {
    padding: var(--space-4);
    border-top: 1px solid var(--neutral-200);
    background: var(--neutral-50);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--white);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-3);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
    font-size: var(--text-sm);
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    color: var(--neutral-900);
    font-size: var(--text-sm);
    line-height: 1.3;
}

.user-shop {
    font-size: var(--text-xs);
    color: var(--neutral-500);
    margin-top: 2px;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    color: var(--neutral-600);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    border: 1px solid var(--neutral-300);
    background: var(--white);
}

.logout-btn:hover {
    background: var(--error);
    color: var(--white);
    border-color: var(--error);
    transform: translateY(-1px);
}

/* ===== Settings Tabs ===== */
.settings-container {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: none;
    border: 1px solid var(--neutral-200);
    overflow: hidden;
    padding-top: 0;
}

.settings-tabs {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    background: var(--white);
    border-bottom: 1px solid var(--neutral-200);
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.settings-tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    flex: 1 1 0;
    min-width: 0;
    padding: var(--space-4) var(--space-3);
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--neutral-600);
    font-weight: 600;
    font-size: var(--text-sm);
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    text-decoration: none;
    box-shadow: none;
}

.tab-btn:hover {
    background: var(--primary-50, #e0f2fe);
    color: var(--primary);
    border-bottom-color: transparent;
}

.tab-btn.active {
    color: var(--primary);
    background: transparent;
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
    padding: var(--space-8);
}

.tab-content.active {
    display: block;
}

@media (max-width: 768px) {
    .settings-tabs .tab-btn {
        flex: 1 1 0;
        min-width: 0;
        padding: var(--space-3) var(--space-2);
        font-size: 0.75rem;
        gap: var(--space-1);
    }

    .settings-tabs .tab-btn i {
        font-size: 0.95rem;
    }

    .tab-content {
        padding: var(--space-4);
    }

    .settings-card .card-header,
    .settings-card .card-content {
        padding: var(--space-4);
    }
}

@media (max-width: 480px) {
    .settings-tabs .tab-btn {
        flex: 0 0 auto;
        min-width: max-content;
        padding: var(--space-3) var(--space-4);
    }
}

.settings-card {
    background: var(--white);
    border-radius: 0;
    box-shadow: none;
    border: none;
    margin: 0;
    padding: 0;
}

.settings-card .card-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--neutral-200);
    background: var(--neutral-50);
    margin: 0;
}

.settings-card .card-content {
    padding: var(--space-6);
}

/* ===== Form Inline ===== */
.form-inline {
    display: flex;
    gap: var(--space-3);
    align-items: end;
    flex-wrap: wrap;
}

.form-inline .form-group {
    flex: 1;
    min-width: 250px;
}

.form-actions {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-6);
}

/* ===== Department & Product Tables ===== */
.department-name,
.product-name {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.department-icon,
.product-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: var(--text-sm);
    flex-shrink: 0;
}

.feedback-count {
    font-weight: 600;
    color: var(--neutral-900);
    padding: var(--space-1) var(--space-2);
    background: var(--neutral-100);
    border-radius: var(--radius);
    font-size: var(--text-sm);
}

.recommend-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius);
    font-size: var(--text-xs);
    font-weight: 600;
}

.recommend-badge.yes {
    background: var(--success);
    color: var(--white);
}

.recommend-badge.no {
    background: var(--error);
    color: var(--white);
}

/* ===== Print Styles ===== */
@media print {

    .sidebar,
    .mobile-menu-toggle,
    .mobile-overlay,
    .header-actions,
    .stat-action,
    .btn {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding: var(--space-4);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: var(--space-8);
    background: var(--neutral-50);
}

/* ===== Header ===== */
.dashboard-header {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    padding: var(--space-8);
    margin-bottom: var(--space-8);
    border: 1px solid var(--neutral-200);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-6);
}

.header-title h1 {
    font-size: clamp(1.55rem, 2.8vw, 2.3rem);
    font-weight: 800;
    color: var(--neutral-900);
    line-height: 1.2;
    margin-bottom: var(--space-2);
}

.header-title p {
    color: var(--neutral-600);
    font-size: 0.95rem;
    margin: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-shrink: 0;
}

/* ===== Feedback Link ===== */
.feedback-link {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--neutral-100);
    border-radius: var(--radius-xl);
    border: 1px solid var(--neutral-200);
    max-width: 400px;
}

.feedback-link strong {
    color: var(--neutral-900);
    font-weight: 600;
    font-size: var(--text-sm);
    margin-bottom: var(--space-2);
    display: block;
}

.feedback-link code {
    background: var(--primary);
    color: var(--white);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius);
    font-family: 'Courier New', monospace;
    font-size: var(--text-xs);
    word-break: break-all;
    border: none;
}

.feedback-link .btn {
    margin-top: var(--space-2);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: var(--text-sm);
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

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

.btn-secondary {
    background: var(--white);
    color: var(--neutral-700);
    border-color: var(--neutral-300);
}

.btn-secondary:hover {
    background: var(--neutral-50);
    border-color: var(--neutral-400);
}

.btn-danger {
    background: var(--error);
    color: var(--white);
    border-color: var(--error);
}

.btn-danger:hover {
    background: var(--error);
    border-color: var(--error);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
}

/* ===== Cards ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--neutral-200);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    animation: slideUp 0.6s ease-out forwards;
    opacity: 0;
}

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

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

.stat-card:nth-child(1) {
    animation-delay: 0.1s;
}

.stat-card:nth-child(2) {
    animation-delay: 0.2s;
}

.stat-card:nth-child(3) {
    animation-delay: 0.3s;
}

.stat-card:nth-child(4) {
    animation-delay: 0.4s;
}



.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

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

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

.stat-icon {
    width: 56px;
    height: 56px;
    background: transparent;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neutral-700);
    font-size: var(--text-xl);
    flex-shrink: 0;
    margin-bottom: var(--space-4);
}

.stat-content {
    flex: 1;
}

.stat-content h3 {
    font-size: var(--text-3xl);
    font-weight: 800;
    color: var(--neutral-900);
    line-height: 1.2;
    margin-bottom: var(--space-1);
}

.stat-content p {
    color: var(--neutral-500);
    font-size: var(--text-sm);
    font-weight: 500;
    margin: 0;
}

.stat-action {
    margin-top: var(--space-3);
}

.stat-action .btn {
    width: 100%;
    justify-content: center;
}

.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius);
    font-size: var(--text-xs);
    font-weight: 600;
    margin-top: var(--space-3);
}

.stat-trend.positive {
    background: var(--success);
    color: var(--white);
}

.stat-trend.negative {
    background: var(--error);
    color: var(--white);
}

.stat-trend.neutral {
    background: var(--warning);
    color: var(--white);
}

/* ===== Dashboard Grid ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--space-8);
    margin-bottom: var(--space-8);
}

.charts-grid, .tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.tables-grid {
    margin-top: var(--space-6);
}

.dashboard-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--neutral-200);
    overflow: hidden;
    transition: var(--transition);
}

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

.card-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--neutral-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--neutral-50);
}

.card-header h3 {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--neutral-900);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.card-content {
    padding: var(--space-6);
}

/* ===== Tables ===== */
.table-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--neutral-200);
    overflow: hidden;
    margin-bottom: var(--space-8);
    transition: var(--transition);
}

.table-card:hover {
    box-shadow: var(--shadow-lg);
}

.table-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--neutral-200);
    background: var(--neutral-50);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-header h3 {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--neutral-900);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.table-container {
    overflow-x: auto;
    background: var(--white);
}

.feedbacks-table,
.departments-table,
.products-table {
    width: 100%;
    border-collapse: collapse;
}

.feedbacks-table th,
.feedbacks-table td,
.departments-table th,
.departments-table td,
.products-table th,
.products-table td {
    padding: var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--neutral-200);
}

.feedbacks-table th,
.departments-table th,
.products-table th {
    background: var(--neutral-50);
    font-weight: 700;
    color: var(--neutral-600);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 2px solid var(--neutral-200);
    padding: var(--space-4);
}

.feedbacks-table tr,
.departments-table tr,
.products-table tr {
    transition: var(--transition);
    animation: fadeInRow 0.5s ease forwards;
    opacity: 0;
}

@keyframes fadeInRow {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.feedbacks-table tr:hover,
.departments-table tr:hover,
.products-table tr:hover {
    background: #f1f5f9;
}

/* ===== Table Cell Components ===== */
.date-cell {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.date-cell small {
    color: var(--neutral-500);
    font-size: var(--text-xs);
}

.customer-cell {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.customer-cell small {
    color: var(--neutral-500);
    font-size: var(--text-xs);
}

.rating-cell {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    align-items: flex-start;
}

.rating-cell small {
    color: var(--neutral-500);
    font-size: var(--text-xs);
}

.stars {
    display: flex;
    gap: var(--space-1);
}

/* Rating inputs are ordered 5->1 in the DOM so reverse the visual order
   so stars appear left-to-right (1..5) while keeping CSS sibling logic */
.rating-group .stars {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: var(--space-1);
}
.stars .fas.fa-star {
    color: var(--neutral-300);
    font-size: var(--text-sm);
    transition: var(--transition);
}

.stars .fas.fa-star.filled {
    color: var(--warning);
}

/* ===== Category Tags ===== */
.category-tag {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-2);
    background: var(--neutral-100);
    color: var(--neutral-700);
    border-radius: var(--radius);
    font-size: var(--text-xs);
    font-weight: 500;
}

/* ===== Filters ===== */
.filters-card,
.dashboard-card.animate-slideUp {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--neutral-200);
    margin-bottom: var(--space-8);
    overflow: hidden;
}

.filters-header,
.card-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--neutral-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--neutral-50);
}

.filters-header h3,
.card-header h3 {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--neutral-900);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.filters-form {
    padding: var(--space-6);
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

@media (max-width: 1200px) {
    .filter-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .filter-row {
        grid-template-columns: 1fr;
    }
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 600;
    color: var(--neutral-700);
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
}

.filter-group input,
.filter-group select {
    padding: var(--space-3);
    border: 1px solid var(--neutral-300);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    background: var(--white);
    transition: var(--transition);
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
}

@media (min-width: 1024px) {
    .filter-actions .btn {
        min-width: 150px;
        max-width: fit-content;
        align-self: flex-end;
    }
}

/* ===== Analytics Header Extensions ===== */
.date-filter-form .form-row {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    background: var(--white);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    border: 1px solid var(--neutral-200);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.date-filter-form .form-row:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary-light);
}

.form-group-inline {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--neutral-500);
}

.form-group-inline i {
    font-size: var(--text-xs);
}

.form-control-minimal {
    border: none;
    background: transparent;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--neutral-800);
    padding: var(--space-1) 0;
    cursor: pointer;
    outline: none;
    font-family: inherit;
}

.range-separator {
    color: var(--neutral-300);
    font-size: var(--text-xs);
}

.date-filter-form .btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
    border-radius: var(--radius-full);
}

@media (max-width: 1024px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-4);
    }

    .header-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-3);
    }

    .date-filter-form .form-row {
        flex-direction: column;
        align-items: stretch;
        border-radius: var(--radius-lg);
        gap: var(--space-3);
        padding: var(--space-4);
    }

    .form-group-inline {
        justify-content: space-between;
    }

    .range-separator {
        text-align: center;
        transform: rotate(90deg);
    }
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--neutral-700);
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: var(--space-3);
    border: 1px solid var(--neutral-300);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    background: var(--white);
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-4);
}

.form-actions {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-6);
}

/* ===== Language Toggle (Matches login.php) ===== */
.lang-toggle {
    position: fixed;
    /* Fixed for admin dashboard to stay visible */
    top: 20px;
    right: 20px; /* Moved to right for desktop */
    left: auto; /* Ensure it's not on the left */
    z-index: 9999;
}

@media (max-width: 1024px) {
    body.dashboard-page .lang-toggle {
        left: 15px;
        right: auto;
        top: 15px;
    }

    body.mobile-menu-open .lang-toggle {
        display: none !important;
    }
}

.lang-btn {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    /* Changed to inline-flex for <a> tag */
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    /* Remove underline for <a> tag */
}

.lang-btn:hover {
    border-color: var(--primary);
    /* var(--primary) */
    color: var(--primary);
    /* var(--primary) */
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
}

/* ===== Mobile Menu Toggle ===== */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    right: 15px;
    width: 48px;
    height: 48px;
    background: white;
    border: 1px solid var(--neutral-200);
    border-radius: 12px;
    z-index: 2100;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
    display: none;
    /* Hidden by default on desktop */
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.5rem;
}

.mobile-menu-toggle:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

.mobile-menu-toggle.active {
    background: var(--error);
    color: white;
    border-color: var(--error);
}

.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1800;
    opacity: 0;
    transition: var(--transition);
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

/* ===== Alerts ===== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
    border: 1px solid;
    animation: slideUp 0.3s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.alert span:not(.alert-icon) {
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

@media (max-width: 768px) {
    .alert {
        padding: var(--space-3);
        font-size: var(--text-sm);
        gap: var(--space-2);
        flex-wrap: wrap;
    }

    .alert-icon {
        font-size: var(--text-base);
    }
}

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

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.alert-success {
    background: var(--success);
    color: var(--white);
    border-color: var(--success);
}

.alert-error {
    background: var(--error);
    color: var(--white);
    border-color: var(--error);
}

.alert-info {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.alert-icon {
    font-size: var(--text-lg);
    flex-shrink: 0;
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.15);
    }

    .main-content {
        margin-left: 0;
        padding: var(--space-6);
        padding-top: calc(var(--space-6) + 60px);
    }

    .mobile-menu-toggle {
        display: flex;
        transition: var(--transition);
    }

    .mobile-menu-toggle.active {
        opacity: 0;
        pointer-events: none;
    }

    .mobile-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.4);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        z-index: 1800;
        opacity: 0;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.15);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    /* Scrollable tables on mobile */
    .table-container {
        -webkit-overflow-scrolling: touch;
        overflow-x: auto;
        position: relative;
    }

    .table-container::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 30px;
        background: linear-gradient(to left, rgba(0, 0, 0, 0.05), transparent);
        pointer-events: none;
        opacity: 0.5;
    }

    .feedbacks-table,
    .departments-table,
    .products-table {
        min-width: 700px;
    }

    .header-content {
        flex-direction: column;
        gap: var(--space-4);
        align-items: stretch;
    }

    .feedback-link {
        flex-direction: column;
        gap: var(--space-3);
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: var(--space-4);
        padding-top: 80px;
    }

    .dashboard-header {
        padding: var(--space-4);
        border-radius: var(--radius-lg);
        margin-bottom: var(--space-4);
    }

    .header-title h1 {
        font-size: var(--text-2xl);
    }

    .stat-card {
        padding: var(--space-4);
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        gap: var(--space-2);
        position: relative;
        overflow: hidden;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: var(--text-base);
        margin-bottom: var(--space-1);
    }

    .stat-content h3 {
        font-size: var(--text-lg);
        font-weight: 800;
    }

    .stat-content p {
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .stat-trend {
        font-size: 10px;
    }

    .card-header {
        padding: var(--space-4);
        flex-direction: row;
        gap: var(--space-3);
        align-items: center;
        justify-content: space-between;
    }

    .card-header h3 {
        font-size: var(--text-base);
    }

    .card-content {
        padding: var(--space-4);
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .filter-row {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
        width: 100%;
        gap: var(--space-2);
    }

    .form-actions .btn {
        width: 100%;
        height: 44px;
        /* Proper touch target */
    }

    .filter-actions {
        justify-content: center;
        margin-top: var(--space-4);
        width: 100%;
    }

    .filter-actions .btn {
        width: 100%;
        height: 44px;
    }

    .table-container {
        font-size: 13px;
    }

    .feedbacks-table th,
    .feedbacks-table td,
    .departments-table th,
    .departments-table td,
    .products-table th,
    .products-table td {
        padding: var(--space-3);
    }

    .modal-content {
        width: 95%;
        margin: var(--space-2);
        max-height: 90vh;
    }

    .modal-header {
        padding: var(--space-4);
    }

    .modal-body {
        padding: var(--space-4);
    }

    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-1);
    }

    .detail-row label {
        min-width: auto;
    }

    .detail-row span {
        text-align: left;
    }

    .pagination {
        flex-wrap: wrap;
        gap: var(--space-1);
    }

    .pagination-link {
        min-width: 36px;
        height: 36px;
        font-size: var(--text-xs);
        padding: 0 var(--space-2);
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: var(--space-3);
        padding-top: calc(var(--space-3) + 70px);
    }

    .logo-text {
        color: var(--dark);
        /* Corrected from white to dark */
        font-weight: 800;
        font-size: 1rem;
        letter-spacing: -0.5px;
        display: flex;
        flex-direction: column;
        /* Match sidebar */
        justify-content: center;
        line-height: 1.1;
    }

    .logo-text span {
        color: var(--primary);
        font-weight: 800;
        font-size: 1rem;
    }

    .top-language-toggle {
        top: 15px;
        right: 15px;
        padding: 3px;
    }

    .top-language-toggle a {
        padding: 4px 8px;
        font-size: 10px;
    }

    .dashboard-header {
        padding: var(--space-4);
        margin-bottom: var(--space-4);
    }

    .header-title h1 {
        font-size: var(--text-lg);
    }

    .stat-card {
        padding: var(--space-4);
    }

    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }

    .sidebar {
        width: 280px;
        max-width: 85vw;
        z-index: 2000;
    }

    .mobile-menu-toggle {
        width: 44px;
        height: 44px;
        top: 15px;
        right: 15px;
        border-radius: 12px;
        font-size: 1.25rem;
    }
}

/* ===== Feedback List ===== */
.feedback-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.feedback-item {
    background: var(--white);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    transition: var(--transition);
}

.feedback-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.feedback-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-3);
}

.feedback-customer {
    flex: 1;
}

.feedback-customer strong {
    display: block;
    font-weight: 600;
    color: var(--neutral-900);
    margin-bottom: var(--space-1);
}

.feedback-date {
    font-size: var(--text-xs);
    color: var(--neutral-500);
}

.feedback-rating {
    display: flex;
    gap: var(--space-1);
    margin-bottom: var(--space-3);
}

.feedback-rating .fas.fa-star {
    color: var(--warning);
    font-size: var(--text-sm);
}

.feedback-rating .fas.fa-star.filled {
    color: var(--warning);
}

.feedback-content {
    flex: 1;
}

.feedback-content p {
    margin: 0 0 var(--space-3) 0;
    line-height: 1.5;
    color: var(--neutral-700);
}

.feedback-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius);
    font-size: var(--text-xs);
    font-weight: 500;
    white-space: nowrap;
}

.tag-department {
    background: var(--primary);
    color: var(--white);
}

.tag-location {
    background: var(--secondary);
    color: var(--white);
}

/* ===== Trend List ===== */
.trend-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.trend-item {
    background: var(--white);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    transition: var(--transition);
}

.trend-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.trend-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
}

.trend-name {
    font-weight: 600;
    color: var(--neutral-900);
}

.trend-stats {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.trend-count {
    font-size: var(--text-sm);
    color: var(--neutral-500);
    padding: var(--space-1) var(--space-2);
    background: var(--neutral-100);
    border-radius: var(--radius);
}

.trend-score {
    font-size: var(--text-sm);
    color: var(--neutral-700);
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.trend-score .fas.fa-star {
    color: var(--warning);
}

.trend-bar {
    width: 100%;
    height: 8px;
    background: var(--neutral-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.trend-progress {
    height: 100%;
    background: var(--success);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

/* ===== Empty States ===== */
.empty-state {
    text-align: center;
    padding: var(--space-16) var(--space-16) var(--space-24) var(--space-16);
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--neutral-500);
}

.empty-icon {
    font-size: var(--text-4xl);
    margin-bottom: var(--space-6);
    color: var(--neutral-300);
}

.empty-state h4 {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--neutral-700);
    margin-bottom: var(--space-3);
}

.empty-state p {
    font-size: var(--text-base);
    margin: 0;
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease;
}

.modal-content.modal-large {
    max-width: 800px;
}

.modal-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--neutral-200);
    background: var(--neutral-50);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--neutral-900);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.modal-close {
    background: none;
    border: none;
    font-size: var(--text-2xl);
    color: var(--neutral-500);
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--error);
    color: var(--white);
}

.modal-body {
    padding: var(--space-6);
    flex: 1;
    overflow-y: auto;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-6);
    border-top: 1px solid var(--neutral-200);
    background: var(--neutral-50);
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 var(--space-3);
    border-radius: var(--radius);
    font-weight: 500;
    font-size: var(--text-sm);
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid var(--neutral-300);
    background: var(--white);
    color: var(--neutral-700);
}

.pagination-link:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.pagination-link.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* ===== Feedback Detail Modal Improvements ===== */
.feedback-detail {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
}

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

.detail-item {
    padding: var(--space-4);
    background: var(--neutral-50);
    border-radius: var(--radius-lg);
    border: 1px solid var(--neutral-200);
    transition: var(--transition);
}

.detail-item:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
    background: var(--white);
}

.detail-item label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 700;
    color: var(--neutral-500);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-2);
}

.detail-item .val {
    color: var(--neutral-900);
    font-size: var(--text-base);
    font-weight: 600;
}

.detail-item .val-block {
    color: var(--neutral-800);
    font-size: var(--text-sm);
    line-height: 1.6;
    white-space: pre-wrap;
    padding: var(--space-2);
    background: var(--neutral-100);
    border-radius: var(--radius);
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.rating-display {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.score-num {
    background: var(--accent);
    color: var(--white);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 800;
}

.stars .fas.filled,
.stars .fa-star.filled,
.rating-display .fa-star.filled {
    color: #fbbf24;
}

/* ===== Modal Animations ===== */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }

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

/* ===== Form Components ===== */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: var(--neutral-700);
    gap: var(--space-3);
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--neutral-300);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.checkbox-label input[type="checkbox"]:checked+.checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.checkbox-label input[type="checkbox"]:checked+.checkbox-custom::after {
    content: '✓';
    font-size: var(--text-sm);
    font-weight: 600;
}

/* ===== Action Buttons ===== */
.action-buttons {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.action-buttons .btn {
    flex-shrink: 0;
}

/* ===== Form Inline ===== */
.form-inline {
    display: flex;
    gap: var(--space-3);
    align-items: end;
    flex-wrap: wrap;
}

.form-inline .form-group {
    flex: 1;
    min-width: 250px;
}

/* ===== QR Code ===== */
.qr-code-container {
    text-align: center;
    padding: var(--space-6);
}

.qr-text {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--neutral-900);
    margin-bottom: var(--space-4);
}

.qr-actions {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
    margin-top: var(--space-6);
}

.current-logo {
    margin-top: var(--space-4);
    padding: var(--space-4);
    background: var(--neutral-50);
    border-radius: var(--radius-lg);
    text-align: center;
    border: 1px solid var(--neutral-200);
}

.current-logo img {
    max-width: 100px;
    max-height: 100px;
    border-radius: var(--radius);
}

/* ===== Utility Classes ===== */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

.text-xs {
    font-size: var(--text-xs);
}

.text-sm {
    font-size: var(--text-sm);
}

.text-lg {
    font-size: var(--text-lg);
}

.text-xl {
    font-size: var(--text-xl);
}

.text-neutral-500 {
    color: var(--neutral-500);
}

.text-neutral-600 {
    color: var(--neutral-600);
}

.bg-neutral-50 {
    background: var(--neutral-50);
}

.bg-neutral-100 {
    background: var(--neutral-100);
}

.border-neutral-200 {
    border-color: var(--neutral-200);
}

.rounded {
    border-radius: var(--radius);
}

.rounded-lg {
    border-radius: var(--radius-lg);
}

.rounded-xl {
    border-radius: var(--radius-xl);
}

.shadow {
    box-shadow: var(--shadow);
}

.shadow-lg {
    box-shadow: var(--shadow-lg);
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: var(--space-2);
}

.gap-3 {
    gap: var(--space-3);
}

.gap-4 {
    gap: var(--space-4);
}

.p-4 {
    padding: var(--space-4);
}

.px-4 {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
}

.py-3 {
    padding-top: var(--space-3);
    padding-bottom: var(--space-3);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-6 {
    margin-bottom: var(--space-6);
}

.mb-8 {
    margin-bottom: var(--space-8);
}

/* ===== Responsive Overhaul ===== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
        transition: transform 0.3s ease;
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }

    .main-content {
        margin-left: 0 !important;
        padding-top: 80px;
        width: 100%;
    }

    .mobile-menu-toggle {
        display: flex !important;
    }

    .top-language-toggle {
        top: 15px;
        right: 15px;
        z-index: 1001;
    }

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

    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }

    /* Analytics Header & Filters */
    .header-actions {
        flex-direction: column;
        align-items: stretch !important;
        width: 100%;
        gap: var(--space-4);
    }

    .date-filter-form {
        width: 100%;
    }

    .date-filter-form .form-row {
        flex-direction: column;
        align-items: stretch !important;
        width: 100%;
    }

    .date-filter-form .form-group {
        width: 100%;
    }

    .date-filter-form .form-group input {
        width: 100% !important;
    }

    .date-filter-form .btn {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .stats-grid, 
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    .charts-grid, 
    .tables-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-4);
    }

    .dashboard-header h1 {
        font-size: 1.5rem !important;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .filters-form .filter-row {
        flex-direction: column !important;
        gap: var(--space-4);
    }

    .filter-group {
        width: 100% !important;
    }

    .modal-content {
        width: 95% !important;
        margin: 10px;
    }

    .qr-card {
        width: 100% !important;
        max-width: 320px;
        padding: 20px;
    }
}

@media (max-width: 520px) {
    .stats-grid, 
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    .charts-grid, 
    .tables-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .dashboard-header {
        padding: var(--space-4) !important;
    }

    .stat-card {
        padding: var(--space-3) !important;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: var(--space-4) !important;
        padding-top: 80px !important;
    }

    .top-language-toggle {
        padding: 2px;
    }

    .top-language-toggle a {
        padding: 4px 8px;
        font-size: 10px;
    }

    .btn {
        width: 100% !important;
        justify-content: center;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }
}

/* Resolution Status Badges */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.status-badge.resolved {
    background: #ecfdf5;
    color: #14b8a6;
}

.status-badge.partially-resolved {
    background: #fffbeb;
    color: #f59e0b;
}

.status-badge.unresolved {
    background: #fef2f2;
    color: var(--error);
}

.status-badge.none {
    background: #f1f5f9;
    color: #64748b;
}

/* Typography for Legal/About Pages */
.prose-content {
    max-width: 850px;
    margin: 2rem auto;
    padding: var(--space-8);
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--neutral-200);
    line-height: 1.8;
    color: var(--neutral-700);
}

.prose-content h1, 
.prose-content h2, 
.prose-content h3 {
    color: var(--neutral-900);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 800;
}

/* ===== Feedback Detail Modal - New Layout ===== */

.fb-section {
    padding: var(--space-5);
    background: var(--neutral-50);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-xl);
    transition: var(--transition);
}

.fb-section:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.fb-section-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 700;
    color: var(--primary-dark);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: var(--space-3);
}

.fb-section-label i {
    width: 22px;
    height: 22px;
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.fb-feedback-text {
    color: var(--neutral-800);
    font-size: var(--text-base);
    line-height: 1.75;
    white-space: pre-wrap;
    word-break: break-word;
}

.fb-satisfaction {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.fb-satisfaction .stars-row {
    display: flex;
    gap: 4px;
}

.fb-satisfaction .fa-star {
    font-size: 1.5rem;
    color: var(--neutral-300);
    transition: color 0.2s, transform 0.2s;
}

.fb-satisfaction .fa-star.filled {
    color: #fbbf24;
    filter: drop-shadow(0 1px 2px rgba(251, 191, 36, 0.35));
}

.fb-satisfaction .score-pill {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: var(--white);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 800;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.25);
}

.fb-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

@media (max-width: 600px) {
    .fb-grid {
        grid-template-columns: 1fr;
    }
}

.fb-field {
    padding: var(--space-4);
    background: var(--white);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.fb-field:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.fb-field-label {
    display: block;
    font-weight: 700;
    color: var(--neutral-500);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-1);
}

.fb-field-value {
    color: var(--neutral-900);
    font-size: var(--text-sm);
    font-weight: 600;
}

.fb-recommend-yes {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: var(--text-xs);
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.fb-recommend-no {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: var(--text-xs);
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.fb-status-section {
    padding: var(--space-5);
    background: var(--neutral-50);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-xl);
}

.fb-divider {
    border: none;
    border-top: 2px solid var(--neutral-200);
    margin: var(--space-2) 0;
}

.fb-reply-section {
    padding-top: var(--space-5);
}

.fb-reply-note {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
    font-size: var(--text-sm);
    line-height: 1.5;
}

.fb-reply-note i {
    margin-top: 2px;
    flex-shrink: 0;
}

.fb-reply-note.note-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.fb-reply-note.note-email {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.fb-reply-note.note-phone {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.fb-reply-textarea {
    width: 100%;
    padding: var(--space-4);
    border: 2px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: var(--text-sm);
    color: var(--neutral-800);
    background: var(--white);
    resize: vertical;
    transition: var(--transition);
    line-height: 1.6;
}

.fb-reply-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(52, 168, 211, 0.1);
}

.fb-reply-textarea::placeholder {
    color: var(--neutral-400);
}

.fb-reply-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

/* Previous replies */
.fb-replies-wrap {
    padding: var(--space-5);
    background: var(--neutral-50);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-xl);
}

.fb-reply-card {
    background: var(--white);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
    transition: var(--transition);
}

.fb-reply-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.fb-reply-card:last-child {
    margin-bottom: 0;
}

.fb-reply-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-2);
}

.fb-reply-card-header span {
    font-weight: 600;
    font-size: var(--text-xs);
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    color: var(--neutral-700);
}

.fb-reply-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 700;
    margin-left: var(--space-1);
}

.fb-reply-type-badge.badge-email {
    background: #dcfce7;
    color: #166534;
}

.fb-reply-type-badge.badge-phone {
    background: #fef3c7;
    color: #92400e;
}

.fb-reply-type-badge.badge-internal {
    background: #e0e7ff;
    color: #3730a3;
}

.fb-reply-card-date {
    color: var(--neutral-400);
    font-size: var(--text-xs);
}

.fb-reply-card-text {
    margin: 0;
    color: var(--neutral-700);
    line-height: 1.65;
    font-size: var(--text-sm);
}

/* ===== Sticky Footer Logic ===== */
.main-content {
    flex: 1;
}

footer {
    margin-top: auto;
}
