:root {
    --primary: #2a6f6f;
    --primary-dark: #1e5555;
    --primary-light: #3d8b8b;
    --primary-lighter: #e0f0f0;
    --sidebar-bg: #1a3a3a;
    --sidebar-hover: #244e4e;
    --sidebar-text: #8fb8b8;
    --sidebar-active-bg: rgba(255, 255, 255, 0.15);
    --sidebar-active-text: #ffffff;
    --sidebar-header-bg: #152e2e;
    --body-bg: #dce8e8;
    --card-bg: #ffffff;
    --card-border: rgba(42, 111, 111, 0.08);
    --card-shadow: 0 2px 12px rgba(26, 58, 58, 0.06);
    --text-primary: #1a2e2e;
    --text-secondary: #5a7a7a;
    --text-muted: #8ca8a8;
    --success: #2ecc71;
    --warning: #f0ad4e;
    --danger: #e74c3c;
    --info: #3498db;
    --stat-1-bg: #e8f4f4;
    --stat-1-icon: #2a6f6f;
    --stat-2-bg: #e8f0e8;
    --stat-2-icon: #2ecc71;
    --stat-3-bg: #e8eef4;
    --stat-3-icon: #3498db;
    --stat-4-bg: #f4e8e8;
    --stat-4-icon: #e74c3c;
    --border: #c8d8d8;
    --input-bg: #f0f6f6;
    --input-border: #c8d8d8;
    --input-focus: #2a6f6f;
    --radius: 14px;
    --radius-sm: 10px;
    --transition: all 0.25s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Segoe UI", system-ui, sans-serif; background: var(--body-bg); color: var(--text-primary); }

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

@keyframes pulseSoft {
    0% { box-shadow: 0 0 0 0 rgba(42, 111, 111, 0.25); }
    70% { box-shadow: 0 0 0 10px rgba(42, 111, 111, 0); }
    100% { box-shadow: 0 0 0 0 rgba(42, 111, 111, 0); }
}

.animate-fade-in { animation: fadeInUp 0.45s ease both; }
.animate-pulse { animation: pulseSoft 2s infinite; }

.sidebar {
    width: 250px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: var(--transition);
    overflow-y: auto;
}

.sidebar-profile {
    padding: 28px 20px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 10px;
}

.sidebar-username { color: #fff; font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.sidebar-email { color: var(--sidebar-text); font-size: 12px; }
.sidebar-nav { padding: 12px 0; flex: 1; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 18px;
    margin: 3px 10px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-link:hover { background: var(--sidebar-hover); color: #fff; }
.nav-link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    border-left-color: #fff;
}

.nav-link i { width: 20px; text-align: center; font-size: 16px; margin-right: 0; }
.sidebar-footer { padding: 12px 0; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.logout-link i { color: #e74c3c; }

.nav-section {
    margin: 4px 0;
}

.nav-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: calc(100% - 20px);
    margin: 0 10px;
    padding: 8px 10px;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 6px;
}

.nav-section-toggle:hover {
    background: rgba(255, 255, 255, 0.04);
}

.nav-section-toggle .nav-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(160, 174, 192, 0.5);
    font-weight: 700;
    margin: 0;
    padding: 0;
}

.nav-section-arrow {
    font-size: 10px;
    color: rgba(160, 174, 192, 0.3);
    transition: transform 0.3s ease;
}

.nav-section.collapsed .nav-section-arrow {
    transform: rotate(-90deg);
}

.nav-section-items {
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.nav-section.collapsed .nav-section-items {
    max-height: 0;
    opacity: 0;
}

.main-content {
    margin-left: 250px;
    min-height: 100vh;
    background: var(--body-bg);
    transition: var(--transition);
}

.topbar {
    background: var(--card-bg);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--card-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-left h2 { font-size: 20px; color: var(--text-primary); font-weight: 700; }
.topbar-left h2 span { color: var(--primary); }
.sidebar-toggle { border: none; background: transparent; font-size: 19px; cursor: pointer; color: var(--text-secondary); }

.search-box { position: relative; width: 280px; }
.search-box input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1px solid var(--border);
    border-radius: 25px;
    background: var(--input-bg);
    font-size: 13px;
    outline: none;
    transition: var(--transition);
}
.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(42, 111, 111, 0.12);
}
.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}
.global-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: 0 10px 32px rgba(26, 58, 58, 0.14);
    overflow: hidden;
    max-height: 380px;
    overflow-y: auto;
    display: none;
    z-index: 1200;
}
.global-search-results.show { display: block; animation: fadeInUp 0.2s ease; }
.search-item {
    display: block;
    padding: 10px 12px;
    text-decoration: none;
    border-bottom: 1px solid rgba(42, 111, 111, 0.08);
    transition: var(--transition);
}
.search-item:hover { background: var(--primary-lighter); }
.search-item-title { color: var(--text-primary); font-size: 13px; font-weight: 600; }
.search-item-meta { color: var(--text-muted); font-size: 11px; margin-top: 2px; }
.search-empty { padding: 12px; font-size: 12px; color: var(--text-muted); }

.topbar-right { display: flex; align-items: center; gap: 16px; }
.lang-dropdown { position: relative; }
.lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.lang-btn:hover { border-color: var(--primary); background: var(--primary-lighter); }
.lang-btn i:first-child { color: var(--primary); font-size: 15px; }
.lang-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(26, 58, 58, 0.15);
    border: 1px solid var(--card-border);
    padding: 6px;
    min-width: 160px;
    display: none;
    z-index: 1000;
}
.lang-menu.show { display: block; }
.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}
.lang-option:hover { background: var(--primary-lighter); }
.lang-option.active { background: var(--primary); color: #fff; }
.lang-option.active:hover { background: var(--primary-dark); }
.lang-flag { font-size: 18px; }
.topbar-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--input-bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}
.topbar-icon:hover { background: var(--primary-lighter); color: var(--primary); }

.messages-container { padding: 16px 24px 0; }
.alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 10px;
    box-shadow: var(--card-shadow);
}
.alert button { border: none; background: transparent; cursor: pointer; color: var(--text-secondary); }

.content-area { padding: 24px; }
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.filters, .actions, .table-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }

.overview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.overview-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 22px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    border: 1px solid var(--card-border);
}
.overview-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(26, 58, 58, 0.1); }
.overview-card .card-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.overview-card:nth-child(1) .card-icon { background: var(--stat-1-bg); color: var(--stat-1-icon); }
.overview-card:nth-child(2) .card-icon { background: var(--stat-2-bg); color: var(--stat-2-icon); }
.overview-card:nth-child(3) .card-icon { background: var(--stat-3-bg); color: var(--stat-3-icon); }
.overview-card:nth-child(4) .card-icon { background: var(--stat-4-bg); color: var(--stat-4-icon); }
.overview-card .card-info h3 { font-size: 26px; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.overview-card .card-info p { font-size: 13px; color: var(--text-secondary); font-weight: 500; }

.middle-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1.3fr;
    gap: 20px;
    margin-bottom: 28px;
}

.dashboard-card, .data-table-wrapper, .form-card, .card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--card-border);
    animation: fadeInUp 0.45s ease both;
}

.dashboard-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.dashboard-card .card-header h4 { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.text-muted { font-size: 12px; color: var(--text-muted); }

.users-stat { text-align: center; padding: 20px 0; }
.users-stat .user-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--stat-1-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    font-size: 28px;
    color: var(--primary);
}
.users-stat h2 { font-size: 32px; font-weight: 700; color: var(--text-primary); }
.users-stat p { color: var(--text-secondary); font-size: 13px; }

.bottom-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}

.chart-container canvas { max-height: 280px; }

.recent-order-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(42, 111, 111, 0.06);
}
.recent-order-item:last-child { border-bottom: none; }
.order-info { display: flex; flex-direction: column; gap: 2px; }
.order-id { font-weight: 600; font-size: 13px; color: var(--text-primary); }
.order-user { font-size: 12px; color: var(--text-muted); }
.order-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.order-amount { font-weight: 600; font-size: 13px; color: var(--text-primary); }

.data-table-wrapper { padding: 20px; }
.table-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.table-header h3 { font-size: 17px; font-weight: 600; color: var(--text-primary); }

.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
    background: transparent;
}
.data-table tbody td {
    padding: 14px 16px;
    font-size: 13px;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(42, 111, 111, 0.06);
}
.data-table tbody tr { transition: var(--transition); }
.data-table tbody tr:hover { background: var(--primary-lighter); transform: translateX(2px); }

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}
.status-pending { background: #fef3c7; color: #92400e; }
.status-processing { background: #dbeafe; color: #1e40af; }
.status-shipped { background: #e0e7ff; color: #3730a3; }
.status-delivered { background: #d1fae5; color: #065f46; }
.status-cancelled { background: #fee2e2; color: #991b1b; }
.status-active { background: #d1fae5; color: #065f46; }
.status-rejected { background: #fee2e2; color: #991b1b; }
.status-draft { background: #f3f4f6; color: #4b5563; }

.btn {
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-primary:focus-visible { animation: pulseSoft 1.2s ease; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-secondary { background: var(--input-bg); color: var(--text-secondary); }
.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.nav-label {
    margin: 18px 0 8px;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.table-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
}

.form-card { max-width: 700px; padding: 28px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 13px; color: var(--text-primary); }
.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 0;
}
.form-col-4 { flex: 0 0 calc(33.333% - 11px); }
.form-col-6 { flex: 0 0 calc(50% - 8px); }
.form-col-8 { flex: 0 0 calc(66.666% - 8px); }

.form-control,
form input,
form select,
form textarea,
.form-card input,
.form-card select,
.form-card textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
}

.form-control:focus,
form input:focus,
form select:focus,
form textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(42, 111, 111, 0.1);
    background: #fff;
}

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

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.product-images-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.product-image-item {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 1;
    border: 2px solid transparent;
    transition: var(--transition);
}

.product-image-item.is-main {
    border-color: var(--primary);
}

.product-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
    display: flex;
    align-items: center;
    justify-content: space-between;
    opacity: 0;
    transition: var(--transition);
}

.product-image-item:hover .image-overlay {
    opacity: 1;
}

.main-badge {
    font-size: 11px;
    color: #fbbf24;
    font-weight: 600;
}

.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.upload-area:hover {
    border-color: var(--primary);
    background: var(--primary-lighter);
}

.upload-area i {
    font-size: 36px;
    color: var(--primary);
    margin-bottom: 10px;
    display: block;
}

.upload-area p {
    color: var(--text-secondary);
    font-size: 14px;
}

.upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.import-info {
    background: var(--primary-lighter);
    border-radius: var(--radius-sm);
    padding: 18px;
    margin-bottom: 24px;
    border-left: 4px solid var(--primary);
}

.import-info h4 {
    color: var(--primary);
    margin-bottom: 8px;
    font-size: 14px;
}

.import-info p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.import-info code {
    background: rgba(42, 111, 111, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 24px;
}
.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}
.pagination a {
    background: var(--card-bg);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.pagination a:hover {
    background: var(--primary-lighter);
    border-color: var(--primary);
    color: var(--primary);
}
.pagination .active {
    background: var(--primary);
    color: #fff;
    border: none;
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    transform: translateX(120%);
    transition: transform 0.35s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    z-index: 3000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
}
.toast.show { transform: translateX(0); }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--info); }

.modal {
    position: fixed;
    inset: 0;
    background: rgba(26, 58, 58, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.modal-content {
    background: var(--card-bg);
    border-radius: 18px;
    padding: 32px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(26, 58, 58, 0.2);
}
.modal-content h3 { font-size: 18px; margin-bottom: 8px; color: var(--text-primary); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a3a3a 0%, #2a6f6f 50%, #3d8b8b 100%);
}
.login-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px;
    width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.login-card h2 {
    text-align: center;
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.login-card .subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 28px;
}
.login-card .login-logo {
    text-align: center;
    margin-bottom: 20px;
    font-size: 40px;
    color: var(--primary);
}
.login-card .btn-primary {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    margin-top: 8px;
}
.login-card form { display: flex; flex-direction: column; gap: 10px; }

@media (max-width: 1200px) {
    .overview-grid { grid-template-columns: repeat(2, 1fr); }
    .middle-grid { grid-template-columns: 1fr 1fr; }
    .bottom-section { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-250px); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .overview-grid { grid-template-columns: 1fr 1fr; }
    .middle-grid { grid-template-columns: 1fr; }
    .topbar { padding: 12px 16px; }
    .search-box { width: 180px; }
    .form-row { flex-direction: column; }
    .form-col-4, .form-col-6, .form-col-8 { flex: 1; }
    .product-images-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .overview-grid { grid-template-columns: 1fr; }
    .search-box { display: none; }
}

.sidebar.collapsed { transform: translateX(-250px); }
.main-content.expanded { margin-left: 0; }

/* ==========================================
   CONTENT HEADER
   ========================================== */
.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 12px;
}

.content-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 2px;
}

.content-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

/* ==========================================
   TABLE WRAPPER
   ========================================== */
.data-table-wrapper {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--card-border, #e2e8f0);
    box-shadow: var(--card-shadow, 0 1px 3px rgba(0, 0, 0, 0.06));
    overflow: hidden;
    padding: 0;
}

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

.data-table thead th {
    text-align: left;
    padding: 12px 18px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted, #8ca8a8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(42, 111, 111, 0.03);
    border-bottom: 2px solid var(--border, #e2e8f0);
    white-space: nowrap;
}

.data-table tbody td {
    padding: 14px 18px;
    font-size: 13px;
    color: var(--text-primary, #1a2e2e);
    border-bottom: 1px solid rgba(42, 111, 111, 0.06);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background 0.2s ease;
}

.data-table tbody tr:hover {
    background: rgba(42, 111, 111, 0.03);
    transform: none;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ==========================================
   TABLE THUMB
   ========================================== */
.table-thumb-rect {
    width: 64px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border, #e2e8f0);
    display: block;
}

.table-thumb-square {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid var(--border, #e2e8f0);
    display: block;
}

.table-thumb-placeholder {
    width: 64px;
    height: 40px;
    border-radius: 8px;
    background: var(--input-bg, #f0f6f6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #8ca8a8);
    font-size: 16px;
}

/* ==========================================
   CELL WITH ICON
   ========================================== */
.cell-with-icon {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cell-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.cell-icon-blue {
    background: rgba(42, 111, 111, 0.08);
    color: var(--primary, #2a6f6f);
}

.cell-icon-green {
    background: rgba(16, 185, 129, 0.08);
    color: var(--success, #10b981);
}

.cell-icon-orange {
    background: rgba(245, 158, 11, 0.08);
    color: var(--warning, #f59e0b);
}

.cell-icon-red {
    background: rgba(239, 68, 68, 0.08);
    color: var(--danger, #ef4444);
}

/* ==========================================
   BADGES
   ========================================== */
.slug-badge {
    font-size: 11px;
    padding: 3px 8px;
    background: rgba(42, 111, 111, 0.06);
    color: var(--primary, #2a6f6f);
    border-radius: 4px;
    font-family: Consolas, Monaco, monospace;
}

.order-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(42, 111, 111, 0.06);
    color: var(--primary, #2a6f6f);
    font-size: 12px;
    font-weight: 700;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-dot-green { background: var(--success, #10b981); }
.status-dot-red { background: var(--danger, #ef4444); }
.status-dot-yellow { background: var(--warning, #f59e0b); }

/* ==========================================
   ACTION BUTTONS
   ========================================== */
.action-btns {
    display: flex;
    gap: 6px;
}

.btn-action {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-action-edit {
    background: rgba(42, 111, 111, 0.06);
    color: var(--primary, #2a6f6f);
}

.btn-action-edit:hover {
    background: var(--primary, #2a6f6f);
    color: #fff;
}

.btn-action-delete {
    background: rgba(239, 68, 68, 0.06);
    color: var(--danger, #ef4444);
}

.btn-action-delete:hover {
    background: var(--danger, #ef4444);
    color: #fff;
}

.btn-action-view {
    background: rgba(59, 130, 246, 0.06);
    color: var(--info, #3b82f6);
}

.btn-action-view:hover {
    background: var(--info, #3b82f6);
    color: #fff;
}

.btn-action-toggle {
    background: rgba(245, 158, 11, 0.08);
    color: var(--warning, #f59e0b);
}

.btn-action-toggle:hover {
    background: var(--warning, #f59e0b);
    color: #fff;
}

.btn-action-mini {
    font-size: 11px;
    color: var(--text-muted, #8ca8a8);
    text-decoration: none;
    margin-left: 6px;
    transition: color 0.2s;
}

.btn-action-mini:hover {
    color: var(--primary, #2a6f6f);
}

/* ==========================================
   TABLE LINK
   ========================================== */
.table-link-small {
    font-size: 12px;
    color: var(--primary, #2a6f6f);
    text-decoration: none;
    transition: color 0.2s;
}

.table-link-small:hover {
    color: var(--primary-dark, #1e5555);
    text-decoration: underline;
}

/* ==========================================
   EMPTY STATE
   ========================================== */
.empty-state {
    text-align: center !important;
    padding: 48px 20px !important;
}

.empty-state i {
    font-size: 40px;
    color: var(--border, #c8d8d8);
    margin-bottom: 12px;
    display: block;
}

.empty-state p {
    color: var(--text-muted, #8ca8a8);
    font-size: 14px;
    margin-bottom: 14px;
}

/* ==========================================
   TEXT HELPERS
   ========================================== */
.text-bold {
    font-weight: 600;
}

/* ==========================================
   UNREAD ROW
   ========================================== */
.row-unread {
    background: rgba(42, 111, 111, 0.03);
    font-weight: 500;
}

.row-unread td:first-child {
    border-left: 3px solid var(--primary, #2a6f6f);
}

.unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary, #2a6f6f);
    display: inline-block;
    margin-right: 8px;
}

.th-xs { width: 80px; }
.th-sm { width: 100px; }
.th-md { width: 140px; }
.th-actions { width: 140px; }

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .data-table-wrapper {
        overflow-x: auto;
    }

    .action-btns {
        flex-direction: column;
        gap: 4px;
    }
}

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

.mini-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.mini-stat {
    text-align: center;
    padding: 12px;
    background: rgba(42, 111, 111, 0.04);
    border-radius: 10px;
}

.mini-stat-value {
    display: block;
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
}

.mini-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.card-header-actions {
    display: flex;
    gap: 4px;
}

.card-header-actions .btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.stat-list {
    max-height: 320px;
    overflow-y: auto;
}

.stat-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 4px;
    border-bottom: 1px solid rgba(42, 111, 111, 0.06);
}

.stat-list-item:last-child { border-bottom: none; }

.stat-rank {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: rgba(42, 111, 111, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.stat-rank-gold {
    background: rgba(245, 158, 11, 0.1);
    color: #b45309;
}

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

.stat-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
}

a.stat-name:hover { color: var(--primary); }

.stat-detail {
    font-size: 11px;
    color: var(--text-muted);
}

.stat-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.stock-indicator {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.stock-out { background: #fee2e2; color: #991b1b; }
.stock-critical { background: #fef3c7; color: #92400e; }
.stock-low { background: #fef9c3; color: #854d0e; }

.conversion-big {
    text-align: center;
    padding: 16px 0;
}

.conversion-number {
    display: block;
    font-size: 36px;
    font-weight: 800;
    color: var(--primary);
}

.conversion-label {
    font-size: 12px;
    color: var(--text-muted);
}

.activity-feed {
    max-height: 380px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(42, 111, 111, 0.04);
}

.activity-item:last-child { border-bottom: none; }

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(42, 111, 111, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.activity-info { flex: 1; }

.activity-text {
    display: block;
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

.activity-detail {
    font-size: 11px;
    color: var(--text-muted);
}

.activity-time {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    display: inline-block;
    animation: livePulse 2s ease infinite;
}

@keyframes livePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

.info-box-telegram {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(0, 136, 204, 0.06);
    border: 1px solid rgba(0, 136, 204, 0.15);
    border-radius: 10px;
    margin-bottom: 16px;
}

.info-box-telegram i {
    font-size: 20px;
    color: #0088cc;
}

.info-box-telegram p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

@media (max-width: 768px) {
    .mini-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ====== DASHBOARD GRIDS — TO'G'RILANGAN ====== */
.middle-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.bottom-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.dashboard-card {
    background: var(--card-bg, #ffffff);
    border-radius: 14px;
    padding: 22px;
    border: 1px solid rgba(42, 111, 111, 0.08);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    min-height: 120px;
}

.dashboard-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(42, 111, 111, 0.06);
}

.dashboard-card .card-header h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary, #1a2e2e);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.content-area {
    padding: 24px;
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.full-width {
    grid-column: 1 / -1;
    margin-bottom: 24px;
}

.empty-card-state {
    text-align: center;
    padding: 28px 16px;
    color: var(--text-muted, #8ca8a8);
}

.empty-card-state i {
    font-size: 28px;
    opacity: 0.3;
    margin-bottom: 8px;
    display: block;
}

.empty-card-state p {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-secondary, #5a7a7a);
}

.empty-card-state small {
    font-size: 11px;
    color: var(--text-muted, #8ca8a8);
}

/* ====== TOOLTIP COMPONENT ====== */
.tip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(42, 111, 111, 0.08);
    color: var(--primary, #2a6f6f);
    font-size: 10px;
    cursor: help;
    position: relative;
    margin-left: 6px;
    font-style: normal;
    font-weight: 700;
    vertical-align: middle;
    transition: all 0.2s ease;
}

.tip-icon:hover {
    background: var(--primary, #2a6f6f);
    color: #fff;
    transform: scale(1.1);
}

.tip-icon .tip-text {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--sidebar-bg, #1a3a3a);
    color: #e0f0f0;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    white-space: normal;
    width: 260px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    text-align: left;
}

.tip-icon .tip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--sidebar-bg, #1a3a3a);
}

.tip-icon:hover .tip-text {
    display: block;
    animation: tipFadeIn 0.2s ease;
}

@keyframes tipFadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(4px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.tip-icon.tip-right .tip-text {
    left: 0;
    transform: translateX(0);
}

.tip-icon.tip-right .tip-text::after {
    left: 14px;
    transform: none;
}

.page-tip {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(42, 111, 111, 0.04);
    border: 1px solid rgba(42, 111, 111, 0.1);
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-secondary, #5a7a7a);
    line-height: 1.5;
}

.page-tip i {
    color: var(--primary, #2a6f6f);
    font-size: 16px;
    margin-top: 2px;
    flex-shrink: 0;
}

.page-tip .tip-dismiss {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted, #8ca8a8);
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    flex-shrink: 0;
}

.page-tip .tip-dismiss:hover {
    color: var(--text-primary);
}

@keyframes tipFadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); height: 0; padding: 0; margin: 0; overflow: hidden; }
}
