/* Full-size professional medical layout */

:root{
  --ahms-primary:#0ea5a2;
  --ahms-primary-soft:rgba(14,165,162,0.12);
  --ahms-text:#0f172a;
  --ahms-text-muted:#4b5563;
  --ahms-surface:#f9fbfb;
  --ahms-surface-alt:#ffffff;
  --ahms-sidebar-bg:#0b1f24;
  --ahms-sidebar-card:#102932;
  --ahms-sidebar-border:rgba(255,255,255,0.05);
  --ahms-border:#e2e8f0;
  --ahms-shadow:0 12px 34px rgba(15, 23, 42, 0.14);
}

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

html,body{
  height:100%;
  margin:0;
  padding:0;
}

body.app-body{
  min-height:100vh;
  font-family:"Avenir Next","Segoe UI","Helvetica Neue",Arial,sans-serif;
  background:linear-gradient(160deg,#ecfdfd 0%,#f4fbfb 50%,#ffffff 100%);
  color:var(--ahms-text);
}

body.app-body h1,
body.app-body h2,
body.app-body h3,
body.app-body h4{
  font-family: "Georgia","Times New Roman",serif;
  letter-spacing:-0.02em;
}

.report-container{
  width:100%;
  max-width:100%;
  margin:0 auto;
  padding:2rem clamp(1rem,3vw,2.5rem);
}
/* Medical body chart */
.medical-body-chart{
  border:1px solid rgba(14,165,162,0.25);
  border-radius:1.25rem;
  padding:1.25rem;
  background:rgba(255,255,255,0.75);
  backdrop-filter:blur(6px);
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:420px;
}
.medical-body-chart__image{
  display:block;
  width:100%;
  height:90%;
  max-height:90%;
  object-fit:contain;
}

/* APP SHELL */
.app-shell{
  width:100%;
}

.app-sidebar{
  width:280px;
  background:var(--ahms-sidebar-bg);
  color:#ffffff;
  padding:1.5rem 1.25rem;
  border-right:1px solid rgba(255,255,255,0.08);
  overflow-y:auto;
  position:relative;
}

.app-sidebar::-webkit-scrollbar{
  width:6px;
}
.app-sidebar::-webkit-scrollbar-thumb{
  background:rgba(255,255,255,0.12);
  border-radius:999px;
}

.sidebar-shell{
  min-height:100%;
}

.app-sidebar small,
.app-sidebar span,
.app-sidebar p{
  color:rgba(255,255,255,0.8);
}

.app-sidebar .nav{
  gap:.25rem;
  padding-top:1rem;
}

.app-sidebar .nav-item{
  list-style:none;
}

.app-sidebar .nav-link{
  color:rgba(255,255,255,0.88);
  padding:.65rem .85rem;
  border-radius:.75rem;
  transition:background .2s ease, color .2s ease, transform .2s ease;
}

.app-sidebar .nav-link:hover{
  background:rgba(255,255,255,0.08);
  color:#fff;
  transform:translateX(2px);
}

.app-sidebar .nav-link.active{
  background:rgba(14,165,162,0.25);
  color:#ffffff;
}

.sidebar-footer{
  background:transparent;
}
.sidebar-footer small,
.sidebar-footer span{
  color:rgba(255,255,255,0.7);
}
.sidebar-footer .dropdown-menu{
  border-radius:1rem;
}
.sidebar-footer .dropdown-menu-dark{
  background:rgba(15,30,38,0.96);
  border:1px solid rgba(255,255,255,0.05);
}
.sidebar-footer .dropdown-item{
  border-radius:.75rem;
}
.sidebar-footer .dropdown-item:hover{
  background:rgba(255,255,255,0.08);
}
.sidebar-footer .dropdown-divider{
  border-color:rgba(255,255,255,0.1);
}
.app-sidebar .card{
  background:rgba(255,255,255,0.08);
  color:#ffffff;
  border-radius:1rem;
  box-shadow:none;
}
.app-sidebar .card p,
.app-sidebar .card h6{
  color:#ffffff;
}
.app-sidebar .card .btn{
  border-radius:.75rem;
}

/* MAIN */
.app-main{
  background:var(--ahms-surface);
  padding:2rem clamp(1.5rem,3vw,3rem);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.6);
}

.app-main__header{
  padding-bottom:1.5rem;
  gap:1rem;
}
.app-main__header{
  padding-bottom:1.5rem;
  gap:1rem;
}
.nav-menu-toggle{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:42px;
  height:42px;
  border-radius:999px;
  background:transparent;
  color:var(--ahms-text);
  border:none;
  text-decoration:none;
  transition:background .2s ease, transform .2s ease;
}
.nav-menu-toggle:hover,
.nav-menu-toggle:focus{
  background:rgba(14,165,162,0.12);
  transform:translateY(-1px);
  color:var(--ahms-text);
}
.nav-menu-toggle i{
  font-size:1.25rem;
}
@media (min-width:768px){
  .nav-menu-toggle{display:none!important;}
}

.app-main__title h1{
  font-weight:600;
  color:var(--ahms-text);
}

.app-main__content{
  background:var(--ahms-surface-alt);
  padding:2.25rem;
  border-radius:1.25rem;
  box-shadow:var(--ahms-shadow);
  overflow:auto;
}

.app-main__content > .alert:first-child{
  margin-top:0;
}

.app-footer{
  color:var(--ahms-text-muted);
}

/* BREADCRUMB */
.breadcrumb{
  --bs-breadcrumb-divider:'›';
  font-size:.85rem;
}
.breadcrumb-item + .breadcrumb-item::before{
  color:var(--ahms-text-muted);
}

/* ALERTS */
.alert{
  border-radius:.75rem;
  border:none;
  box-shadow:0 12px 30px rgba(15,23,42,0.12);
}

/* GLOBAL CARDS */
body.app-body .app-main .card{
  border-radius:1.25rem;
  border:1px solid rgba(15,23,42,0.08);
  box-shadow:0 10px 30px rgba(15,23,42,0.08);
}
body.app-body .app-main .card-header{
  background:transparent;
  border-bottom:1px solid rgba(15,23,42,0.06);
}
body.app-body .app-main .card-body{
  padding:1.5rem;
}

/* KPI CARDS */
.card.kpi{
  border:none;
  border-radius:1rem;
  background:#fff;
  box-shadow:var(--ahms-shadow);
}
.card.kpi .card-body{
  padding:1.25rem 1.5rem;
}
.card.kpi i{
  color:var(--ahms-primary);
}

/* OFFCANVAS */
.offcanvas{
  width:280px;
  background:var(--ahms-sidebar-bg);
  color:#fff;
}
.offcanvas .offcanvas-header{
  background:rgba(255,255,255,0.04);
}
.offcanvas .btn-close{
  filter:invert(1) grayscale(1);
}
.offcanvas .nav-link{
  color:rgba(255,255,255,0.88);
}
.offcanvas .nav-link.active{
  background:rgba(14,165,162,0.25);
  color:#fff;
}

/* RESPONSIVE */
@media (max-width:991.98px){
  .app-main{
    padding:1.5rem 1.25rem;
  }
  .app-main__content{
    padding:1.5rem;
  }
}

@media (max-width:767.98px){
  .app-shell{
    flex-direction:column;
  }
  .app-main{
    padding:1.25rem 1rem 2rem;
  }
  .app-main__content{
    padding:1.25rem;
  }
}

.admission-document-viewer{
  height:72vh;
}

#admissionDocumentViewFrame{
  width:100%;
  height:100%;
  border:0;
}

.announcement-body img{
  max-width:100%;
  height:auto;
}

/* LINE Flex message preview (admin viewer) */
.line-flex-preview{
  max-width:520px;
}
.line-flex-bubble{
  border:1px solid rgba(0,0,0,.125);
  border-radius:12px;
  overflow:hidden;
  background:#fff;
}
.line-flex-bubble-section{
  padding:12px 14px;
}
.line-flex-bubble-header{
  background:rgba(0,0,0,.02);
  border-bottom:1px solid rgba(0,0,0,.06);
}
.line-flex-bubble-footer{
  background:rgba(0,0,0,.02);
  border-top:1px solid rgba(0,0,0,.06);
}
.line-flex-box{
  display:flex;
  gap:8px;
}
.line-flex-box-vertical{
  flex-direction:column;
}
.line-flex-box-horizontal,
.line-flex-box-baseline{
  flex-direction:row;
  align-items:baseline;
}
.line-flex-text{
  color:#111;
  line-height:1.25;
}
.line-flex-text-wrap{
  white-space:pre-wrap;
  word-break:break-word;
}
.line-flex-text-bold{
  font-weight:700;
}
.line-flex-text-sm{ font-size:.875rem; }
.line-flex-text-md{ font-size:1rem; }
.line-flex-text-lg{ font-size:1.125rem; }
.line-flex-text-xl{ font-size:1.25rem; }
.line-flex-text-align-center{ text-align:center; }
.line-flex-text-align-end{ text-align:end; }
.line-flex-image{
  max-width:100%;
  height:auto;
  border-radius:8px;
}
.line-flex-separator{
  margin:10px 0;
  border:0;
  border-top:1px solid rgba(0,0,0,.08);
}

@media (max-width:576px){
  .admission-document-viewer{
    height:60vh;
  }
}

.owner-dashboard {
  --ink: #0f172a;
  --muted: #64748b;
  --accent: #0f766e;
  --accent-soft: rgba(15, 118, 110, 0.12);
  --cloud: #f8fafc;
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
}
.owner-dashboard h1,
.owner-dashboard h2,
.owner-dashboard h3 {
  font-family: "Georgia", "Times New Roman", serif;
  letter-spacing: -0.02em;
}
.owner-hero {
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.15), rgba(96, 165, 250, 0.15) 45%, rgba(252, 211, 77, 0.2));
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 24px;
  padding: 32px;
  position: relative;
  overflow: hidden;
}
.owner-hero::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -90px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.18) 0%, rgba(15, 118, 110, 0) 70%);
  pointer-events: none;
}
.owner-kpi {
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  background: #fff;
  position: relative;
  overflow: hidden;
}
.owner-kpi .card-body {
  padding: 24px;
}
.owner-kpi::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 4px solid rgba(15, 118, 110, 0.35);
  pointer-events: none;
}
.owner-kpi[data-kpi="branches"]::before { border-top-color: rgba(15, 118, 110, 0.45); }
.owner-kpi[data-kpi="patients"]::before { border-top-color: rgba(56, 189, 248, 0.5); }
.owner-kpi[data-kpi="admissions"]::before { border-top-color: rgba(99, 102, 241, 0.5); }
.owner-kpi[data-kpi="alerts"]::before { border-top-color: rgba(249, 115, 22, 0.6); }
.owner-kpi[data-kpi="alertsAck"]::before { border-top-color: rgba(16, 185, 129, 0.55); }
.owner-kpi[data-kpi="finance"]::before { border-top-color: rgba(234, 179, 8, 0.55); }
.owner-kpi .kpi-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  color: var(--muted);
}
.owner-kpi .kpi-value {
  font-size: 2.2rem;
  font-weight: 700;
}
.owner-kpi .kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.2rem;
}
.owner-kpi[data-kpi="patients"] .kpi-icon { background: rgba(56, 189, 248, 0.2); color: #0284c7; }
.owner-kpi[data-kpi="admissions"] .kpi-icon { background: rgba(99, 102, 241, 0.2); color: #4338ca; }
.owner-kpi[data-kpi="alerts"] .kpi-icon { background: rgba(249, 115, 22, 0.2); color: #ea580c; }
.owner-kpi[data-kpi="alertsAck"] .kpi-icon { background: rgba(16, 185, 129, 0.2); color: #059669; }
.owner-kpi[data-kpi="finance"] .kpi-icon { background: rgba(234, 179, 8, 0.2); color: #b45309; }
.owner-panel {
  border-radius: 22px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: var(--cloud);
  padding: 24px;
  height: 100%;
}
.owner-dashboard .row {
  --bs-gutter-x: 1.75rem;
  --bs-gutter-y: 1.75rem;
}
.owner-panel h3 {
  font-size: 1.2rem;
  margin-bottom: 12px;
}
.owner-table thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.owner-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.75rem;
}
