/* Admin Panel Styles - Sneat Vuetify Theme */
/* Primary Color: Purple (#696CFF) with Modern Light Theme */

:root {
    --primary-color: #696CFF;
    --primary-dark: #5A5DC7;
    --primary-light: #8285FF;
    --yellow-accent: #FFAB00;
    --yellow-dark: #FF8F00;
    --yellow-light: #FFC107;
    --dark-gray: #566A7F;
    --sidebar-bg: #FFFFFF;
    --sidebar-hover: rgba(105, 108, 255, 0.08);
    --sidebar-active: rgba(105, 108, 255, 0.12);
    --content-bg: #F5F5F9;
    --card-bg: #FFFFFF;
    --border-color: rgba(86, 106, 127, 0.12);
    --text-primary: #566A7F;
    --text-secondary: #A1ACB8;
    --text-dark: #566A7F;
    --text-light: #A1ACB8;
    --success: #71DD37;
    --danger: #FF3E1D;
    --warning: #FFAB00;
    --info: #03C3EC;
    --shadow-sm: 0 2px 4px rgba(86, 106, 127, 0.04);
    --shadow-md: 0 4px 8px rgba(86, 106, 127, 0.08);
    --shadow-lg: 0 8px 16px rgba(86, 106, 127, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--content-bg);
    color: var(--text-primary);
    font-size: 0.9375rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #0a0e27 0%, #1e3a8a 30%, #1e40af 70%, #2563eb 100%);
    background-attachment: fixed;
}

.login-background-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(37, 99, 235, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(30, 64, 175, 0.1) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0);
    }
    33% {
        transform: translateY(-20px) translateX(20px);
    }
    66% {
        transform: translateY(20px) translateX(-20px);
    }
}

.login-box {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 45px 40px;
    border-radius: 18px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 10px 25px rgba(37, 99, 235, 0.4),
        0 0 0 4px rgba(59, 130, 246, 0.1);
    animation: pulse 2s ease-in-out infinite;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 
            0 10px 25px rgba(37, 99, 235, 0.4),
            0 0 0 4px rgba(59, 130, 246, 0.1);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 
            0 15px 35px rgba(37, 99, 235, 0.5),
            0 0 0 6px rgba(59, 130, 246, 0.15);
    }
}

.login-icon i {
    font-size: 36px;
    color: white;
}

.login-box h2 {
    color: #1e293b;
    margin-bottom: 8px;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.login-header p {
    color: #64748b;
    font-size: 14px;
    margin: 0;
    font-weight: 400;
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: #1e293b;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.01em;
}

.form-group label i {
    margin-right: 8px;
    color: #2563eb;
    font-size: 13px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: #64748b;
    font-size: 16px;
    z-index: 1;
    transition: all 0.3s ease;
}

.form-control {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #ffffff;
    color: #1e293b;
    font-weight: 400;
}

.form-control::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.form-control:hover {
    border-color: #cbd5e1;
    background: #ffffff;
}

.form-control:focus {
    outline: none;
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 
        0 0 0 4px rgba(37, 99, 235, 0.1),
        0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.form-control:focus + .input-icon,
.form-control:focus ~ .input-icon {
    color: #2563eb;
    transform: scale(1.1);
}

.alert-message {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 22px;
    font-size: 14px;
    font-weight: 500;
    animation: slideDown 0.4s ease-out;
    line-height: 1.5;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-slide-in {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Base Button - Bootstrap 5 Style */
.btn {
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 0.375rem; /* 6px - Bootstrap 5 */
    font-weight: 500;
    font-size: 0.7rem; /* 14px -> 80% */
    line-height: 1.5;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    vertical-align: middle;
    user-select: none;
}

/* Button Sizes */
.btn-sm {
    padding: 0.2rem 0.6rem;
    font-size: 0.65rem; /* 13px -> 80% */
    border-radius: 0.25rem; /* 4px */
    min-width: auto;
}

/* Button Primary */
.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.btn-primary:focus {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(105, 108, 255, 0.25);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* Buttons that match form-control height (e.g. SPK filter and Tambah SPK) */
.btn-match-input {
    padding: 14px 16px;
    font-size: 14px;
    border-radius: 10px;
    box-sizing: border-box;
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Auto-apply same size to Tambah button (content header) and filter form buttons globally */
.content-box > div:first-child a.btn:not(.btn-sm),
.content-box form[method="get"] .btn:not(.btn-sm) {
    padding: 14px 16px;
    font-size: 14px;
    border-radius: 10px;
    box-sizing: border-box;
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Shared: all admin filter forms – single horizontal row, no vertical wrap */
.admin-filter-form {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
}
.admin-filter-form .form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    flex: 0 0 auto;
    width: 140px;
    min-width: 0;
}
.admin-filter-form .form-group label {
    margin-bottom: 6px;
    white-space: nowrap;
}
.admin-filter-form .form-group input[type="text"],
.admin-filter-form .form-group input[type="date"],
.admin-filter-form .form-group select.form-control {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.admin-filter-form .form-group:last-child {
    width: auto;
    flex: 0 0 auto;
    flex-direction: row;
    gap: 8px;
    align-items: center;
}
.admin-filter-form .form-group:last-child label {
    display: none;
}

/* Retail filter form: single horizontal row */
.retail-filter-form {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
}
.retail-filter-form .form-group {
    margin-bottom: 0;
    flex: 0 0 auto;
    width: 140px;
}
.retail-filter-form .form-group:last-child {
    width: auto;
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
    align-items: center;
}
.retail-filter-form .form-group label {
    margin-bottom: 6px;
    white-space: nowrap;
}
.retail-filter-form .form-group input[type="text"],
.retail-filter-form .form-group input[type="date"] {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* SPK filter form: single horizontal row */
.spk-filter-form {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
}
.spk-filter-form .form-group {
    margin-bottom: 0;
    flex: 0 0 auto;
    width: 140px;
}
.spk-filter-form .form-group:last-child {
    width: auto;
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
    align-items: center;
}
.spk-filter-form .form-group label {
    margin-bottom: 6px;
    white-space: nowrap;
}
.spk-filter-form .form-group input[type="text"],
.spk-filter-form .form-group input[type="date"] {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
@media (max-width: 900px) {
    .spk-filter-form {
        flex-wrap: wrap;
    }
}

/* Foto kegiatan filter form: single horizontal row */
.foto-kegiatan-filter-form {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
}
.foto-kegiatan-filter-form .form-group {
    margin-bottom: 0;
    flex: 0 0 auto;
    width: 140px;
}
.foto-kegiatan-filter-form .form-group:last-child {
    width: auto;
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
    align-items: center;
}
.foto-kegiatan-filter-form .form-group label {
    margin-bottom: 6px;
    white-space: nowrap;
}
.foto-kegiatan-filter-form .form-group input[type="text"],
.foto-kegiatan-filter-form .form-group select.form-control {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* Kontrak filter form: single horizontal row */
.kontrak-filter-form {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
}
.kontrak-filter-form .form-group {
    margin-bottom: 0;
    flex: 0 0 auto;
    width: 160px;
}
.kontrak-filter-form .form-group:last-child {
    width: auto;
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
    align-items: center;
}
.kontrak-filter-form .form-group label {
    margin-bottom: 6px;
    white-space: nowrap;
}
.kontrak-filter-form .form-group input[type="text"] {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* Berita Acara filter form: single horizontal row */
.berita-acara-filter-form {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
}
.berita-acara-filter-form .form-group {
    margin-bottom: 0;
    flex: 0 0 auto;
    width: 160px;
}
.berita-acara-filter-form .form-group:last-child {
    width: auto;
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
    align-items: center;
}
.berita-acara-filter-form .form-group label {
    margin-bottom: 6px;
    white-space: nowrap;
}
.berita-acara-filter-form .form-group input[type="text"],
.berita-acara-filter-form .form-group input[type="date"] {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
@media (max-width: 900px) {
    .berita-acara-filter-form {
        flex-wrap: wrap;
    }
}

/* Catatan Pembelian filter form: satu baris horizontal */
.catatan-pembelian-filter-form {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
}
.catatan-pembelian-filter-form .form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    flex: 0 0 auto;
    min-width: 0;
}
.catatan-pembelian-filter-form .form-group label {
    margin-bottom: 6px;
    white-space: nowrap;
}
.catatan-pembelian-filter-form .form-group input[type="text"],
.catatan-pembelian-filter-form .form-group input[type="date"] {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.catatan-pembelian-filter-form .form-group:first-child input[type="text"] {
    width: 220px;
}
.catatan-pembelian-filter-form .form-group:nth-child(2) input[type="date"] {
    width: 160px;
}
.catatan-pembelian-filter-form .form-group:nth-child(3) input[type="text"] {
    width: 200px;
}
.catatan-pembelian-filter-form .form-group:last-child {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
}
.catatan-pembelian-filter-form .form-group:last-child label {
    display: none;
}
.catatan-pembelian-filter-form .btn-outline-secondary {
    background: #e9ecef;
    color: #333;
    border: 1px solid #dee2e6;
}
.catatan-pembelian-filter-form .btn-outline-secondary:hover {
    background: #dee2e6;
    color: #212529;
}

/* Select aligned with header buttons (e.g. Pilih Perusahaan on retail view) */
.content-box > div:first-child select.btn-select {
    padding: 14px 16px;
    font-size: 14px;
    border-radius: 10px;
    min-height: 46px;
    height: 46px;
    border: 2px solid #e2e8f0;
    background: #fff;
    cursor: pointer;
    box-sizing: border-box;
}

.content-box > div:first-child select.btn-select:hover {
    border-color: #cbd5e1;
}

.content-box > div:first-child select.btn-select:focus {
    outline: none;
    border-color: #2563eb;
}

/* Login Page Button Styling */
.login-box .btn-primary {
    width: 100%;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    border: none;
    border-radius: 10px;
    box-shadow: 
        0 4px 12px rgba(37, 99, 235, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    letter-spacing: 0.02em;
    margin-top: 8px;
}

.login-box .btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e3a8a 100%);
    box-shadow: 
        0 6px 16px rgba(37, 99, 235, 0.5),
        0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.login-box .btn-primary:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 8px rgba(37, 99, 235, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.1);
}

.login-box .btn-primary:focus {
    outline: none;
    box-shadow: 
        0 0 0 4px rgba(37, 99, 235, 0.2),
        0 4px 12px rgba(37, 99, 235, 0.4);
}

/* Login Box Alert Styling */
.login-box .alert {
    font-weight: 500;
    border-width: 1px;
    border-style: solid;
}

.login-box .alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.login-box .alert-success {
    background-color: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

/* Responsive Optimization for Tab View */
@media (max-width: 768px) {
    .login-box {
        padding: 40px 32px;
        max-width: 90%;
        margin: 20px;
    }
    
    .login-icon {
        width: 70px;
        height: 70px;
        margin-bottom: 20px;
    }
    
    .login-icon i {
        font-size: 32px;
    }
    
    .login-box h2 {
        font-size: 24px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-control {
        padding: 12px 14px 12px 44px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .login-box .btn-primary {
        padding: 13px 20px;
        font-size: 15px;
    }
}

@media (max-height: 700px) {
    .login-box {
        padding: 35px 32px;
    }
    
    .login-header {
        margin-bottom: 24px;
    }
    
    .login-icon {
        width: 70px;
        height: 70px;
        margin-bottom: 18px;
    }
    
    .form-group {
        margin-bottom: 18px;
    }
}

/* Button Success */
.btn-success {
    background-color: var(--success);
    color: #fff;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-success:hover {
    background-color: #218838;
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.btn-success:focus {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.25);
}

.btn-success:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Button Warning (Edit) */
.btn-warning {
    background-color: var(--warning);
    color: #000;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-warning:hover {
    background-color: #e0a800;
    color: #000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.btn-warning:focus {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.25);
}

.btn-warning:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Button Danger (Delete) */
.btn-danger {
    background-color: var(--danger);
    color: #fff;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-danger:hover {
    background-color: #c82333;
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.btn-danger:focus {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25);
}

.btn-danger:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Button Info */
.btn-info {
    background-color: var(--info);
    color: #fff;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-info:hover {
    background-color: #138496;
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.btn-info:focus {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.25);
}

/* Button Text and Loader Support */
.btn-text, .btn-loader {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-loader i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Button Group in Table Actions */
.table td:last-child {
    white-space: nowrap;
}

.table td:last-child .btn {
    margin-right: 0.5rem;
}

.table td:last-child .btn:last-child {
    margin-right: 0;
}

/* Pagination */
.pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    gap: 10px;
}

.pagination-info {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.pagination-wrap {
    margin-top: 0;
    text-align: right;
}

.pagination-wrap a,
.pagination-wrap strong {
    display: inline-block;
    padding: 6px 10px;
    margin: 0 2px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    text-decoration: none;
    font-size: 0.8rem;
}

.pagination-wrap a {
    color: var(--primary-color);
    background-color: #ffffff;
}

.pagination-wrap a:hover {
    background-color: var(--content-bg);
}

.pagination-wrap strong {
    background-color: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

/* Admin Layout */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
    background-color: var(--content-bg);
}

/* Alert Messages */
.alert {
    margin: 0 1.5rem 1.5rem 1.5rem;
    padding: 1rem 1.25rem;
    border-radius: 0.375rem;
    font-size: 0.9375rem;
    border: 1px solid transparent;
}

.alert-success {
    background-color: rgba(113, 221, 55, 0.1);
    color: #2d5f0f;
    border-color: rgba(113, 221, 55, 0.2);
}

.alert-danger {
    background-color: rgba(255, 62, 29, 0.1);
    color: #8b1f0f;
    border-color: rgba(255, 62, 29, 0.2);
}

.alert-info {
    background-color: rgba(3, 195, 236, 0.1);
    color: #0c5460;
    border-color: rgba(3, 195, 236, 0.2);
}

/* Sidebar - Sneat Style */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--text-primary);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    border-right: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    background-color: transparent;
    text-align: center;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
    min-height: 88px;
}

.sidebar-header h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.sidebar-logo {
    max-height: 100px;
    max-width: 300px;
    width: 188px;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

.sidebar-menu {
    list-style: none;
    padding: 0.75rem 0;
    margin: 0;
}

.sidebar-menu li {
    margin: 0.125rem 0.75rem;
    border-radius: 0.375rem;
    border-bottom: none;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 0.375rem;
    font-size: 0.9375rem;
    font-weight: 400;
    position: relative;
}

.sidebar-menu a:hover {
    background-color: var(--sidebar-hover);
    color: var(--primary-color);
}

.sidebar-menu a.active {
    background-color: var(--sidebar-active);
    color: var(--primary-color);
    font-weight: 500;
}

.sidebar-menu a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background-color: var(--primary-color);
    border-radius: 0 2px 2px 0;
}

.sidebar-menu i {
    margin-right: 0.75rem;
    width: 20px;
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Sidebar Dropdown Menu */
.sidebar-menu-dropdown {
    position: relative;
}

.sidebar-menu-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.sidebar-menu-toggle .sidebar-arrow {
    margin-left: auto;
    margin-right: 0;
    font-size: 0.75rem;
    transition: transform 0.3s ease;
    opacity: 0.7;
    width: auto;
}

.sidebar-menu-dropdown.active .sidebar-menu-toggle .sidebar-arrow {
    transform: rotate(180deg);
    opacity: 1;
}

.sidebar-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background: transparent;
    margin: 0.25rem 0.75rem 0.5rem 0.75rem;
    padding: 0;
    border-radius: 0.375rem;
    list-style: none;
}

.sidebar-submenu.show {
    max-height: 500px;
    padding: 0.375rem 0;
}

.sidebar-submenu li {
    margin: 0.125rem 0;
    border-radius: 0.375rem;
}

.sidebar-submenu-item,
.sidebar-submenu a {
    display: flex;
    align-items: center;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 0.375rem;
    font-size: 0.9375rem;
    font-weight: 400;
    position: relative;
}

.sidebar-submenu a:hover {
    background-color: var(--sidebar-hover);
    color: var(--primary-color);
}

.sidebar-submenu a.active {
    background-color: var(--sidebar-active);
    color: var(--primary-color);
    font-weight: 500;
}

.sidebar-submenu a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background-color: var(--primary-color);
    border-radius: 0 2px 2px 0;
}

.sidebar-submenu i {
    margin-right: 0.75rem;
    width: 20px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Active state for parent when child is active */
.sidebar-menu-dropdown.active > .sidebar-menu-toggle {
    background-color: var(--sidebar-active);
    color: var(--primary-color);
    font-weight: 500;
}

.sidebar-menu-dropdown.active > .sidebar-menu-toggle::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background-color: var(--primary-color);
    border-radius: 0 2px 2px 0;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 0;
    min-height: 100vh;
    background-color: var(--content-bg);
    transition: margin-left 0.3s ease;
}

/* Top Navigation Bar - Sneat Style */
.admin-header {
    background: var(--card-bg);
    padding: 0 1.5rem;
    border-radius: 0;
    margin-bottom: 0;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 999;
    height: 64px;
    border-bottom: 1px solid var(--border-color);
}

.admin-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.admin-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-header h1 {
    color: var(--text-primary);
    font-size: 1.375rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.5;
}

/* Search Bar */
.admin-search {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 350px;
    width: 100%;
}

.admin-search-input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.9375rem;
    background-color: var(--content-bg);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.admin-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--card-bg);
    box-shadow: 0 0 0 3px rgba(105, 108, 255, 0.1);
}

.admin-search-input::placeholder {
    color: var(--text-secondary);
}

.admin-search-icon {
    position: absolute;
    left: 0.875rem;
    color: var(--text-secondary);
    font-size: 1rem;
    pointer-events: none;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-icon-btn {
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    background-color: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.header-icon-btn:hover {
    background-color: var(--sidebar-hover);
    color: var(--primary-color);
}

.header-icon-btn i {
    font-size: 1.25rem;
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-info:hover {
    background-color: var(--sidebar-hover);
}

.user-avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
}

.user-name {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.2;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.2;
}

/* Mobile Toggle Button */
.admin-mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.625rem;
    font-size: 1.25rem;
    color: var(--text-primary);
    z-index: 1002;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
}

.admin-mobile-toggle:hover {
    background-color: var(--sidebar-hover);
    color: var(--primary-color);
}

.admin-mobile-toggle.active i.fa-bars {
    display: none;
}

.admin-mobile-toggle i.fa-times {
    display: none;
}

.admin-mobile-toggle.active i.fa-times {
    display: inline-block;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}


/* Content Wrapper */
.content-wrapper {
    padding: 1.5rem;
}

/* Content Box */
.content-box {
    background: var(--card-bg);
    padding: 1.875rem;
    border-radius: 0.375rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
}

/* Table */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background-color: var(--content-bg);
    color: var(--text-dark);
    font-weight: 600;
}

.table tr:hover {
    background-color: #f8f9fa;
}

.table img {
    max-width: 100px;
    height: auto;
    border-radius: 5px;
}

/* Table Responsive Wrapper */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 5px;
    margin-top: 20px;
}

.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: var(--content-bg);
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Retail list: one row per data row (no wrap in cells) */
.retail-table-wrap .table td,
.retail-list-table td {
    white-space: nowrap;
}

/* Additional refinements */
.content-box h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.875rem;
}

.content-box h3 {
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

/* Form */
.form-container {
    max-width: 800px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Dashboard Container */
.dashboard-container {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Dashboard Top Row - KPI Cards + Total Revenue */
.dashboard-top-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

/* Congratulations Card */
.congratulations-card {
    background: linear-gradient(135deg, #696CFF 0%, #8285FF 100%);
    border-radius: 0.375rem;
    padding: 1.875rem;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.congratulations-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.congratulations-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.congratulations-text {
    flex: 1;
    max-width: 60%;
}

.congratulations-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: white;
}

.congratulations-desc {
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.95);
}

.congratulations-desc strong {
    font-weight: 600;
    color: white;
}

.congratulations-btn {
    background: white !important;
    color: var(--primary-color) !important;
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.congratulations-btn:hover {
    background: rgba(255, 255, 255, 0.95) !important;
    color: var(--primary-color) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.congratulations-illustration {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 40%;
}

.illustration-svg {
    width: 100%;
    max-width: 200px;
    height: auto;
}

/* KPI Cards Grid 2x2 */
.kpi-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 0.375rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.stat-card-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
}

.stat-card-icon.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
}

.stat-card-icon.success {
    background: linear-gradient(135deg, var(--success), #85E458);
}

.stat-card-icon.warning {
    background: linear-gradient(135deg, var(--warning), #FFC107);
}

.stat-card-icon.info {
    background: linear-gradient(135deg, var(--info), #20C9FF);
}

.stat-card-icon.danger {
    background: linear-gradient(135deg, var(--danger), #FF6B52);
}

.stat-card-menu {
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s ease;
}

.stat-card-menu:hover {
    color: var(--text-primary);
}

.stat-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-card-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin: 0;
}

.stat-card-value {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.stat-card-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    font-size: 0.8125rem;
}

.stat-card-change {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
}

.stat-card-change.positive {
    color: var(--success);
}

.stat-card-change.negative {
    color: var(--danger);
}

.stat-card-change-text {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* Dashboard Bottom Row - Growth Chart + Profile Report */
.dashboard-bottom-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* Chart Card */
.chart-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 0.375rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.chart-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.chart-year-select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23566A7F' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    transition: border-color 0.2s ease;
}

.chart-year-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.chart-card-body {
    position: relative;
}

/* Chart Legend */
.chart-legend {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Chart Placeholder */
.chart-placeholder {
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--content-bg);
    border-radius: 0.375rem;
    position: relative;
}

.chart-placeholder-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 1rem;
}

.chart-placeholder canvas {
    max-width: 100%;
    height: auto;
}

/* Growth Chart */
.growth-chart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.circular-progress {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-text {
    position: absolute;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.progress-percentage {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1;
}

.progress-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.growth-comparison {
    display: flex;
    gap: 2rem;
    width: 100%;
    justify-content: center;
}

.comparison-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.comparison-item i {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sidebar-hover);
    border-radius: 0.5rem;
    color: var(--primary-color);
    font-size: 1.125rem;
}

.comparison-item > div {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.comparison-year {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.comparison-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.growth-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

/* Profile Report Card */
.profile-report-card {
    position: relative;
}

.profile-report-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.profile-report-badge {
    align-self: flex-start;
}

.badge-year {
    background: var(--warning);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.profile-report-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-report-change {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    align-self: flex-start;
}

.profile-report-change.positive {
    color: var(--success);
}

.profile-report-change.negative {
    color: var(--danger);
}

.profile-report-value {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.profile-chart-placeholder {
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--content-bg);
    border-radius: 0.375rem;
    position: relative;
}

.profile-chart-placeholder canvas {
    max-width: 100%;
    height: auto;
}

.upgrade-btn {
    background: var(--danger);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    width: 100%;
    box-shadow: 0 4px 8px rgba(255, 62, 29, 0.25);
}

.upgrade-btn:hover {
    background: #FF2E0A;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 62, 29, 0.35);
    color: white;
}

/* Stats Cards - Sneat Style */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Badge */
.badge {
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background-color: var(--success);
    color: white;
}

.badge-danger {
    background-color: var(--danger);
    color: white;
}

.badge-warning {
    background-color: var(--warning);
    color: white;
}

.badge-info {
    background-color: var(--info);
    color: white;
}

/* Responsive - iOS/Mobile Optimizations */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .admin-search {
        max-width: 250px;
    }
}

@media (max-width: 768px) {
    /* Mobile Toggle Button - iOS Touch Target */
    .admin-mobile-toggle {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        min-width: 44px;
        min-height: 44px;
        padding: 0.625rem;
    }
    
    /* Sidebar Mobile */
    .sidebar {
        width: 260px;
        height: 100vh;
        height: -webkit-fill-available;
        position: fixed;
        left: -100%;
        top: 0;
        z-index: 1001;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    /* Sidebar Overlay */
    .sidebar-overlay {
        display: block;
        -webkit-tap-highlight-color: transparent;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .content-wrapper {
        padding: 1rem;
    }
    
    /* Header Mobile */
    .admin-header {
        padding: 0 1rem;
        height: 56px;
    }
    
    .admin-header-left {
        gap: 0.75rem;
    }
    
    .admin-header h1 {
        font-size: 1.125rem;
        display: block;
        flex: 1;
    }
    
    .admin-header-left h1 {
        margin: 0;
    }
    
    .admin-search {
        display: none;
    }
    
    .admin-search.mobile-visible {
        display: flex;
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        max-width: 100%;
        padding: 0.75rem 1rem;
        background: var(--card-bg);
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
        z-index: 998;
    }
    
    .header-actions {
        gap: 0.25rem;
    }
    
    .header-icon-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    .user-info {
        gap: 0.5rem;
        padding: 0.25rem;
    }
    
    .user-details {
        display: none;
    }
    
    .user-avatar {
        width: 2rem;
        height: 2rem;
        font-size: 0.75rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    /* Mobile: Card-like table display */
    .table-responsive {
        display: block;
        overflow-x: visible;
    }
    
    .table {
        display: block;
        width: 100%;
        margin-top: 0;
    }
    
    .table thead {
        display: none;
    }
    
    .table tbody {
        display: block;
    }
    
    .table tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid var(--border-color);
        border-radius: 5px;
        background: white;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    
    .table tr:hover {
        background-color: white;
        box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    }
    
    .table td {
        display: block;
        padding: 10px 15px;
        border: none;
        border-bottom: 1px solid var(--border-color);
        position: relative;
        padding-left: 40%;
    }
    
    .table td:last-child {
        border-bottom: none;
    }
    
    .table td::before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        top: 10px;
        font-weight: 600;
        color: var(--text-dark);
        width: 35%;
    }
    
    /* If no data-label, hide the before pseudo-element */
    .table td:not([data-label])::before {
        display: none;
    }
    
    .table td:not([data-label]) {
        padding-left: 15px;
    }
    
    /* Action buttons on mobile */
    .table td:last-child {
        padding-left: 15px;
        padding-top: 15px;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .table td:last-child::before {
        display: none;
    }
    
    .table td:last-child .btn {
        width: 100%;
        margin-bottom: 0;
        margin-right: 0;
        text-align: center;
        order: 2; /* Default order for all buttons */
    }
    
    /* Edit button (btn-warning) comes first */
    .table td:last-child .btn.btn-warning {
        order: 1;
    }
    
    /* Delete button (btn-danger) comes second */
    .table td:last-child .btn.btn-danger {
        order: 2;
    }
    
    .table img {
        max-width: 60px;
    }

    /* Retail list: keep table layout (one row per data row) with horizontal scroll */
    .retail-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .retail-table-wrap .table,
    .retail-list-table {
        display: table;
        width: 100%;
    }
    .retail-table-wrap .table thead,
    .retail-list-table thead {
        display: table-header-group;
    }
    .retail-table-wrap .table tbody,
    .retail-list-table tbody {
        display: table-row-group;
    }
    .retail-table-wrap .table tr,
    .retail-list-table tr {
        display: table-row;
        margin-bottom: 0;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }
    .retail-table-wrap .table td,
    .retail-list-table td {
        display: table-cell;
        padding: 12px;
        border-bottom: 1px solid var(--border-color);
        position: static;
        padding-left: 12px;
        white-space: nowrap;
    }
    .retail-table-wrap .table td::before,
    .retail-list-table td::before {
        display: none;
    }
    .retail-table-wrap .table td:last-child,
    .retail-list-table td:last-child {
        display: table-cell;
        flex-direction: row;
        white-space: nowrap;
    }
    .retail-table-wrap .table td:last-child .btn,
    .retail-list-table td:last-child .btn {
        width: auto;
        order: unset;
    }
    
    .content-box {
        padding: 1.25rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.25rem;
    }
    
    .dashboard-container {
        padding: 1rem;
    }
    
    .dashboard-top-row {
        grid-template-columns: 1fr;
    }
    
    .dashboard-bottom-row {
        grid-template-columns: 1fr;
    }
    
    .kpi-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .congratulations-card {
        padding: 1.5rem;
    }
    
    .congratulations-title {
        font-size: 1.5rem;
    }
    
    .growth-comparison {
        flex-direction: column;
        gap: 1rem;
    }
}

/* iOS Safari Specific Fixes */
@supports (-webkit-touch-callout: none) {
    .admin-wrapper {
        min-height: -webkit-fill-available;
    }
    
    .sidebar {
        min-height: -webkit-fill-available;
    }
    
    .main-content {
        min-height: -webkit-fill-available;
    }
    
    /* Fix iOS input zoom */
    .admin-search-input,
    .form-control,
    input,
    select,
    textarea {
        font-size: 16px;
    }
    
    /* Smooth scrolling for iOS */
    .sidebar,
    .content-wrapper {
        -webkit-overflow-scrolling: touch;
    }
}

/* Dashboard Responsive */
@media (max-width: 1400px) {
    .dashboard-top-row {
        grid-template-columns: 1fr;
    }
    
    .dashboard-bottom-row {
        grid-template-columns: 1fr 1fr;
    }
    
    .profile-report-card {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1024px) {
    .dashboard-bottom-row {
        grid-template-columns: 1fr;
    }
    
    .kpi-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .congratulations-content {
        flex-direction: column;
        text-align: center;
    }
    
    .congratulations-text {
        max-width: 100%;
    }
    
    .congratulations-illustration {
        max-width: 100%;
        margin-top: 1rem;
    }
}

/* Tablet Optimizations (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    
    .main-content {
        margin-left: 240px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .admin-search {
        max-width: 280px;
    }
    
    .dashboard-container {
        padding: 1rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .stat-card:hover {
        transform: none;
        box-shadow: var(--shadow-sm);
    }
    
    /* Larger touch targets */
    .sidebar-menu a {
        min-height: 44px;
        padding: 0.875rem 1rem;
    }
    
    .btn {
        min-height: 44px;
        padding: 0.625rem 1.25rem;
    }
}

