/* ==========================================================
   DESIGN SYSTEM - Sistem Monitoring Suhu
   RS Permata Keluarga Summarecon Bekasi

   Arah: alat kerja klinis. Tenang, padat informasi, mudah dibaca.
   - Satu aksen (oranye RS), netral abu-abu dingin satu keluarga.
   - Warna status (hijau/merah/kuning) hanya untuk arti, bukan dekorasi.
   - Tanpa gradien. Bayangan tipis dan bernada.
   - Radius: kontrol 8px, kartu 12px, badge 6px.
   - Angka memakai tabular-nums agar kolom suhu rata.
   ========================================================== */

:root {
    /* Aksen: oranye RS (sedikit diturunkan saturasinya) */
    --primary-50:  #FDF3EA;
    --primary-100: #FAE3CF;
    --primary-200: #F4C59E;
    --primary-300: #EDA56B;
    --primary-400: #E88A3F;
    --primary-500: #DE7020;
    --primary-600: #C25E15;
    --primary-700: #9C4B11;
    --primary-800: #763910;
    --primary-900: #52280C;

    /* Netral: satu keluarga abu-abu dingin */
    --gray-50:  #F6F7F9;
    --gray-100: #EEF0F3;
    --gray-200: #E2E5EA;
    --gray-300: #CDD2D9;
    --gray-400: #A3AAB5;
    --gray-500: #7B8390;
    --gray-600: #5A616D;
    --gray-700: #3F4550;
    --gray-800: #272B33;
    --gray-900: #16191F;

    /* Status */
    --success:     #1E8A5A;
    --success-50:  #EEF8F3;
    --success-100: #D3EEE1;
    --success-600: #17714A;

    --warning:     #B7791F;
    --warning-50:  #FCF6EA;
    --warning-100: #F6E7C7;
    --warning-600: #8F5E16;

    --danger:     #C93838;
    --danger-50:  #FCEFEF;
    --danger-100: #F7D6D6;
    --danger-600: #A92C2C;

    /* "info" dipakai untuk data kelembaban. Teal agar tidak bersaing dengan aksen. */
    --info:     #2B7A8C;
    --info-50:  #EDF6F8;
    --info-100: #D2E9EE;
    --info-600: #22626F;

    /* Warna seri shift (grafik & matriks) */
    --shift-pagi:  #DE7020;
    --shift-siang: #2B7A8C;
    --shift-malam: #4B4F8A;

    /* Tema */
    --background: #F3F4F6;
    --surface: #FFFFFF;
    --surface-elevated: #FFFFFF;
    --surface-sunken: #F6F7F9;
    --border: #E0E3E8;
    --border-light: #ECEEF1;
    --border-strong: #CDD2D9;

    --text-primary: #16191F;
    --text-secondary: #555C68;
    --text-muted: #7B8390;
    --text-inverse: #FFFFFF;

    --hover: rgba(22, 25, 31, 0.04);
    --active: rgba(222, 112, 32, 0.10);
    --focus-ring: 0 0 0 3px rgba(222, 112, 32, 0.28);

    /* Bayangan bernada (abu kebiruan, bukan hitam murni) */
    --shadow-sm: 0 1px 2px rgba(30, 38, 52, 0.05);
    --shadow-md: 0 1px 2px rgba(30, 38, 52, 0.04), 0 2px 8px -2px rgba(30, 38, 52, 0.06);
    --shadow-lg: 0 4px 12px -2px rgba(30, 38, 52, 0.10), 0 2px 4px -2px rgba(30, 38, 52, 0.05);
    --shadow-xl: 0 16px 32px -8px rgba(30, 38, 52, 0.18), 0 4px 8px -4px rgba(30, 38, 52, 0.06);

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

    /* Tipografi */
    --font-sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", monospace;

    /* Transisi */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --transition-fast: 140ms var(--ease-out);
    --transition-normal: 200ms var(--ease-out);
    --transition-slow: 300ms var(--ease-out);

    /* Z-index */
    --z-sticky: 100;
    --z-overlay: 900;
    --z-sidebar: 1000;
    --z-dropdown: 1100;
}

/* ==========================================================
   RESET & BASE
   ========================================================== */

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

[hidden] {
    display: none !important;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--text-primary);
    background-color: var(--background);
    font-feature-settings: "tnum" 1;
}

:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
    border-radius: var(--radius-sm);
}

::selection {
    background: var(--primary-100);
    color: var(--primary-900);
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -3rem;
    z-index: var(--z-dropdown);
    background: var(--gray-900);
    color: #fff;
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 0.75rem;
    color: #fff;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==========================================================
   TYPOGRAPHY
   ========================================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.011em;
    color: var(--text-primary);
    text-wrap: balance;
}

h1 { font-size: 1.75rem; letter-spacing: -0.02em; }
h2 { font-size: 1.375rem; letter-spacing: -0.016em; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }
h5 { font-size: 0.9375rem; }
h6 { font-size: 0.875rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    text-wrap: pretty;
}

a {
    color: var(--primary-600);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-700);
}

.num, .mono {
    font-variant-numeric: tabular-nums;
}

.mono {
    font-family: var(--font-mono);
    font-size: 0.875em;
}

/* ==========================================================
   BUTTONS
   ========================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4375rem;
    min-height: 2.375rem;
    padding: 0.5rem 0.9375rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background-color var(--transition-fast), border-color var(--transition-fast),
                color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.btn i {
    font-size: 1.0625rem;
    line-height: 1;
}

.btn:active:not(:disabled) {
    transform: translateY(1px);
}

.btn:focus-visible {
    box-shadow: var(--focus-ring);
    border-radius: var(--radius-md);
}

.btn:disabled,
.btn.disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-500);
    color: #fff;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.12);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-600);
    color: #fff;
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-50);
    border-color: var(--gray-400);
    color: var(--text-primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--hover);
    color: var(--text-primary);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover:not(:disabled) {
    background: var(--success-600);
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover:not(:disabled) {
    background: var(--danger-600);
    color: #fff;
}

/* Warning dipakai untuk tombol "edit": dibuat tenang, bukan kuning menyala */
.btn-warning {
    background: var(--warning-50);
    color: var(--warning-600);
    border-color: var(--warning-100);
}

.btn-warning:hover:not(:disabled) {
    background: var(--warning-100);
    color: var(--warning-600);
}

.btn-info {
    background: var(--info);
    color: #fff;
}

.btn-info:hover:not(:disabled) {
    background: var(--info-600);
    color: #fff;
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary-600);
    border-color: var(--primary-300);
}

.btn-outline-primary:hover:not(:disabled) {
    background: var(--primary-50);
    color: var(--primary-700);
}

.btn-sm {
    min-height: 2rem;
    padding: 0.3125rem 0.6875rem;
    font-size: 0.8125rem;
}

.btn-sm i {
    font-size: 0.9375rem;
}

.btn-lg {
    min-height: 3rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-icon {
    width: 2.375rem;
    padding: 0;
}

.btn-sm.btn-icon {
    width: 2rem;
}

/* ==========================================================
   CARDS
   ========================================================== */

.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--surface);
}

.card-header-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-header-title > i {
    font-size: 1.125rem;
    color: var(--text-muted);
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--gray-50);
    border: 1px solid var(--border-light);
    flex-shrink: 0;
}

.card-title {
    font-size: 0.9875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.006em;
}

.card-subtitle {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0.125rem 0 0 0;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    padding: 0.875rem 1.25rem;
    border-top: 1px solid var(--border-light);
    background: var(--surface-sunken);
}

/* ==========================================================
   FORMS
   ========================================================== */

.form-group {
    margin-bottom: 1.125rem;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}

.form-label .required {
    color: var(--danger);
}

.form-control {
    width: 100%;
    min-height: 2.5rem;
    padding: 0.5rem 0.8125rem;
    font-family: inherit;
    font-size: 0.9375rem;
    line-height: 1.45;
    color: var(--text-primary);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    box-shadow: inset 0 1px 1px rgba(30, 38, 52, 0.03);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:hover:not(:focus):not(:disabled) {
    border-color: var(--gray-400);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: var(--focus-ring);
}

.form-control:disabled {
    background: var(--gray-50);
    color: var(--text-muted);
}

.form-control::placeholder {
    color: var(--gray-500);
}

.form-control.is-invalid {
    border-color: var(--danger);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(201, 56, 56, 0.2);
}

.invalid-feedback {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: var(--danger-600);
}

.form-hint {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

select.form-control {
    cursor: pointer;
    appearance: none;
    padding-right: 2.25rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235A616D' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

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

input[type="checkbox"], input[type="radio"] {
    accent-color: var(--primary-500);
}

/* ==========================================================
   TABLES
   ========================================================== */

.table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.table th,
.table td {
    padding: 0.75rem 1.25rem;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
}

.table th {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--surface-sunken);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.table tbody tr {
    transition: background-color var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--gray-50);
}

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

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

.cell-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ==========================================================
   BADGES
   ========================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    min-height: 1.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    border: 1px solid transparent;
}

.badge-primary {
    background: var(--primary-50);
    color: var(--primary-700);
    border-color: var(--primary-100);
}

.badge-success {
    background: var(--success-50);
    color: var(--success-600);
    border-color: var(--success-100);
}

.badge-warning {
    background: var(--warning-50);
    color: var(--warning-600);
    border-color: var(--warning-100);
}

.badge-danger {
    background: var(--danger-50);
    color: var(--danger-600);
    border-color: var(--danger-100);
}

.badge-info {
    background: var(--info-50);
    color: var(--info-600);
    border-color: var(--info-100);
}

.badge-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border-color: var(--gray-200);
}

.badge-shift {
    background: var(--surface);
    color: var(--text-secondary);
    border-color: var(--border);
    font-weight: 500;
}

.badge-shift::before {
    content: "";
    width: 0.4375rem;
    height: 0.4375rem;
    border-radius: 2px;
    background: currentColor;
}

.badge-shift.pagi::before  { background: var(--shift-pagi); }
.badge-shift.siang::before { background: var(--shift-siang); }
.badge-shift.malam::before { background: var(--shift-malam); }

/* ==========================================================
   ALERTS
   ========================================================== */

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    font-size: 0.875rem;
    border: 1px solid transparent;
    border-left-width: 3px;
}

.alert i {
    font-size: 1.125rem;
    line-height: 1.3;
    flex-shrink: 0;
}

.alert-success {
    background: var(--success-50);
    border-color: var(--success-100);
    border-left-color: var(--success);
    color: var(--success-600);
}

.alert-warning {
    background: var(--warning-50);
    border-color: var(--warning-100);
    border-left-color: var(--warning);
    color: var(--warning-600);
}

.alert-danger {
    background: var(--danger-50);
    border-color: var(--danger-100);
    border-left-color: var(--danger);
    color: var(--danger-600);
}

.alert-info {
    background: var(--info-50);
    border-color: var(--info-100);
    border-left-color: var(--info);
    color: var(--info-600);
}

/* ==========================================================
   STATS (dipakai halaman lama)
   ========================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.125rem 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
}

.stat-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    background: var(--gray-50);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.stat-icon.primary { background: var(--primary-50); color: var(--primary-600); border-color: var(--primary-100); }
.stat-icon.success { background: var(--success-50); color: var(--success-600); border-color: var(--success-100); }
.stat-icon.warning { background: var(--warning-50); color: var(--warning-600); border-color: var(--warning-100); }
.stat-icon.danger  { background: var(--danger-50);  color: var(--danger-600);  border-color: var(--danger-100); }
.stat-icon.info    { background: var(--info-50);    color: var(--info-600);    border-color: var(--info-100); }

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

.stat-value {
    font-size: 1.625rem;
    font-weight: 650;
    color: var(--text-primary);
    line-height: 1.15;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* ==========================================================
   KOMPONEN BARU
   ========================================================== */

/* Kepala halaman di dalam konten */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.page-head h1 {
    font-size: 1.375rem;
}

.page-head p {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Strip KPI: angka tanpa kartu berat, dipisah garis tipis */
.kpi-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.kpi {
    padding: 1rem 1.25rem 1.125rem;
    border-right: 1px solid var(--border-light);
    min-width: 0;
}

.kpi:last-child {
    border-right: none;
}

.kpi-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.kpi-label i {
    font-size: 1rem;
    color: var(--text-muted);
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 650;
    letter-spacing: -0.025em;
    line-height: 1.15;
    margin-top: 0.375rem;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

.kpi-value small {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0;
    margin-left: 0.125rem;
}

.kpi-foot {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.kpi.is-danger .kpi-value { color: var(--danger); }
.kpi.is-success .kpi-value { color: var(--success); }

/* Segmented control (tab periode / shift) */
.seg {
    display: inline-flex;
    padding: 0.1875rem;
    gap: 0.125rem;
    background: var(--gray-100);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}

.seg::-webkit-scrollbar { display: none; }

.seg-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4375rem;
    min-height: 2rem;
    padding: 0.3125rem 0.8125rem;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: calc(var(--radius-md) - 2px);
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: background-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
}

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

.seg-btn.active,
.seg-btn[aria-selected="true"],
.seg-btn[aria-pressed="true"] {
    background: var(--surface);
    color: var(--text-primary);
    box-shadow: 0 1px 2px rgba(30, 38, 52, 0.08), 0 0 0 1px rgba(30, 38, 52, 0.04);
}

.seg-btn .swatch {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 2px;
    flex-shrink: 0;
}

.seg.block {
    display: flex;
    width: 100%;
}

.seg.block .seg-btn {
    flex: 1;
    justify-content: center;
}

/* Bilah meta (periode, standar, jumlah data) */
.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 2rem;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--surface-sunken);
}

.meta-item {
    min-width: 0;
}

.meta-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.meta-value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* Progres tipis */
.progress {
    height: 0.375rem;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress > span {
    display: block;
    height: 100%;
    background: var(--primary-500);
    border-radius: inherit;
    transition: width var(--transition-slow);
}

.progress.success > span { background: var(--success); }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    max-width: 26rem;
    margin: 0 auto;
}

.empty-state > i {
    font-size: 2rem;
    color: var(--text-muted);
    width: 3.5rem;
    height: 3.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    background: var(--gray-50);
    border: 1px solid var(--border-light);
    margin-bottom: 0.875rem;
}

.empty-state h4 {
    font-size: 0.9875rem;
    margin-bottom: 0.25rem;
}

.empty-state p {
    font-size: 0.875rem;
    margin: 0 0 1rem;
}

/* Nilai pengukuran */
.reading {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.reading .u {
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 0.0625rem;
}

.reading.ok  { color: var(--success); }
.reading.bad { color: var(--danger); }

/* ==========================================================
   TEMPERATURE & HUMIDITY (dipakai halaman lama)
   ========================================================== */

.temp-display {
    font-size: 2.5rem;
    font-weight: 650;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.temp-display .unit {
    font-size: 1.5rem;
    color: var(--text-secondary);
}

.humidity-display {
    font-size: 2.5rem;
    font-weight: 650;
    color: var(--info);
    font-variant-numeric: tabular-nums;
}

.humidity-display .unit {
    font-size: 1.5rem;
    color: var(--text-secondary);
}

.status-normal { color: var(--success); }
.status-warning { color: var(--warning); }
.status-danger { color: var(--danger); }

.reading-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: center;
    border: 1px solid var(--border);
}

.reading-card.normal { border-color: var(--success-100); background: var(--success-50); }
.reading-card.warning { border-color: var(--warning-100); background: var(--warning-50); }
.reading-card.danger { border-color: var(--danger-100); background: var(--danger-50); }

/* ==========================================================
   UTILITIES
   ========================================================== */

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

.text-primary { color: var(--primary-600); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-info { color: var(--info); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

.bg-primary { background-color: var(--primary-500); }
.bg-success { background-color: var(--success); }
.bg-warning { background-color: var(--warning); }
.bg-danger { background-color: var(--danger); }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 2rem; }

.d-flex { display: flex; }
.d-grid { display: grid; }
.d-block { display: block; }
.d-inline-block { display: inline-block; }
.d-none { display: none; }

.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

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

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Grid dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.25rem;
}

.dashboard-grid .col-span-2 {
    grid-column: span 2;
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */

@media (max-width: 1100px) {
    .kpi-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kpi:nth-child(2) { border-right: none; }
    .kpi:nth-child(-n+2) { border-bottom: 1px solid var(--border-light); }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .dashboard-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 1rem;
    }

    .dashboard-grid .col-span-2 {
        grid-column: span 1;
    }

    .table th,
    .table td {
        padding: 0.625rem 0.875rem;
    }

    .card-body {
        padding: 1rem;
    }

    .card-header {
        padding: 0.875rem 1rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .meta-row {
        padding: 0.75rem 1rem;
        gap: 0.5rem 1.25rem;
    }

    .kpi {
        padding: 0.875rem 1rem;
    }

    .kpi-value {
        font-size: 1.5rem;
    }

    .filter-form {
        flex-direction: column;
    }

    .filter-form > * {
        min-width: 100% !important;
    }
}

@media (max-width: 420px) {
    .stats-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ==========================================================
   SCROLLBAR
   ========================================================== */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: var(--radius-full);
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
    background-clip: content-box;
}

/* ==========================================================
   ANIMATIONS
   ========================================================== */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes shimmer {
    from { background-position: -200% 0; }
    to { background-position: 200% 0; }
}

.animate-fade-in { animation: fadeIn var(--transition-normal); }
.animate-slide-up { animation: slideUp var(--transition-slow) both; }
.animate-pulse { animation: pulse 2s infinite; }

.skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite linear;
    border-radius: var(--radius-md);
}

/* ==========================================================
   PAGINATION
   ========================================================== */

.pagination-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.pagination-info {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-info-bold {
    font-weight: 600;
    color: var(--text-primary);
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.125rem;
    height: 2.125rem;
    padding: 0 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
    text-decoration: none;
    font-variant-numeric: tabular-nums;
}

.pagination-btn:hover:not(.disabled):not(.active) {
    color: var(--text-primary);
    background: var(--gray-50);
    border-color: var(--border-strong);
}

.pagination-btn.active {
    color: #fff;
    background: var(--gray-900);
    border-color: var(--gray-900);
    cursor: default;
}

.pagination-btn.disabled {
    color: var(--text-muted);
    background: var(--gray-50);
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination-btn i {
    font-size: 1rem;
}

.pagination-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.125rem;
    height: 2.125rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    letter-spacing: 2px;
}

@media (max-width: 640px) {
    .pagination-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .pagination-info {
        justify-content: center;
        order: 2;
        margin-top: 0.5rem;
    }

    .pagination-nav {
        justify-content: center;
        order: 1;
    }
}

/* ==========================================================
   SWEETALERT2 - samakan dengan sistem
   ========================================================== */

.swal2-popup {
    font-family: var(--font-sans) !important;
    border-radius: var(--radius-lg) !important;
    padding: 1.5rem !important;
}

.swal2-title {
    font-size: 1.125rem !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
}

.swal2-html-container {
    font-size: 0.9375rem !important;
    color: var(--text-secondary) !important;
}

.swal2-styled {
    border-radius: var(--radius-md) !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
    padding: 0.5625rem 1.125rem !important;
}

.swal2-styled.swal2-confirm {
    background: var(--primary-500) !important;
}

.swal2-styled.swal2-cancel {
    background: var(--gray-100) !important;
    color: var(--text-primary) !important;
}

.swal2-styled:focus {
    box-shadow: var(--focus-ring) !important;
}
