/* assets/css/style.css - Sistem Desain Modern GIZI-RSLGM */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
    --primary: #059669;
    --primary-hover: #047857;
    --primary-light: #ecfdf5;
    --primary-border: #a7f3d0;
    
    --bg-main: #f8fafc;
    --surface: #ffffff;
    --surface-elevated: #ffffff;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --border-color: #e2e8f0;
    --border-focus: #10b981;
    
    /* Status Colors */
    --status-menunggu-bg: #fef3c7;
    --status-menunggu-text: #92400e;
    --status-menunggu-border: #fde68a;
    
    --status-diproses-bg: #e0f2fe;
    --status-diproses-text: #0369a1;
    --status-diproses-border: #bae6fd;
    
    --status-selesai-bg: #dcfce7;
    --status-selesai-text: #15803d;
    --status-selesai-border: #bbf7d0;

    /* Bentuk Makanan Colors */
    --bentuk-biasa: #0284c7;
    --bentuk-lunak: #ea580c;
    --bentuk-saring: #7c3aed;
    --bentuk-cair: #0891b2;
    
    /* Alergi & Danger */
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --danger-border: #fecaca;
    --danger-text: #991b1b;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 9999px;

    --shadow-subtle: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
    --shadow-card: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -2px rgba(0,0,0,0.03);
    --shadow-elevated: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
    --shadow-glow-emerald: 0 0 20px rgba(16, 185, 129, 0.25);
    --shadow-glow-amber: 0 0 15px rgba(245, 158, 11, 0.3);
}

/* Dark Kitchen Mode */
body.kitchen-dark {
    --bg-main: #0f172a;
    --surface: #1e293b;
    --surface-elevated: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border-color: #334155;
    --shadow-card: 0 4px 6px -1px rgba(0,0,0,0.4);
    --danger-light: #450a0a;
    --danger-border: #7f1d1d;
    --danger-text: #fecaca;
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* Header & Nav */
.header-nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
}

.header-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    color: inherit;
}

.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: var(--shadow-glow-emerald);
}

.brand-text h1 {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-text .badge-hospital {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid var(--primary-border);
    border-radius: var(--radius-pill);
    text-transform: uppercase;
}

.brand-text p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.header-status-strip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-btn-cluster {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

/* Nav Buttons */
.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid transparent;
}

.nav-btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.25);
}

.nav-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
}

.nav-btn-outline {
    background: var(--surface);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.nav-btn-outline:hover {
    background: var(--bg-main);
    border-color: var(--text-muted);
}

.btn-icon-only {
    width: 38px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.btn-icon-only:hover {
    background: var(--bg-main);
}

/* Main Container */
.main-wrapper {
    max-width: 1440px;
    margin: 0 auto;
    padding: 1.25rem;
}

/* Kitchen Summary Bar */
.summary-bar-wrapper {
    margin-bottom: 1.5rem;
}

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

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.1rem;
    box-shadow: var(--shadow-subtle);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-icon.biasa { background: #e0f2fe; color: #0284c7; }
.stat-icon.lunak { background: #ffedd5; color: #ea580c; }
.stat-icon.saring { background: #f3e8ff; color: #7c3aed; }
.stat-icon.cair { background: #cffafe; color: #0891b2; }
.stat-icon.total { background: #dcfce7; color: #15803d; }

.stat-content .stat-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.stat-content .stat-number {
    font-size: 1.65rem;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.1;
    color: var(--text-primary);
}

/* Allergen High Alert Banner */
.allergen-alert-banner {
    background: var(--danger-light);
    border: 1px solid var(--danger-border);
    border-radius: var(--radius-lg);
    padding: 0.85rem 1.15rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    animation: pulse-soft 3s infinite;
}

@keyframes pulse-soft {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.2); }
    50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.1); }
}

.allergen-alert-banner .alert-icon {
    font-size: 24px;
    line-height: 1;
}

.allergen-alert-banner .alert-content h4 {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--danger-text);
    margin-bottom: 0.25rem;
}

.allergen-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.allergen-badge-item {
    background: #ffffff;
    color: #b91c1c;
    border: 1px solid #f87171;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* Control & Filter Bar */
.control-bar {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
}

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

.filter-tab {
    padding: 0.45rem 0.95rem;
    font-size: 0.825rem;
    font-weight: 600;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.filter-tab:hover {
    background: var(--bg-main);
    color: var(--text-primary);
}

.filter-tab.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.search-box {
    position: relative;
    min-width: 240px;
}

.search-box input {
    width: 100%;
    padding: 0.5rem 0.85rem 0.5rem 2.2rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-main);
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: var(--border-focus);
    background: var(--surface);
}

.search-box .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

/* Live Cards Grid */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.15rem;
}

/* Note Card */
.note-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.15rem;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.note-card.status-menunggu {
    border-top: 5px solid #f59e0b;
}

.note-card.status-diproses {
    border-top: 5px solid #0284c7;
}

.note-card.status-selesai {
    border-top: 5px solid #10b981;
    opacity: 0.88;
}

.note-card.has-allergy {
    border-color: #fca5a5;
    background: linear-gradient(to bottom, rgba(254, 242, 242, 0.5), var(--surface));
}

/* Card Header */
.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.room-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #0f172a;
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    letter-spacing: -0.01em;
}

body.kitchen-dark .room-badge {
    background: #334155;
    color: #38bdf8;
    border: 1px solid #475569;
}

.status-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-badge.menunggu {
    background: var(--status-menunggu-bg);
    color: var(--status-menunggu-text);
    border: 1px solid var(--status-menunggu-border);
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.65; }
}

.status-badge.diproses {
    background: var(--status-diproses-bg);
    color: var(--status-diproses-text);
    border: 1px solid var(--status-diproses-border);
}

.status-badge.selesai {
    background: var(--status-selesai-bg);
    color: var(--status-selesai-text);
    border: 1px solid var(--status-selesai-border);
}

/* Patient Info */
.patient-title {
    font-size: 1.12rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.25;
    margin-bottom: 0.2rem;
}

.patient-rm {
    font-size: 0.78rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

/* Diet Badges Box */
.diet-badges-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
}

.pill-bentuk {
    font-size: 0.82rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.pill-bentuk.biasa { background: var(--bentuk-biasa); }
.pill-bentuk.lunak { background: var(--bentuk-lunak); }
.pill-bentuk.saring { background: var(--bentuk-saring); }
.pill-bentuk.cair { background: var(--bentuk-cair); }

.pill-diet-khusus {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    background: #e2e8f0;
    color: #334155;
    border: 1px solid #cbd5e1;
}

body.kitchen-dark .pill-diet-khusus {
    background: #334155;
    color: #e2e8f0;
    border-color: #475569;
}

/* Allergen Warning Box */
.allergy-box {
    background: var(--danger-light);
    border: 1px solid var(--danger-border);
    border-radius: var(--radius-md);
    padding: 0.55rem 0.75rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--danger-text);
    font-size: 0.85rem;
    font-weight: 700;
}

/* Visit Notes Text */
.visit-note-content {
    background: var(--bg-main);
    border-left: 3px solid var(--primary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 0.65rem 0.85rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-style: italic;
}

body.kitchen-dark .visit-note-content {
    background: #0f172a;
}

/* Card Footer & Action */
.card-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    border-top: 1px dashed var(--border-color);
    padding-top: 0.65rem;
}

.card-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
}

.btn-action-cook {
    width: 100%;
    padding: 0.6rem 0.9rem;
    font-size: 0.875rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.btn-action-cook.btn-start {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    box-shadow: var(--shadow-glow-amber);
}

.btn-action-cook.btn-start:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.btn-action-cook.btn-done {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: var(--shadow-glow-emerald);
}

.btn-action-cook.btn-done:hover {
    transform: translateY(-1px);
}

.btn-action-cook.btn-completed {
    background: #e2e8f0;
    color: #64748b;
    cursor: default;
}

body.kitchen-dark .btn-action-cook.btn-completed {
    background: #334155;
    color: #94a3b8;
}

/* Form Visit Layout (visit.php) */
.form-container {
    max-width: 720px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-elevated);
}

.form-header {
    text-align: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.form-header h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
}

.form-header p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.form-section {
    margin-bottom: 1.35rem;
}

.section-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-main);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
}

.form-input:focus {
    border-color: var(--border-focus);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* Segmented Buttons for Texture (Bentuk Makanan) */
.texture-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
}

@media (min-width: 540px) {
    .texture-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.texture-btn {
    border: 2px solid var(--border-color);
    background: var(--bg-main);
    color: var(--text-primary);
    padding: 0.85rem 0.5rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s;
}

.texture-btn span.emoji {
    font-size: 24px;
}

.texture-btn:hover {
    border-color: var(--text-muted);
}

.texture-btn.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary);
}

/* Chips Selection */
.chips-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.65rem;
}

.chip-item {
    padding: 0.45rem 0.85rem;
    font-size: 0.825rem;
    font-weight: 600;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.chip-item:hover {
    background: #e2e8f0;
}

.chip-item.active {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

.chip-item.chip-allergy.active {
    background: #dc2626;
    color: #ffffff;
    border-color: #b91c1c;
}

/* Big Submit Button */
.btn-submit-visit {
    width: 100%;
    padding: 0.95rem;
    font-size: 1.05rem;
    font-weight: 800;
    color: #ffffff;
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
    transition: all 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
}

.btn-submit-visit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

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

/* Toast Notification */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.toast {
    background: #0f172a;
    color: #ffffff;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-left: 4px solid var(--primary);
    animation: toast-in 0.3s ease-out;
}

@keyframes toast-in {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Responsive adjustments (Mobile & Tablet) */
@media (max-width: 768px) {
    .header-container {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "brand buttons"
            "status status";
        align-items: center;
        gap: 0.35rem 0.5rem;
        padding: 0.5rem 0.75rem;
    }

    .brand-wrapper {
        grid-area: brand;
        min-width: 0;
        gap: 0.5rem;
    }

    .brand-icon {
        width: 34px;
        height: 34px;
        font-size: 18px;
        border-radius: var(--radius-sm);
        flex-shrink: 0;
    }

    .brand-text h1 {
        font-size: 1.05rem;
        gap: 0.35rem;
        white-space: nowrap;
    }

    .brand-text .badge-hospital {
        font-size: 0.65rem;
        padding: 1px 6px;
    }

    .brand-text p, .brand-subtitle {
        display: none !important;
    }

    .header-actions {
        display: contents;
    }

    .header-btn-cluster {
        grid-area: buttons;
        display: flex;
        align-items: center;
        gap: 0.3rem;
        justify-content: flex-end;
    }

    .nav-btn-mobile-sm {
        padding: 0.45rem 0.65rem;
        font-size: 0.78rem;
        gap: 0.35rem;
    }

    .btn-icon-only {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }

    .header-status-strip {
        grid-area: status;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.4rem;
        padding-top: 0.35rem;
        border-top: 1px solid var(--border-color);
        width: 100%;
    }

    .session-timer-badge {
        font-size: 0.72rem;
        padding: 3px 8px;
        max-width: 75%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .status-conn-badge {
        font-size: 0.72rem;
        padding: 3px 8px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Kitchen Summary Cards 2-col compact grid on mobile */
    .summary-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }

    .summary-cards-grid .stat-card:first-child {
        grid-column: 1 / -1;
        padding: 0.75rem 1rem;
        background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(5, 150, 105, 0.03) 100%);
        border-color: var(--primary-border);
    }

    .stat-card {
        padding: 0.65rem 0.75rem;
        gap: 0.6rem;
        border-radius: var(--radius-md);
    }

    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
        border-radius: var(--radius-sm);
    }

    .stat-content .stat-label {
        font-size: 0.68rem;
    }

    .stat-content .stat-number {
        font-size: 1.35rem;
    }

    .summary-cards-grid .stat-card:first-child .stat-number {
        font-size: 1.65rem;
        color: var(--primary);
    }

    /* Control bar on mobile */
    .control-bar {
        padding: 0.65rem 0.75rem;
        gap: 0.65rem;
    }

    .filter-group {
        width: 100%;
        display: flex;
        gap: 0.35rem;
    }

    .filter-tab {
        flex: 1 1 auto;
        text-align: center;
        padding: 0.4rem 0.45rem;
        font-size: 0.75rem;
    }

    .search-box {
        width: 100%;
        min-width: 0;
    }

    .notes-grid {
        grid-template-columns: 1fr;
    }

    .clinical-presets-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.45rem;
    }

    .texture-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
}

@media (max-width: 420px) {
    #kds-tv-toggle {
        display: none !important;
    }
}


/* Connection Status Badge (Offline-First) */
.status-conn-badge {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: default;
    transition: all 0.2s;
}

.status-conn-badge.online {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.status-conn-badge.offline {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
    animation: pulse-soft 2s infinite;
}

.status-conn-badge.syncing {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

/* Status Diantar (Distribusi Pramusaji) */
:root {
    --status-diantar-bg: #f3e8ff;
    --status-diantar-text: #6b21a8;
    --status-diantar-border: #e9d5ff;
}

.status-badge.diantar {
    background: var(--status-diantar-bg);
    color: var(--status-diantar-text);
    border: 1px solid var(--status-diantar-border);
}

.note-card.status-diantar {
    border-top: 4px solid #9333ea;
    opacity: 0.85;
}

/* Mobile Sticky Submit Dock (Ahli Gizi Smartphone View) */
.sticky-submit-dock {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-color);
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.08);
    z-index: 40;
    margin-left: -1rem;
    margin-right: -1rem;
    margin-top: 1rem;
    border-bottom-left-radius: var(--radius-xl);
    border-bottom-right-radius: var(--radius-xl);
}

body.kitchen-dark .sticky-submit-dock {
    background: rgba(30, 41, 59, 0.95);
    border-top-color: #334155;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

/* Custom Room / Bangsal Chips & Management */
.room-picker-container {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    margin-top: 0.5rem;
}

.room-chips-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.room-chips-header span {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
}

.btn-manage-rooms {
    background: none;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-pill);
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.btn-manage-rooms:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.room-suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.room-chip {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 5px 10px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.15s ease;
}

.room-chip:active, .room-chip.selected {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    transform: scale(0.97);
}

.bed-chips-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border-color);
}

.bed-chip {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.bed-chip:active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

/* Modal Kelola Nama Kamar */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 480px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: modal-slide-up 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

@keyframes modal-slide-up {
    from { transform: translateY(20px) scale(0.98); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-header {
    padding: 1.15rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
}

.modal-nav-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-main);
    padding: 0 1rem;
    gap: 0.35rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-nav-tab {
    padding: 0.75rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.modal-nav-tab:hover {
    color: var(--text-primary);
}

.modal-nav-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--surface);
    border-top-left-radius: var(--radius-sm);
    border-top-right-radius: var(--radius-sm);
}

.modal-body {
    padding: 1.5rem;
    max-height: 65vh;
    overflow-y: auto;
    background: var(--surface);
}

.modal-tab-content {
    display: none;
}

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

.modal-tab-content p {
    line-height: 1.5;
    margin-bottom: 1rem;
}

.room-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.25rem 0;
    max-height: 190px;
    overflow-y: auto;
}

.room-tag-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.15s ease;
}

.room-tag-item:hover {
    border-color: var(--text-muted);
}

.room-tag-item button {
    border: none;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    cursor: pointer;
    font-weight: bold;
    font-size: 0.75rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.room-tag-item button:hover {
    background: var(--danger);
    color: #ffffff;
}

/* Dark Mode Support for Master Modal */
body.kitchen-dark .modal-card {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

body.kitchen-dark .modal-header,
body.kitchen-dark .modal-body {
    background: #1e293b;
    border-color: #334155;
}

body.kitchen-dark .modal-nav-tabs {
    background: #0f172a;
    border-color: #334155;
}

body.kitchen-dark .modal-nav-tab {
    color: #94a3b8;
}

body.kitchen-dark .modal-nav-tab.active {
    color: var(--primary);
    background: #1e293b;
}

body.kitchen-dark .room-tag-item {
    background: #0f172a;
    border-color: #334155;
    color: #f8fafc;
}

/* Paket Diet Cepat (1-Tap Clinical Presets) */
.clinical-presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.clinical-preset-card {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.65rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    user-select: none;
}

.clinical-preset-card:active, .clinical-preset-card.active {
    background: var(--primary-light);
    border-color: var(--primary);
    transform: scale(0.98);
}

.clinical-preset-card .preset-icon {
    font-size: 1.15rem;
    margin-bottom: 0.2rem;
}

.clinical-preset-card .preset-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.clinical-preset-card .preset-desc {
    font-size: 0.68rem;
    color: var(--text-muted);
}

/* Sesi Makan Countdown Timer Banner */
.session-timer-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-pill);
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
    user-select: none;
}


body.kitchen-dark .session-timer-badge {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

/* KDS Fullscreen TV Mode */
body.kds-tv-mode {
    font-size: 18px;
    background: #090d16;
}

body.kds-tv-mode .header-nav {
    padding: 0.5rem 1rem;
}

body.kds-tv-mode .summary-cards-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

body.kds-tv-mode .stat-number {
    font-size: 2.25rem;
}

body.kds-tv-mode .notes-grid {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.25rem;
}

body.kds-tv-mode .patient-title {
    font-size: 1.45rem;
}

body.kds-tv-mode .room-badge {
    font-size: 1.15rem;
    font-weight: 800;
    padding: 6px 14px;
}

body.kds-tv-mode .btn-action-cook {
    font-size: 1.1rem;
    padding: 0.85rem 1.25rem;
}

/* Action Delivery Button */
.btn-delivery {
    background: linear-gradient(135deg, #9333ea, #7e22ce);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(147, 51, 234, 0.3);
}

.btn-delivery:hover {
    background: linear-gradient(135deg, #7e22ce, #6b21a8);
}

/* =============================================================
   THERMAL ETICKET PRINT STYLING (58mm / 80mm Baki Makanan RS)
   ============================================================= */
#thermal-print-area {
    display: none;
}

@media print {
    @page {
        size: 78mm auto;
        margin: 0;
    }

    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-family: 'JetBrains Mono', 'Courier New', monospace !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    body * {
        visibility: hidden !important;
    }

    #thermal-print-area, #thermal-print-area * {
        visibility: visible !important;
        display: block !important;
    }

    #thermal-print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 72mm;
        padding: 2mm 3mm;
        color: #000000;
        background: #ffffff;
    }

    .thermal-slip {
        page-break-after: always;
        margin-bottom: 5mm;
        padding-bottom: 3mm;
        border-bottom: 2px dashed #000;
        font-size: 11px;
        line-height: 1.35;
    }

    .thermal-slip:last-child {
        page-break-after: auto;
        border-bottom: none;
    }

    .slip-header {
        text-align: center;
        border-bottom: 1px solid #000;
        padding-bottom: 3px;
        margin-bottom: 4px;
    }

    .slip-header h2 {
        font-size: 13px;
        font-weight: 800;
        margin: 0;
        text-transform: uppercase;
        letter-spacing: -0.2px;
    }

    .slip-header p {
        font-size: 9px;
        margin: 1px 0 0 0;
        text-transform: uppercase;
    }

    .slip-section {
        border-bottom: 1px dashed #000;
        padding: 4px 0;
    }

    .slip-row {
        display: flex;
        justify-content: space-between;
        margin-bottom: 2px;
    }

    .slip-label {
        font-size: 10px;
        color: #333;
    }

    .slip-value {
        font-weight: bold;
        font-size: 11px;
    }

    .slip-big-room {
        font-size: 16px;
        font-weight: 900;
        text-align: center;
        background: #000;
        color: #fff !important;
        padding: 3px 0;
        margin: 4px 0;
        text-transform: uppercase;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .slip-patient-name {
        font-size: 13px;
        font-weight: 800;
        margin: 2px 0;
    }

    .slip-diet-box {
        border: 2px solid #000;
        padding: 4px 5px;
        margin: 4px 0;
        text-align: center;
    }

    .slip-diet-box .diet-main {
        font-size: 13px;
        font-weight: 900;
        text-transform: uppercase;
    }

    .slip-diet-box .diet-detail {
        font-size: 11px;
        font-weight: 700;
    }

    .slip-allergy-alert {
        background: #000;
        color: #fff !important;
        padding: 3px 4px;
        font-size: 11px;
        font-weight: 900;
        text-align: center;
        margin: 4px 0;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .slip-note-box {
        font-size: 10px;
        font-style: italic;
        padding: 2px 0;
    }

    .slip-footer {
        font-size: 9px;
        text-align: center;
        margin-top: 4px;
    }
}

