/* public/assets/css/main.css */

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    background: #f5f5f5;
    color: #222;
}

.auth-page, .dashboard-page {
    min-height: 100vh;
}

.auth-container {
    max-width: 400px;
    margin: 40px auto;
    padding: 24px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.auth-container h1 {
    margin: 0 0 8px;
    font-size: 20px;
    text-align: center;
}

.auth-container h2 {
    margin: 0 0 16px;
    font-size: 16px;
    text-align: center;
    color: #555;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
}

.form-control {
    width: 100%;
    padding: 8px 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 14px;
    box-sizing: border-box;
}

.btn {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 4px;
    border: none;
    font-size: 14px;
    cursor: pointer;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
}

.btn-block {
    width: 100%;
}

.alert {
    padding: 8px 10px;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 13px;
}

.alert-danger {
    background: #fee2e2;
    color: #b91c1c;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #111827;
    color: #fff;
}

.main-header h1 {
    font-size: 18px;
    margin: 0;
}

.user-info {
    font-size: 13px;
}

.user-info a {
    color: #f97316;
    text-decoration: none;
    margin-left: 8px;
}

.dashboard-main {
    padding: 16px;
}

.card {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.card h2 {
    font-size: 16px;
    margin-top: 0;
}

@media (max-width: 600px) {
    .auth-container {
        margin: 24px 12px;
    }
}
/* Shell layout */
.app-shell {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f5f5f5;
}

.app-shell-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    background: #111827;
    color: #e5e7eb;
    display: flex;
    flex-direction: column;
    padding: 12px 8px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 4px 12px;
    border-bottom: 1px solid #1f2937;
    margin-bottom: 8px;
}

.app-logo {
    width: 32px;
    height: 32px;
    border-radius: 9999px;
    background: linear-gradient(135deg, #2563eb, #22c55e);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.app-name {
    font-size: 14px;
    font-weight: 600;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 8px;
}

.nav-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    margin: 8px 4px 2px;
}

.nav-item {
    display: block;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    color: #e5e7eb;
    text-decoration: none;
}

.nav-item:hover {
    background: #1f2937;
}

.nav-item.active {
    background: #2563eb;
    color: #fff;
}

/* Main area */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.page-title {
    font-size: 18px;
    margin: 0;
}

.main-content {
    padding: 16px;
}

/* Tabel dan card seperti sebelumnya */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table th, .table td {
    border-bottom: 1px solid #e5e7eb;
    padding: 6px 8px;
}

.table th {
    text-align: left;
    background: #f9fafb;
}

/* Responsive sidebar untuk HP */
@media (max-width: 768px) {
    .app-shell-wrapper {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
    }
    .main {
        flex: 1;
    }
}
.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.form-row .form-group.half {
    flex: 1 1 0;
}
/* =====================================================================
   POS – Layout utama
   ===================================================================== */
.pos-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    border: none;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
    border-radius: 10px;
    padding: 18px 20px;
    background: #ffffff;
}

.pos-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
}

.pos-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 2px;
}

.pos-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pos-branch-label {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
}

.pos-rx-queue-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

/* =====================================================================
   POS – Search
   ===================================================================== */
.pos-search-wrapper {
    position: relative;
}

.pos-search-input {
    border-radius: 999px;
    padding: 9px 16px;
    font-size: 14px;
    border: 1.5px solid #d1d5db;
    transition: border-color .15s, box-shadow .15s;
}

.pos-search-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
    outline: none;
}

.pos-search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .14);
    z-index: 200;
    max-height: 340px;
    overflow-y: auto;
}

.pos-search-empty {
    padding: 10px 14px;
    font-size: 13px;
    color: #6b7280;
}

.pos-search-item {
    padding: 8px 14px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background .1s;
}

.pos-search-item:last-child { border-bottom: none; }
.pos-search-item:hover { background: #f9fafb; }

.pos-search-item-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.pos-search-item-name {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
}

.pos-search-item-sub {
    font-size: 11px;
    color: #6b7280;
    margin-top: 1px;
}

.pos-search-item-stock {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

.pos-stock-ok   { background: #f0fdf4; color: #15803d; }
.pos-stock-low  { background: #fff7ed; color: #c2410c; }
.pos-stock-zero { background: #fef2f2; color: #b91c1c; }

.pos-search-units {
    margin-top: 5px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.pos-unit-chip {
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 11px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #111827;
    transition: background .15s, border-color .15s, color .15s;
    cursor: pointer;
}

.pos-unit-chip:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

/* =====================================================================
   POS – Body grid
   ===================================================================== */
.pos-body {
    display: grid;
    grid-template-columns: minmax(0, 2.5fr) 260px;
    gap: 16px;
    align-items: start;
}

/* =====================================================================
   POS – Cart
   ===================================================================== */
.pos-cart-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.pos-cart-title {
    font-size: 14px;
    font-weight: 600;
}

.pos-rx-active-label {
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pos-cart-table thead th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
    padding: 6px 8px;
    white-space: nowrap;
}

.pos-cart-table tbody td {
    vertical-align: middle;
    padding: 6px 8px;
    font-size: 13px;
}

.pos-cart-no { color: #9ca3af; font-size: 12px; }

.pos-cart-name {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
}

.pos-cart-sub {
    font-size: 11px;
    color: #6b7280;
    margin-top: 1px;
}

.pos-cart-unit  { font-size: 12px; color: #374151; }
.pos-cart-subtotal { font-size: 13px; font-weight: 600; white-space: nowrap; }

.pos-cart-qty,
.pos-cart-price {
    width: 80px;
    font-size: 13px;
    text-align: right;
}

.pos-cart-empty {
    text-align: center;
    padding: 24px 12px;
    font-size: 13px;
    color: #9ca3af;
    border: 2px dashed #e5e7eb;
    border-radius: 8px;
}

/* =====================================================================
   POS – Summary panel
   ===================================================================== */
.pos-summary-panel {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pos-summary-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #111827;
}

.pos-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #374151;
}

.pos-summary-divider {
    border-top: 1px dashed #d1d5db;
    margin: 4px 0;
}

.pos-summary-total {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

.pos-pay-btn {
    margin-top: 8px;
    width: 100%;
    font-weight: 600;
    border-radius: 999px;
    padding: 8px 0;
    font-size: 14px;
    box-shadow: 0 6px 14px rgba(37, 99, 235, .3);
    transition: box-shadow .15s, opacity .15s;
}

.pos-pay-btn:disabled {
    box-shadow: none;
    opacity: .6;
}

.pos-clear-btn {
    width: 100%;
    font-size: 12px;
    border-radius: 999px;
    padding: 5px 0;
    margin-top: 4px;
}

/* =====================================================================
   POS – Floating modal antrian resep
   ===================================================================== */
.pos-modal-backdrop {
    display: none;              /* default hidden */
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    align-items: center;
    justify-content: center;
    z-index: 1050;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.pos-modal-backdrop.is-open {
    display: flex;
    opacity: 1;
}

.pos-modal {
    width: 440px;
    max-height: 82vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pos-modal-backdrop.is-open .pos-modal {
    transform: translateY(0);
}

.pos-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.pos-modal-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #111827;
}

.pos-modal-badge {
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    min-width: 18px;
    text-align: center;
}

.pos-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 0 4px;
    transition: color .15s;
}

.pos-modal-close:hover { color: #111827; }

.pos-modal-search {
    padding: 8px 12px;
    border-bottom: 1px solid #f3f4f6;
}

.pos-modal-body {
    overflow-y: auto;
    flex: 1;
}

.pos-queue-empty {
    padding: 20px 14px;
    text-align: center;
    font-size: 13px;
    color: #9ca3af;
}

.pos-queue-row {
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background .1s;
}

.pos-queue-row:last-child { border-bottom: none; }
.pos-queue-row:hover { background: #f0f7ff; }

.pos-queue-row-main {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.pos-queue-no {
    font-size: 13px;
    font-weight: 700;
    color: #1d4ed8;
}

.pos-queue-patient {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
}

.pos-queue-row-meta {
    margin-top: 3px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 11px;
    color: #6b7280;
}

.pos-queue-chip {
    background: #eef2ff;
    color: #4338ca;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

/* =====================================================================
   Responsive: layar kecil (tablet/HP)
   ===================================================================== */
@media (max-width: 768px) {
    .pos-body {
        grid-template-columns: 1fr;
    }

    .pos-summary-panel {
        order: -1;
    }

    .pos-modal {
        width: 94vw;
    }
}
/* Centralized CSS for prescription module */
.rx-page .card { padding: 12px; }
.rx-toolbar { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-bottom:10px; }
.rx-toolbar h2 { margin:0; font-size:18px; line-height:1.2; }
.rx-toolbar-actions { display:flex; gap:8px; align-items:center; }
.rx-filterbar { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:10px; }
.rx-filterbar .form-control { min-height:34px; padding:6px 8px; }
.rx-filterbar .w-sm { width:160px; }
.rx-filterbar .w-md { width:200px; }
.rx-summary { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:10px; font-size:12px; color:#666; }
.rx-chip { display:inline-flex; align-items:center; gap:6px; padding:3px 8px; border:1px solid #ddd; border-radius:999px; background:#fafafa; }
.rx-table-wrap { overflow:auto; }
.rx-table { width:100%; border-collapse:collapse; font-size:13px; }
.rx-table thead th { background:#f8f8f8; color:#555; font-size:11px; text-transform:uppercase; letter-spacing:.02em; padding:8px 8px; border-bottom:1px solid #ddd; white-space:nowrap; }
.rx-table tbody td { padding:8px 8px; border-bottom:1px solid #eee; vertical-align:top; line-height:1.35; }
.rx-table tbody tr:hover { background:#fcfcfc; }
.rx-number { font-weight:600; color:#222; }
.rx-primary-text { font-weight:600; color:#222; }
.rx-secondary-text { font-size:12px; color:#777; }
.rx-status { display:inline-flex; align-items:center; padding:2px 8px; border-radius:999px; font-size:11px; font-weight:600; white-space:nowrap; }
.rx-status.valid { background:#e8f5e9; color:#2e7d32; }
.rx-status.pending { background:#fff8e1; color:#8d6e00; }
.rx-actions { display:flex; gap:6px; flex-wrap:wrap; }
.rx-actions .btn-linkish { display:inline-flex; align-items:center; justify-content:center; min-height:30px; padding:4px 8px; border:1px solid #ddd; border-radius:6px; background:#fff; text-decoration:none; font-size:12px; color:#333; }
.rx-actions .btn-linkish:hover { background:#f7f7f7; }
.rx-actions .btn-linkish.primary { border-color:#90caf9; background:#e8f4fd; color:#1565c0; }
.rx-actions .btn-linkish.success { border-color:#a5d6a7; background:#edf7ed; color:#2e7d32; }
.rx-actions .btn-linkish.warning { border-color:#ffcc80; background:#fff3e0; color:#ef6c00; }
.rx-pagination { display:flex; gap:6px; flex-wrap:wrap; margin-top:12px; }
.rx-pagination .page { display:inline-flex; min-width:32px; height:32px; align-items:center; justify-content:center; padding:0 10px; border:1px solid #ddd; border-radius:6px; text-decoration:none; background:#fff; color:#333; }
.rx-pagination .page.current { background:#1565c0; color:#fff; border-color:#1565c0; }
@media (max-width: 768px) {
  .rx-toolbar { align-items:flex-start; flex-direction:column; }
  .rx-toolbar-actions { width:100%; justify-content:flex-start; }
  .rx-filterbar .w-sm, .rx-filterbar .w-md { width:100%; }
  .rx-table { min-width:980px; }
}

/* ===== Search ===== */
.med-search-wrap { position:relative; }
.med-dropdown {
    position:absolute; top:100%; left:0; right:0; display:none;
    background:#fff; border:1px solid #ccc; max-height:220px;
    overflow-y:auto; z-index:999; border-radius:0 0 4px 4px;
    box-shadow:0 4px 12px rgba(0,0,0,.15);
}
.med-dropdown .med-item { padding:8px 12px; cursor:pointer; font-size:13px; border-bottom:1px solid #f0f0f0; }
.med-dropdown .med-item:hover,.med-dropdown .med-item.active { background:#e8f0fe; }

/* ===== Blok Racikan ===== */
.racikan-block {
    border:2px solid #ffc107; border-radius:8px;
    margin-bottom:16px; background:#fffdf0;
}
.racikan-block-header {
    background:#fff3cd; padding:10px 14px;
    display:flex; align-items:center; justify-content:space-between;
    border-radius:6px 6px 0 0;
}
.racikan-block-header .racikan-title {
    font-weight:700; font-size:14px; color:#856404;
}
.racikan-block-body { padding:12px 14px; }

/* Meta racikan (nama, qty, cara pakai) */
.racikan-meta { margin-bottom:12px; }
.racikan-meta .form-row { margin-bottom:0; }

/* Komponen tabel */
.komponen-table { width:100%; border-collapse:collapse; margin-bottom:8px; }
.komponen-table th {
    font-size:11px; text-transform:uppercase; color:#888;
    padding:4px 6px; border-bottom:1px solid #ddd; text-align:left;
}
.komponen-table td { padding:4px 6px; vertical-align:middle; }
.komponen-table tr:not(:last-child) td { border-bottom:1px solid #f0f0f0; }
.komponen-table .med-name-cell { font-size:13px; font-weight:500; min-width:160px; }
.komponen-table input[type=number], .komponen-table select {
    padding:4px 6px; font-size:13px; border:1px solid #ccc; border-radius:4px; width:100%;
}

/* Tombol tambah komponen */
.btn-add-komponen {
    font-size:12px; padding:4px 10px; border:1px dashed #ffc107;
    background:none; color:#856404; border-radius:4px; cursor:pointer;
}
.btn-add-komponen:hover { background:#fff3cd; }
.btn-remove-komponen {
    background:none; border:none; color:#dc3545; font-size:16px; cursor:pointer; padding:0 4px;
}
.btn-remove-racikan {
    background:none; border:none; color:#dc3545; font-size:13px;
    cursor:pointer; padding:2px 8px; border:1px solid #dc3545; border-radius:4px;
}
.btn-remove-racikan:hover { background:#fff0f0; }

/* ===== Blok Non-Racikan ===== */
.noncomp-block {
    border:1px solid #ddd; border-radius:8px;
    margin-bottom:16px; background:#fafafa;
}
.noncomp-block-header {
    background:#f5f5f5; padding:8px 14px;
    display:flex; align-items:center; justify-content:space-between;
    border-radius:6px 6px 0 0;
}
.noncomp-block-header .noncomp-title { font-weight:600; font-size:13px; color:#333; }
.noncomp-block-body { padding:12px 14px; }
.noncomp-block-body .form-row { margin-bottom:6px; }
.btn-remove-noncomp {
    background:none; border:none; color:#dc3545; font-size:16px; cursor:pointer; padding:0 4px;
}

/* Tombol tambah racikan / non-racikan */
.btn-add-racikan {
    padding:7px 16px; background:#fff3cd; border:1px solid #ffc107;
    color:#856404; border-radius:6px; font-size:13px; cursor:pointer; font-weight:600;
}
.btn-add-racikan:hover { background:#ffe69c; }
.btn-add-noncomp-main {
    padding:7px 16px; background:#e8f4fd; border:1px solid #90caf9;
    color:#1565c0; border-radius:6px; font-size:13px; cursor:pointer; font-weight:600;
}
.btn-add-noncomp-main:hover { background:#d1eaf8; }

.section-divider {
    display:flex; align-items:center; gap:10px; margin:18px 0 12px;
    font-size:13px; font-weight:600; color:#666;
}
.section-divider::after {
    content:''; flex:1; height:1px; background:#ddd;
}

/* Checklist */
.checklist-card { font-size:13px; }
.checklist-card .chk-group { margin-bottom:10px; }
.checklist-card .chk-group strong { display:block; margin-bottom:4px; color:#444; }
.checklist-card label { display:flex; align-items:flex-start; gap:6px; cursor:pointer; margin-bottom:3px; line-height:1.4; }
.checklist-card label input[type=checkbox] { margin-top:2px; flex-shrink:0; }
.compact-checklist .chk-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px 14px; }
.compact-checklist .chk-group { margin-bottom:0; }
.compact-checklist .chk-group strong { font-size:12px; margin-bottom:4px; }
.compact-checklist label { font-size:12px; margin-bottom:2px; line-height:1.25; }
.form-row { gap:8px !important; }
.form-group { margin-bottom:8px !important; }
.form-control { padding:6px 8px !important; min-height:34px; }
textarea.form-control { min-height:72px; }
.racikan-block, .noncomp-block { margin-bottom:10px; }
.racikan-block-header, .noncomp-block-header { padding:7px 10px; }
.racikan-block-body, .noncomp-block-body { padding:8px 10px; }
.racikan-meta { margin-bottom:8px; }
.komponen-table th { padding:3px 5px; font-size:10px; }
.komponen-table td { padding:3px 5px; }
.komponen-table .med-name-cell { font-size:12px; }
.section-divider { margin:10px 0 8px; }
@media (max-width: 1200px){ .compact-checklist .chk-grid{ grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width: 768px){ .compact-checklist .chk-grid{ grid-template-columns:1fr; } }

/* Search context */
.search-context {
    display:inline-flex; gap:8px; align-items:center;
    padding:6px 10px; background:#f0f4ff; border-radius:6px;
    font-size:12px; color:#444; margin-top:6px;
}
.search-context select { font-size:12px; border:1px solid #ccc; border-radius:4px; padding:2px 6px; }
