/* ==========================================================================
   ANTREAN LIVE POLIKLINIK RAWAT JALAN - RS ISLAM WONOSOBO
   Extracted from app/Views/frontend/antrean/index.php (Stage 3.4D.3)
   ========================================================================== */

/* ==========================================================================
     ANTREAN LIVE POLIKLINIK RAWAT JALAN - RS ISLAM WONOSOBO
     Design System: Clinical Desk Healthcare UI / Anti-AI-Slop
     WCAG 2.1 AA Compliant & Mobile-First
     ========================================================================== */

  .antrean-page {
    background-color: #F8FAFC;
    min-height: calc(100vh - 160px);
    padding: 28px 0 64px;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    color: #0F172A;
  }

  /* 1. Header Informasi */
  .antrean-top-header {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  @media (min-width: 768px) {
    .antrean-top-header {
      flex-direction: row;
      align-items: center;
      justify-content: space-between;
    }
  }

  .antrean-top-title h1 {
    font-size: 1.45rem;
    font-weight: 800;
    color: #0F172A;
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.25;
  }

  .antrean-top-title p {
    font-size: 0.85rem;
    color: #64748B;
    margin: 4px 0 0;
  }

  .antrean-top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }

  .badge-live-sync {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 0.775rem;
    color: #475569;
    font-variant-numeric: tabular-nums;
  }

  .dot-pulse-green {
    width: 8px;
    height: 8px;
    background: #16A34A;
    border-radius: 50%;
  }

  .btn-tv-mode {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #062317;
    color: #FFFFFF;
    border: 1px solid #062317;
    border-radius: 8px;
    padding: 7px 16px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
  }

  .btn-tv-mode:hover {
    background: #0B3825;
    color: #FFFFFF;
    border-color: #0B3825;
  }

  .btn-refresh-clean {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .btn-refresh-clean:hover {
    background: #F1F5F9;
    color: #0F172A;
  }

  /* 2. Search & Filter Bar */
  .antrean-search-bar {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  @media (min-width: 768px) {
    .antrean-search-bar {
      flex-direction: row;
      align-items: center;
      justify-content: space-between;
    }
  }

  .search-input-box {
    position: relative;
    flex: 1;
    max-width: 380px;
  }

  .search-input-box input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    font-size: 0.85rem;
    background: #F8FAFC;
    transition: all 0.15s ease;
  }

  .search-input-box input:focus {
    outline: none;
    border-color: #10B981;
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
  }

  .search-input-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94A3B8;
    font-size: 0.85rem;
    pointer-events: none;
  }

  .filter-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
  }

  .filter-pill-btn {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.775rem;
    font-weight: 700;
    color: #64748B;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .filter-pill-btn:hover {
    background: #F1F5F9;
    color: #0F172A;
  }

  .filter-pill-btn.active {
    background: #0F5132;
    border-color: #0F5132;
    color: #FFFFFF;
  }

  /* 3. Grid Clinical Desk Cards (Opsi 1) */
  .grid-desk {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 16px;
  }

  @media (min-width: 640px) {
    .grid-desk { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }

  @media (min-width: 1024px) {
    .grid-desk { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  }

  @media (min-width: 1280px) {
    .grid-desk { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  }

  /* Clinical Desk Card */
  .card-desk {
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
  }

  .card-desk:hover {
    border-color: #94A3B8;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  }

  .card-desk--open {
    border-top: 3px solid #16A34A;
  }

  .card-desk--closed {
    border-top: 3px solid #94A3B8;
    background: #FAFAFA;
    opacity: 0.78;
  }

  .card-desk-head {
    padding: 12px 14px 10px;
    border-bottom: 1px solid #F1F5F9;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .card-desk-loc {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748B;
    letter-spacing: 0.04em;
  }

  .badge-desk-status {
    font-size: 0.675rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.02em;
  }

  .badge-desk-status--open {
    background: #DCFCE7;
    color: #166534;
    border: 1px solid #BBF7D0;
  }

  .badge-desk-status--closed {
    background: #F1F5F9;
    color: #64748B;
    border: 1px solid #E2E8F0;
  }

  .card-desk-body {
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .desk-info-group {
    flex: 1;
    min-width: 0;
  }

  .desk-poli-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0F172A;
    margin: 0 0 4px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .desk-doctor-name {
    font-size: 0.775rem;
    color: #475569;
    margin: 0;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .desk-queue-box {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    text-align: center;
    min-width: 90px;
    flex-shrink: 0;
  }

  .card-desk--open .desk-queue-box {
    background: #064E3B;
    border-color: #064E3B;
    color: #FFFFFF;
  }

  .desk-queue-label {
    display: block;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #94A3B8;
  }

  .card-desk--open .desk-queue-label {
    color: #A7F3D0;
  }

  .desk-queue-num {
    display: block;
    font-size: 2.15rem;
    font-weight: 900;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
    color: #0F172A;
  }

  .card-desk--open .desk-queue-num {
    color: #FFFFFF;
  }

  .card-desk-foot {
    background: #F8FAFC;
    padding: 8px 14px;
    border-top: 1px solid #F1F5F9;
    font-size: 0.725rem;
    color: #64748B;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .card-desk-foot strong {
    color: #0F172A;
  }

  /* Empty State */
  .antrean-empty-box {
    grid-column: 1 / -1;
    background: #FFFFFF;
    border: 1px dashed #CBD5E1;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    color: #64748B;
  }

  /* Mode TV Fullscreen Customization */
  body.tv-mode-active {
    background-color: #03140C !important;
    overflow-y: auto !important;
  }

  body.tv-mode-active .main-header,
  body.tv-mode-active .rsi-master-footer,
  body.tv-mode-active nav.fixed-bottom,
  body.tv-mode-active #accessWidget,
  body.tv-mode-active .floating-social-share,
  body.tv-mode-active #btnScrollTop,
  body.tv-mode-active .whatsapp-float,
  body.tv-mode-active .social-share-container {
    display: none !important;
  }

  body.tv-mode-active .antrean-page {
    background-color: #03140C !important;
    padding: 16px 20px 32px !important;
    min-height: 100vh !important;
  }

  .tv-navbar-top {
    display: none;
    background: #062317;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 14px 20px;
    margin-bottom: 20px;
    align-items: center;
    justify-content: space-between;
    color: #FFFFFF;
  }

  body.tv-mode-active .tv-navbar-top {
    display: flex;
  }

  body.tv-mode-active .antrean-top-header {
    display: none;
  }

  body.tv-mode-active .antrean-search-bar {
    display: none;
  }

  body.tv-mode-active .grid-desk {
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)) !important;
    gap: 16px;
  }

  .btn-exit-tv {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .btn-exit-tv:hover {
    background: #DC2626;
    border-color: #DC2626;
  }
