/* Base Styles */
:root {
    /* Palet diselaraskan dengan logo IAS (teal + navy + charcoal) */
    --primary-color: #00b7c7;   /* teal utama */
    --primary-light: #d7f4f7;   /* teal sangat muda untuk hover */
    --secondary-color: #0a2f6a; /* navy gelap */
    --accent-color: #1284c5;    /* biru aksen */
    --dark-color: #2e2f33;      /* charcoal */
    --light-color: #f4f7f9;
    --success-color: #4ade80;
    --warning-color: #fbbf24;
    --danger-color: #f87171;
    --gray-color: #7a828a;
    --gray-light: #e5e7eb;
    --sidebar-width: 260px;
    --header-height: 80px;
    --border-radius: 12px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fb;
    color: var(--dark-color);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    width: 100%;
    margin-left: 0;
    max-width: 100%;
    min-height: 100vh;
    overflow: hidden;
    padding: 16px;
}

/* Sidebar Styles */
.dashboard-container .sidebar {
    width: var(--sidebar-width);
    background: var(--dark-color);
    color: white;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    box-shadow: var(--box-shadow);
    z-index: 1000;
    transform: translateX(0);
    transition: transform 0.3s ease, width 0.3s ease;
}

.dashboard-container .sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-light);
}

.dashboard-container .sidebar-header h1 {
    font-size: 1.25rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dashboard-container .sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.dashboard-container .sidebar-nav ul li {
    margin: 0.25rem 0;
}

.dashboard-container .sidebar-nav ul li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--gray-color);
    transition: var(--transition);
}

.dashboard-container .sidebar-nav ul li a:hover {
    color: var(--primary-color);
    background-color: var(--primary-light);
}

.dashboard-container .sidebar-nav ul li.active a {
    color: var(--primary-color);
    background-color: var(--primary-light);
    border-right: 3px solid var(--primary-color);
}

.dashboard-container .sidebar-nav ul li i {
    width: 20px;
    text-align: center;
}

.dashboard-container .sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-light);
}

.dashboard-container .sidebar::-webkit-scrollbar {
    width: 8px;
}
.dashboard-container .sidebar::-webkit-scrollbar-thumb {
    background: var(--gray-color);
    border-radius: 4px;
}
.dashboard-container .sidebar::-webkit-scrollbar-track {
    background: var(--dark-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
}

.user-role {
    font-size: 0.75rem;
    color: var(--gray-color);
}

/* Main Content Styles */
.dashboard-container .main-content {
    flex: 1;
    margin-left: 0;
    padding: 20px;
    min-height: 100vh;
    overflow-y: auto;
    transition: margin-left 0.3s ease;
    width: 100%;
    max-width: none;
    margin-right: 0;
}

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

body.sidebar-collapsed .dashboard-container .main-content {
    margin-left: 0;
}

.dashboard-container .main-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    background: white;
    padding: 1.25rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.dashboard-container .header-left h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.dashboard-container .header-left p {
    color: var(--gray-color);
    font-size: 0.9rem;
}

.dashboard-container .header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-bar {
    position: relative;
    display: flex;
    align-items: center;
}

.search-bar i {
    position: absolute;
    left: 12px;
    color: var(--gray-color);
}

.search-bar input {
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: 1px solid var(--gray-light);
    border-radius: var(--border-radius);
    outline: none;
    transition: var(--transition);
    width: 200px;
}

.search-bar input:focus {
    border-color: var(--primary-color);
    width: 250px;
}

.notifications {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    border-radius: 50%;
    color: var(--primary-color);
    cursor: pointer;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Card Styles */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 1.5rem;
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-header h3 {
    font-size: 1.1rem;
    color: var(--dark-color);
}

.view-all {
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 500;
}

/* Widget Styles */

.widgets-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.widget {
    display: flex;
    flex-direction: column;
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.widget-header h3 {
    font-size: 0.95rem;
    color: var(--gray-color);
    font-weight: 500;
}

.widget-header i {
    width: 36px;
    height: 36px;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.widget-body {
    margin-bottom: 0.5rem;
}

.widget-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark-color);
    display: block;
    margin-bottom: 0.25rem;
}

.widget-change {
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.widget-change.positive {
    color: var(--success-color);
}

.widget-change.warning {
    color: var(--warning-color);
}

.widget-change.negative {
    color: var(--danger-color);
}

.widget-footer {
    font-size: 0.75rem;
    color: var(--gray-color);
}

/* Charts Row */
.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-container {
    min-height: 340px;
    height: 350px;
}

.chart-body {
    height: calc(100% - 50px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-body canvas {
    max-height: 100%;
    width: 100% !important;
}

@media (max-width: 1200px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
    .chart-container {
        height: 350px;
    }
}

.chart-container {
    min-height: 340px;
    height: auto;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.chart-actions {
    display: flex;
    gap: 0.5rem;
}

.chart-actions button {
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--gray-light);
    background: white;
    border-radius: 20px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}

.chart-actions button:hover, .chart-actions button.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.chart-body {
    height: 300px;
}

.server-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.server-actions select {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--gray-light);
    background: white;
    color: var(--dark-color);
    min-width: 160px;
}

.btn-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--primary-color);
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    list-style: none;
    text-decoration: none;
}
.btn-mini i {
    width: 14px;
    text-align: center;
}

.btn-mini:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-secondary {
    background: white;
    color: var(--dark-color);
    border-color: var(--gray-light);
}

/* Storage page */
.storage-stats .storage-card .widget-header h3 {
    color: var(--dark-color);
}
.storage-stats .storage-card .widget-body .widget-value,
.storage-stats .storage-card .widget-body .widget-footer {
    color: var(--dark-color);
}
.storage-card {
    min-height: 140px;
}
.storage-card .widget-body {
    padding: 0.5rem 0;
}
.storage-list-card {
    padding: 0;
}
.storage-card-header {
    padding: 1rem 1.5rem 0.75rem;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
}
.storage-title-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
}
.storage-title-row h3 {
    margin: 0;
    color: var(--dark-color);
}
.storage-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
}
.storage-nav .btn-mini {
    width: 38px;
    height: 38px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.storage-nav .btn-mini i {
    pointer-events: none;
}
.storage-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
}
.storage-filters .filter-group {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.storage-filters select,
.storage-filters input[type="date"] {
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid var(--gray-light);
    background: white;
    color: var(--dark-color);
}
.storage-filters .filter-group.actions {
    gap: 8px;
}
.storage-filters .filter-group.actions .btn-mini {
    min-width: 40px;
    background: #f8fafc;
    border-color: #e2e8f0;
    color: var(--dark-color);
}
.storage-filters .filter-group.actions .btn-mini:hover {
    background: #e5e7eb;
    border-color: #cbd5e1;
}
body.dark .storage-filters .filter-group.actions .btn-mini {
    background: #111827;
    border-color: #1f2937;
    color: #e2e8f0;
}
body.dark .storage-filters .filter-group.actions .btn-mini:hover {
    background: #1f2937;
    border-color: #334155;
}
.storage-card-header .filter-label {
    font-size: 12px;
    color: var(--gray-color);
}
.storage-table-wrap {
    overflow: auto;
    padding: 0 1.5rem 1.25rem;
}
.pagination-controls {
    padding: 0.5rem 1.5rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.pagination-group {
    display: flex;
    align-items: center;
    gap: 10px;
}
.file-count {
    font-size: 0.95rem;
    color: var(--dark-color);
    font-weight: 600;
}
body.dark .file-count {
    color: #e2e8f0;
}
.pagination-group #pageInfo {
    font-weight: 600;
    color: var(--dark-color);
}
.storage-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
    table-layout: fixed; /* stabilkan perubahan lebar kolom saat drag */
}
.storage-table th {
    position: relative;
}
.storage-table .col-resizer {
    position: absolute;
    top: 0;
    right: 0; /* kontrol di sisi kanan seperti file manager */
    left: auto;
    width: 12px; /* area sentuh lebih lebar agar mudah */
    height: 100%;
    cursor: col-resize;
    user-select: none;
    pointer-events: all;
    background: transparent;
    border-left: 1px solid transparent;
    z-index: 3;
    display: block;
    opacity: 0;
    transition: opacity 0.1s ease, background 0.1s ease, border-color 0.1s ease;
}
.storage-table th:hover .col-resizer,
.storage-table .col-resizer:hover {
    opacity: 1;
    background: rgba(0,0,0,0.06);
    border-left-color: rgba(0,0,0,0.18);
}
.storage-table thead th:nth-child(n+3):not(:last-child) {
    border-right: 1px solid var(--gray-light);
}
.storage-table th,
.storage-table td {
    padding: 12px 10px;
    border-bottom: none;
    text-align: left;
    font-size: 0.9rem;
    max-width: none;
    min-width: 100px;
    border-right: none;
    overflow: hidden;
    text-overflow: ellipsis;
}
.storage-table td:nth-child(n+2),
.storage-table th:nth-child(n+2) {
    white-space: nowrap;
}
.storage-table th:first-child,
.storage-table td:first-child {
    text-align: center;
    overflow: visible;
    white-space: normal;
    text-overflow: unset;
}
.storage-table th:nth-child(1),
.storage-table td:nth-child(1) { width: 44px; } /* checkbox */
.storage-table th:nth-child(2),
.storage-table td:nth-child(2) { width: 65%; }
.storage-table th:nth-child(3),
.storage-table td:nth-child(3) { width: 8%; }
.storage-table th:nth-child(4),
.storage-table td:nth-child(4) { width: 7%; }
.storage-table th:nth-child(5),
.storage-table td:nth-child(5) { width: 8%; }
.storage-table th:nth-child(6),
.storage-table td:nth-child(6) { width: 8%; }
.storage-table th:nth-child(7),
.storage-table td:nth-child(7) { width: 4%; }
.storage-table th:last-child,
.storage-table td:last-child {
    width: 120px;
    text-align: center;
}
.storage-table th:last-child,
.storage-table td:last-child {
    width: 120px;
}
.storage-table tr {
    border-bottom: 1px solid var(--gray-light);
}
.storage-table tr.drag-over {
    outline: 2px dashed var(--primary-color);
    outline-offset: -2px;
    background: rgba(0,183,199,0.08);
}
.storage-table tr.dragging {
    opacity: 0.6;
}
.storage-table .name-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}
.storage-table .name-cell .name-text {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: min(1080px, 88vw); /* lebih lebar agar ellipsis muncul lebih lambat */
}
.storage-table .actions-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    overflow: visible;
}
.storage-table .actions-cell .btn-mini {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border-color: #e2e8f0;
}
.storage-table .actions-cell .btn-mini i {
    margin: 0;
}
.storage-table .actions-cell .btn-mini:hover {
    background: #e5e7eb;
    border-color: #cbd5e1;
}
body.dark .storage-table .actions-cell .btn-mini {
    background: #111827;
    border-color: #1f2937;
}
body.dark .storage-table .actions-cell .btn-mini:hover {
    background: #1f2937;
    border-color: #334155;
}
.storage-table .actions-cell .btn-mini.btn-secondary {
    background: #f8fafc;
    border-color: #e2e8f0;
}
.storage-table .actions-cell .btn-mini.btn-secondary:hover {
    background: #e5e7eb;
    border-color: #cbd5e1;
}
body.dark .storage-table .actions-cell .btn-mini.btn-secondary {
    background: #111827;
    border-color: #1f2937;
}
body.dark .storage-table .actions-cell .btn-mini.btn-secondary:hover {
    background: #1f2937;
    border-color: #334155;
}
.storage-table th {
    font-weight: 700;
    color: var(--dark-color);
}

/* Pengetahuan Lokal draft table */
.update-ai .storage-table {
    min-width: 0;
    table-layout: auto;
}
.update-ai .storage-table th:nth-child(1),
.update-ai .storage-table td:nth-child(1) { width: 18px; text-align:center; padding-left: 4px; padding-right: 4px; }
.update-ai .storage-table th:nth-child(2),
.update-ai .storage-table td:nth-child(2) { width: 60%; }
.update-ai .storage-table th:nth-child(3),
.update-ai .storage-table td:nth-child(3) { width: 18%; }
.update-ai .storage-table th:nth-child(4),
.update-ai .storage-table td:nth-child(4) { width: 12%; }
.update-ai .storage-table tr:hover {
    background: rgba(0,183,199,0.06);
}
.update-ai .storage-table td {
    padding: 12px 12px;
}
.update-ai .storage-table th {
    background: rgba(0,0,0,0.04);
}
body.dark .update-ai .storage-table th {
    background: #1f2937;
    color: #e5e7eb;
}

.update-ai .keluhan-select-all-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark-color);
    padding: 6px 2px 10px;
    border-bottom: 1px solid #e5e7eb;
}
body.dark .update-ai .keluhan-select-all-row {
    color: #e5e7eb;
    border-color: #374151;
}
.storage-table .folder-icon,
.storage-nav .fa-folder-open {
    color: #f59e0b;
}
.storage-table .file-icon.ext-pdf { color: #ef4444; }
.storage-table .file-icon.ext-txt { color: #3b82f6; }
.storage-table .file-icon.ext-log { color: #9ca3af; }
.storage-table .file-icon.ext-json { color: #22c55e; }
.storage-table .file-icon.ext-docx,
.storage-table .file-icon.ext-doc { color: #2563eb; }
.storage-table .file-icon.ext-xlsx,
.storage-table .file-icon.ext-xls { color: #16a34a; }
.storage-table .file-icon.ext-zip { color: #f59e0b; }
.storage-table .file-icon.ext-csv { color: #a855f7; }
.storage-table .file-icon.ext-file { color: #e5e7eb; }
.storage-table .actions-cell .fa-trash { color: #ef4444; }
.storage-table .actions-cell .fa-download { color: #22c55e; }
.storage-table .actions-cell .fa-folder-open { color: #f59e0b; }
.storage-table .actions-cell .fa-trash:hover,
.storage-filters .actions .fa-trash:hover { color: #b91c1c; }
.storage-table .actions-cell .fa-download:hover { color: #15803d; }
.storage-table .actions-cell .fa-folder-open:hover { color: #d97706; }
.storage-filters .actions .fa-eraser { color: #a3a3a3; }
.storage-filters .actions .fa-eraser:hover { color: #525252; }
.storage-table .actions-cell .fa-trash:hover { color: #b91c1c; }
.storage-table .actions-cell .fa-download:hover { color: #15803d; }
.storage-table .actions-cell .fa-folder-open:hover { color: #d97706; }
.storage-table tr:hover {
    background: var(--primary-light);
}
.text-muted {
    color: var(--gray-color);
    text-align: center;
}

@media (max-width: 992px) {
    .storage-card-header {
        align-items: flex-start;
    }
    .storage-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .storage-nav {
        order: 2;
    }
    .storage-filters {
        flex-direction: column;
        align-items: flex-start;
    }
    .storage-filters .filter-group {
        width: 100%;
    }
    .storage-filters select,
    .storage-filters input[type="date"],
    .storage-filters .filter-group.actions .btn-mini {
        width: 100%;
    }
    .storage-filters .filter-group.actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
        gap: 8px;
    }
    .storage-table-wrap {
        overflow-x: auto;
    }
}

body.dark .storage-title-row h3,
body.dark .storage-table th,
body.dark .storage-table td,
body.dark .pagination-group #pageInfo {
    color: #e2e8f0;
}
body.dark .storage-table th:not(:last-child) {
    border-right: none;
}
body.dark .storage-stats .storage-card .widget-header h3,
body.dark .storage-stats .storage-card .widget-value,
body.dark .storage-stats .storage-card .widget-footer {
    color: #e2e8f0;
}
body.dark .storage-card-header .filter-label {
    color: #cbd5e1;
}
body.dark .storage-nav .btn-mini {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}
body.dark .storage-nav .btn-mini i {
    color: #e2e8f0;
}
body.dark .storage-table i {
    color: #e2e8f0;
}
body.dark .storage-table .folder-icon,
body.dark .storage-nav .fa-folder-open {
    color: #fbbf24;
}
body.dark .storage-table .file-icon.ext-pdf { color: #f87171; }
body.dark .storage-table .file-icon.ext-txt { color: #60a5fa; }
body.dark .storage-table .file-icon.ext-log { color: #cbd5e1; }
body.dark .storage-table .file-icon.ext-json { color: #34d399; }
body.dark .storage-table .file-icon.ext-docx,
body.dark .storage-table .file-icon.ext-doc { color: #93c5fd; }
body.dark .storage-table .file-icon.ext-xlsx,
body.dark .storage-table .file-icon.ext-xls { color: #4ade80; }
body.dark .storage-table .file-icon.ext-csv { color: #c084fc; }
body.dark .storage-table .file-icon.ext-file { color: #e5e7eb; }
body.dark .storage-table .actions-cell .fa-trash { color: #f87171; }
body.dark .storage-table .actions-cell .fa-download { color: #34d399; }
body.dark .storage-table .actions-cell .fa-folder-open { color: #fbbf24; }
body.dark .storage-table .actions-cell .fa-trash:hover,
body.dark .storage-filters .actions .fa-trash:hover { color: #dc2626; }
body.dark .storage-table .actions-cell .fa-download:hover { color: #16a34a; }
body.dark .storage-table .actions-cell .fa-folder-open:hover { color: #f59e0b; }
body.dark .storage-filters .actions .fa-eraser { color: #94a3b8; }
body.dark .storage-filters .actions .fa-eraser:hover { color: #cbd5e1; }
body.dark .storage-table tr:hover {
    background: rgba(56,189,248,0.08);
}
body.dark .storage-table td,
body.dark .storage-table th {
    border-bottom: none;
    border-right: none;
}
body.dark .storage-table th:hover .col-resizer {
    background: rgba(255,255,255,0.12);
    border-left-color: rgba(255,255,255,0.26);
}
body.dark .storage-table thead th:nth-child(n+3):not(:last-child) {
    border-right: 1px solid #1f2937;
}
body.dark .storage-table tr {
    border-bottom: 1px solid #1f2937;
}
body.dark .storage-card-header {
    border-bottom: 1px solid #1f2937;
}
body.dark .storage-filters select,
body.dark .storage-filters input[type="date"] {
    background: #0f172a;
    color: #e2e8f0;
    border-color: #1f2937;
}
body.dark .storage-table-wrap {
    padding: 0 1.5rem 1.25rem;
}

/* Monitor widget tidy & responsive */
.monitor-widget .widget-header {
    flex-wrap: wrap;
    gap: 0.75rem;
}
.monitor-title {
    display: flex;
    align-items: center;
    gap: 8px;
}
.info-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #22d3ee, #0ea5e9);
    color: #0b1220;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 16px -10px rgba(14,165,233,0.45);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.info-icon:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px -12px rgba(14,165,233,0.5);
}
body.dark .info-icon {
    background: #f8fafc;
    color: #0f172a;
    border: 1px solid #38bdf8;
    box-shadow: 0 0 0 2px rgba(56,189,248,0.35), 0 8px 16px -10px rgba(56,189,248,0.6);
}
body.dark .info-icon:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 0 2px rgba(56,189,248,0.55), 0 10px 20px -12px rgba(56,189,248,0.75);
}
.monitor-widget .server-actions {
    flex: 1;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.monitor-widget .server-actions select {
    min-width: 180px;
    flex: 1 1 200px;
    height: 40px;
    border: 1px solid var(--gray-light);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}
.monitor-widget .btn-mini {
    flex: 0 0 auto;
    height: 40px;
    padding: 0 12px;
}
.monitor-widget .info-icon {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
}
.monitor-widget .widget-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--dark-color);
    background: #f9fbff;
    border: 1px dashed var(--gray-light);
    border-radius: 10px;
    padding: 10px 12px;
}
.monitor-widget #serverSelectedInfo {
    font-weight: 700;
    color: var(--secondary-color);
}
.monitor-widget .widget-footer {
    margin-top: 6px;
    font-weight: 600;
}
.monitor-widget #serverSelectedHost {
    color: var(--dark-color);
}
.monitor-widget .btn-mini.btn-secondary {
    border: 1px solid var(--gray-light);
    color: var(--dark-color);
}
.monitor-widget .widget-body p {
    margin: 0;
    font-size: 0.9rem;
}
.monitor-widget .widget-body .hint {
    font-size: 0.8rem;
    color: var(--gray-color);
}

@media (max-width: 768px) {
    .monitor-widget .server-actions {
        justify-content: stretch;
    }
    .monitor-widget .server-actions select {
        flex: 1 1 100%;
        min-width: 0;
    }
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 14px;
    width: 420px;
    max-width: 90%;
    box-shadow: var(--box-shadow);
}

.modal-content h3 {
    margin-bottom: 12px;
    color: var(--dark-color);
}

.modal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.modal-grid label {
    font-size: 13px;
    color: var(--dark-color);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-grid input {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--gray-light);
    outline: none;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 8px;
}
.modal-actions .btn-primary,
.modal-actions .btn-secondary {
    min-width: 88px;
    height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    font-weight: 700;
    letter-spacing: 0.2px;
    box-shadow: 0 6px 14px -10px rgba(0,0,0,0.35);
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
.modal-actions .btn-primary {
    background: linear-gradient(135deg, #22d3ee, #0ea5e9);
    border: 1px solid #0ea5e9;
    color: #0b1220;
}
.modal-actions .btn-secondary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #0f172a;
}
.modal-actions .btn-primary:hover,
.modal-actions .btn-secondary:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
    box-shadow: 0 10px 18px -12px rgba(0,0,0,0.35);
}
.modal-actions .btn-primary:active,
.modal-actions .btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 6px 12px -12px rgba(0,0,0,0.35);
}
body.dark .modal-actions .btn-secondary {
    background: #111827;
    border: 1px solid #1f2937;
    color: #e2e8f0;
}
body.dark .modal-actions .btn-primary {
    background: linear-gradient(135deg, #38bdf8, #4ade80);
    border: 1px solid #38bdf8;
    color: #0b1220;
}

.modal-note {
    font-size: 12px;
    color: var(--gray-color);
}
/* Bottom Row */
.bottom-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 992px) {
    .bottom-row {
        grid-template-columns: 1fr;
    }
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-light);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 36px;
    height: 36px;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-content p {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    color: var(--dark-color);
}

.activity-time {
    font-size: 0.75rem;
    color: var(--gray-color);
}

/* Products List */
.products-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-light);
}

.product-item:last-child {
    border-bottom: none;
}

.product-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.product-info img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

.product-info h4 {
    font-size: 0.9rem;
    margin-bottom: 0.1rem;
}

.product-info p {
    font-size: 0.75rem;
    color: var(--gray-color);
}

.product-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.1rem;
}

.sales {
    font-size: 0.85rem;
    font-weight: 500;
}

.revenue {
    font-size: 0.75rem;
    color: var(--gray-color);
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .dashboard-container .sidebar {
        transform: translateX(-100%);
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: var(--sidebar-width);
    }
    .dashboard-container .sidebar.expanded {
        transform: translateX(0);
    }
    .dashboard-container {
        width: 100%;
        margin-left: 0;
        padding: 14px;
    }
    .dashboard-container .main-content {
        margin-left: 0;
        padding: 14px;
        padding-top: 90px;
        width: 100%;
        max-width: 100%;
    }
    .widgets-row {
        grid-template-columns: 1fr 1fr;
    }
    .sidebar-overlay {
        display: none;
    }
    .sidebar-overlay.show {
        display: block;
    }
}

@media (max-width: 576px) {
    .widgets-row {
        grid-template-columns: 1fr;
    }

    .dashboard-container .main-header {
        flex-direction: column;
        gap: 1rem;
    }

    .dashboard-container .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .search-bar input {
        width: 100%;
    }

    .search-bar input:focus {
        width: 100%;
    }
}

/* Dark mode overrides */
body.dark {
    background-color: #0f172a;
    color: #e2e8f0;
}
body.dark .card,
body.dark .widget,
body.dark .dashboard-container .main-header {
    background: #1e293b;
    color: #e2e8f0;
    box-shadow: 0 10px 20px -10px rgba(0,0,0,0.45);
}
body.dark .dashboard-container .header-left h2,
body.dark .dashboard-container .header-left p,
body.dark .widget-header h3,
body.dark .card-header h3,
body.dark .widget-value,
body.dark .widget-footer,
body.dark .widget-body,
body.dark .chart-header h3,
body.dark .view-all,
body.dark .activity-content p,
body.dark .activity-time,
body.dark .product-info h4,
body.dark .product-info p,
body.dark .sales,
body.dark .revenue,
body.dark #serverSelectedInfo,
body.dark #serverSelectedHost {
    color: #e2e8f0;
}
body.dark .widget-header i,
body.dark .activity-icon {
    background: rgba(56, 189, 248, 0.16);
    color: #38bdf8;
}
body.dark .dashboard-container .main-header,
body.dark .widget,
body.dark .card {
    border: 1px solid #1f2937;
}
body.dark .dashboard-container .sidebar {
    background: #0b1220;
    color: #e2e8f0;
}
body.dark .dashboard-container .sidebar-header h1,
body.dark .sidebar-user h3,
body.dark .sidebar-user p,
body.dark .sidebar-group-title {
    color: #e2e8f0;
}
body.dark .dashboard-container .sidebar-nav ul li a {
    color: #cbd5e1;
}
body.dark .dashboard-container .sidebar-nav ul li a:hover,
body.dark .dashboard-container .sidebar-nav ul li.active a {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border-right-color: #38bdf8;
}
body.dark .sidebar-footer small {
    color: #94a3b8;
}
body.dark .monitor-widget .widget-body {
    background: #111827;
    border: 1px dashed #334155;
}
body.dark .monitor-widget .server-actions select {
    background: #0b1220;
    color: #e2e8f0;
    border-color: #334155;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.35);
}
body.dark .btn-mini {
    background: #22d3ee;
    border-color: #22d3ee;
    color: #0b1220;
}
body.dark .btn-mini.btn-secondary {
    background: transparent;
    color: #e2e8f0;
    border-color: #334155;
}
body.dark .widget-body p,
body.dark .widget-footer,
body.dark .server-actions select,
body.dark .modal-content,
body.dark .modal-grid label,
body.dark .modal-note,
body.dark .activity-list,
body.dark .product-stats {
    color: #e2e8f0;
}
body.dark .chart-actions button {
    background: #0f172a;
    color: #e2e8f0;
    border-color: #334155;
}
body.dark .chart-actions button.active,
body.dark .chart-actions button:hover {
    background: #22d3ee;
    border-color: #22d3ee;
    color: #0b1220;
}
body.dark .search-bar input {
    background: #111827;
    color: #e2e8f0;
    border-color: #334155;
}
body.dark .search-bar i {
    color: #94a3b8;
}
body.dark .notifications {
    background: #0b1220;
    color: #22d3ee;
}
body.dark .notifications .notification-badge {
    background: #ef4444;
}
