:root{
  --navy:#0e2a43;
  --navy-800:#0b2236;
  --navy-700:#173d5c;
  --navy-600:#1d4d70;
  --sky:#2aa5e0;
  --sky-deep:#0e7fb8;
  --sun:#f9b81f;
  --coral:#fb6f6f;
  --coral-deep:#ef4d63;
  --emerald:#18b184;
  --cream:#fbf6ee;
  --paper:#ffffff;
  --ink:#12283a;
  --muted:#6b7f92;
  --line:#e7ded1;
  --line-soft:#eef2f6;
  --shadow-sm:0 1px 2px rgba(14,42,67,.06),0 1px 3px rgba(14,42,67,.08);
  --shadow-md:0 10px 30px rgba(14,42,67,.10);
  --shadow-lg:0 24px 60px rgba(14,42,67,.16);
  --radius:16px;
  --radius-sm:11px;
  --sidebar-w:264px;
  --font-display:"Fraunces",Georgia,serif;
  --font-body:"Plus Jakarta Sans",system-ui,sans-serif;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:var(--font-body);
  color:var(--ink);
  background:var(--cream);
  font-size:14.5px;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
}
::selection{background:var(--sun);color:var(--navy)}
a{color:var(--sky-deep);text-decoration:none}
h1,h2,h3,h4{font-family:var(--font-display);font-weight:600;letter-spacing:-.01em;margin:0}
button{font-family:inherit}
input,select,textarea{font-family:inherit}
.hidden{display:none !important}
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  border:1px solid transparent;border-radius:999px;
  padding:10px 18px;font-weight:700;font-size:13.5px;cursor:pointer;
  transition:transform .18s ease,background-color .18s ease,box-shadow .18s ease,color .18s ease;
  white-space:nowrap;
}
.btn:active{transform:translateY(1px)}
.btn i,.btn svg{width:16px;height:16px}
.btn-primary{background:var(--sky-deep);color:#fff;box-shadow:0 8px 20px rgba(14,127,184,.28)}
.btn-primary:hover{background:#0b6ea0;transform:translateY(-1px)}
.btn-coral{background:var(--coral-deep);color:#fff;box-shadow:0 8px 20px rgba(239,77,99,.28)}
.btn-coral:hover{transform:translateY(-1px)}
.btn-ghost{background:#fff;border-color:var(--line);color:var(--ink)}
.btn-ghost:hover{border-color:var(--sky);color:var(--sky-deep)}
.btn-subtle{background:var(--line-soft);color:var(--ink)}
.btn-subtle:hover{background:#e3e9ef}
.btn-danger{background:#fff;border-color:#f4c6c6;color:var(--coral-deep)}
.btn-danger:hover{background:#fff2f2}
.btn-sm{padding:7px 13px;font-size:12.5px}
.btn-icon{padding:8px;border-radius:10px}
.btn:disabled{opacity:.55;cursor:not-allowed;transform:none}
.auth-wrap{min-height:100vh;display:grid;grid-template-columns:1.05fr .95fr}
.auth-brand{
  background:radial-gradient(1200px 500px at -10% -10%,rgba(42,165,224,.25),transparent 60%),
             radial-gradient(900px 500px at 110% 110%,rgba(251,111,111,.22),transparent 55%),
             var(--navy);
  color:#fff;padding:56px;display:flex;flex-direction:column;justify-content:space-between;position:relative;overflow:hidden;
}
.auth-tagline{position:absolute;bottom:26px;left:56px;right:56px;font-family:var(--font-display);font-size:15px;color:rgba(255,255,255,.5)}
.auth-blob{position:absolute;border-radius:50%;filter:blur(60px);opacity:.5}
.auth-brand h1{font-size:44px;line-height:1.05;margin:0 0 14px}
.auth-brand .accent{color:var(--sun)}
.auth-brand p{color:rgba(255,255,255,.8);max-width:420px;font-size:15px}
.auth-badge{display:inline-flex;align-items:center;gap:8px;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.18);padding:7px 14px;border-radius:999px;font-size:12px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--sun)}
.auth-form-side{display:flex;align-items:center;justify-content:center;padding:40px;background:var(--cream)}
.auth-card{background:#fff;border-radius:24px;box-shadow:var(--shadow-lg);padding:40px;width:100%;max-width:410px;border:1px solid var(--line)}
.auth-card h2{font-size:26px;margin-bottom:4px}
.auth-card .sub{color:var(--muted);margin-bottom:26px;font-size:13.5px}
.field{margin-bottom:16px}
.field label{display:block;font-weight:700;font-size:12.5px;margin-bottom:6px;color:var(--navy-700)}
.field .req{color:var(--coral-deep)}
.input,.select,.textarea{
  width:100%;padding:11px 13px;border:1.5px solid var(--line);border-radius:11px;background:#fff;
  font-size:14px;color:var(--ink);transition:border-color .16s,box-shadow .16s;outline:none;
}
.input:focus,.select:focus,.textarea:focus{border-color:var(--sky);box-shadow:0 0 0 3px rgba(42,165,224,.15)}
.textarea{min-height:78px;resize:vertical}
.form-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}
.form-grid .full{grid-column:1/-1}
.err-text{color:var(--coral-deep);font-size:12.5px;margin-top:12px;min-height:16px}
.app-shell{display:flex;min-height:100vh}
.sidebar{
  width:var(--sidebar-w);flex-shrink:0;background:var(--navy);color:#cdd9e4;
  display:flex;flex-direction:column;position:fixed;inset:0 auto 0 0;height:100vh;z-index:40;
  border-right:1px solid rgba(255,255,255,.06);
}
.brand{display:flex;align-items:center;gap:12px;padding:20px 20px 16px}
.brand-mark{width:42px;height:42px;border-radius:13px;background:linear-gradient(140deg,var(--sun),var(--coral));display:grid;place-items:center;font-family:var(--font-display);font-weight:700;color:var(--navy);font-size:19px;box-shadow:0 6px 16px rgba(0,0,0,.25);flex-shrink:0}
.brand-name{font-family:var(--font-display);color:#fff;font-size:16px;font-weight:600;line-height:1.1}
.brand-sub{font-size:11px;color:rgba(255,255,255,.5);letter-spacing:.05em}
.nav{flex:1;overflow-y:auto;padding:8px 12px 20px}
.nav::-webkit-scrollbar{width:6px}.nav::-webkit-scrollbar-thumb{background:rgba(255,255,255,.12);border-radius:6px}
.nav-group{font-size:10.5px;text-transform:uppercase;letter-spacing:.14em;color:rgba(255,255,255,.35);margin:16px 12px 6px;font-weight:700}
.nav-item{display:flex;align-items:center;gap:12px;padding:10px 13px;border-radius:11px;color:#c3d0dc;font-weight:600;font-size:13.5px;cursor:pointer;transition:background .16s,color .16s;margin-bottom:2px}
.nav-item i,.nav-item svg{width:18px;height:18px;opacity:.85}
.nav-item:hover{background:rgba(255,255,255,.06);color:#fff}
.nav-item.active{background:linear-gradient(90deg,rgba(42,165,224,.22),rgba(42,165,224,.05));color:#fff;box-shadow:inset 3px 0 0 var(--sun)}
.nav-item.active i,.nav-item.active svg{opacity:1;color:var(--sun)}
.main{flex:1;margin-left:var(--sidebar-w);display:flex;flex-direction:column;min-width:0}
.topbar{
  position:sticky;top:0;z-index:30;background:rgba(251,246,238,.85);backdrop-filter:blur(12px);
  border-bottom:1px solid var(--line);padding:14px 28px;display:flex;align-items:center;gap:16px;
}
.topbar .page-title{font-size:20px}
.topbar .page-sub{font-size:12.5px;color:var(--muted)}
.topbar-spacer{flex:1}
.year-pill{display:inline-flex;align-items:center;gap:7px;background:var(--sun);color:var(--navy);font-weight:800;font-size:12px;padding:7px 13px;border-radius:999px}
.usermenu{display:flex;align-items:center;gap:10px;cursor:pointer;padding:5px;border-radius:999px;transition:background .16s;position:relative}
.usermenu:hover{background:#fff}
.avatar{width:38px;height:38px;border-radius:50%;background:linear-gradient(140deg,var(--sky),var(--navy-600));color:#fff;display:grid;place-items:center;font-weight:800;font-size:14px}
.usermenu .u-name{font-weight:700;font-size:13px;line-height:1.1}
.usermenu .u-role{font-size:11px;color:var(--muted)}
.dropdown{position:absolute;top:52px;right:0;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow-lg);min-width:190px;padding:6px;z-index:50}
.dropdown button{display:flex;align-items:center;gap:10px;width:100%;text-align:left;background:none;border:none;padding:10px 12px;border-radius:9px;font-weight:600;font-size:13px;color:var(--ink);cursor:pointer}
.dropdown button:hover{background:var(--line-soft)}
.dropdown button i{width:16px;height:16px}
.dropdown .danger{color:var(--coral-deep)}
.content{padding:26px 28px 60px;max-width:1400px;width:100%}
.card{background:var(--paper);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow-sm)}
.card-pad{padding:20px}
.card-head{display:flex;align-items:center;gap:12px;padding:16px 20px;border-bottom:1px solid var(--line-soft)}
.card-head h3{font-size:16px}
.card-head .sub{font-size:12px;color:var(--muted)}
.stat-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:22px}
.stat{background:var(--paper);border:1px solid var(--line);border-radius:var(--radius);padding:18px;position:relative;overflow:hidden;transition:transform .18s,box-shadow .18s}
.stat:hover{transform:translateY(-3px);box-shadow:var(--shadow-md)}
.stat .ic{width:44px;height:44px;border-radius:13px;display:grid;place-items:center;margin-bottom:14px}
.stat .ic i,.stat .ic svg{width:22px;height:22px}
.stat .label{font-size:12.5px;color:var(--muted);font-weight:600}
.stat .value{font-family:var(--font-display);font-size:27px;font-weight:600;margin-top:2px;letter-spacing:-.02em}
.ic-sky{background:rgba(42,165,224,.14);color:var(--sky-deep)}
.ic-coral{background:rgba(251,111,111,.16);color:var(--coral-deep)}
.ic-sun{background:rgba(249,184,31,.18);color:#b6820a}
.ic-emerald{background:rgba(24,177,132,.14);color:#0f7a5c}
.ic-navy{background:rgba(14,42,67,.10);color:var(--navy)}
.grid-2{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:18px}
.grid-2 > *{  min-width:0;}
.grid-2b{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.toolbar{display:flex;align-items:center;gap:12px;margin-bottom:16px;flex-wrap:wrap}
.toolbar .grow{flex:1}
.search-box{position:relative;display:flex;align-items:center;min-width:240px}
.search-box i,.search-box svg{position:absolute;left:12px;color:var(--muted);width:16px;height:16px}
.search-box input{padding-left:36px}
.table-wrap{overflow-x:auto;border-radius:var(--radius);border:1px solid var(--line);background:#fff}
table.data{width:100%;border-collapse:collapse;font-size:13.5px}
table.data th{
  text-align:left;padding:13px 16px;background:#faf6f0;color:var(--navy-700);font-weight:700;
  font-size:11.5px;text-transform:uppercase;letter-spacing:.06em;border-bottom:1px solid var(--line);white-space:nowrap;
}
table.data td{padding:13px 16px;border-bottom:1px solid var(--line-soft);vertical-align:middle}
table.data tbody tr{transition:background .12s}
table.data tbody tr:hover{background:#fcfaf6}
table.data tbody tr:last-child td{border-bottom:none}
.row-actions{display:flex;gap:6px;justify-content:flex-end}
.cell-main{font-weight:700;color:var(--ink)}
.cell-sub{font-size:12px;color:var(--muted)}
.avatar-sm{width:34px;height:34px;border-radius:10px;background:linear-gradient(140deg,var(--sky),var(--navy-600));color:#fff;display:grid;place-items:center;font-weight:800;font-size:12.5px;flex-shrink:0}
.name-cell{display:flex;align-items:center;gap:11px}
.badge{display:inline-flex;align-items:center;gap:5px;padding:4px 10px;border-radius:999px;font-size:11.5px;font-weight:700;letter-spacing:.01em}
.b-active{background:rgba(24,177,132,.14);color:#0f7a5c}
.b-inactive{background:#eceff2;color:#64748b}
.b-transferred{background:rgba(42,165,224,.14);color:var(--sky-deep)}
.b-withdrawn{background:rgba(251,111,111,.16);color:var(--coral-deep)}
.b-graduated{background:rgba(249,184,31,.2);color:#b6820a}
.chip{display:inline-flex;align-items:center;gap:5px;padding:3px 9px;border-radius:8px;background:var(--line-soft);font-size:11.5px;font-weight:600;color:var(--navy-700);margin:2px 3px 2px 0}
.modal-back{position:fixed;inset:0;background:rgba(14,42,67,.42);backdrop-filter:blur(4px);z-index:80;display:flex;align-items:flex-start;justify-content:center;padding:40px 16px;overflow-y:auto;animation:fade .18s ease}
.modal{background:#fff;border-radius:20px;box-shadow:var(--shadow-lg);width:100%;max-width:640px;animation:pop .2s ease;margin:auto}
.modal.lg{max-width:840px}
.modal.sm{max-width:440px}
.modal-head{display:flex;align-items:center;justify-content:space-between;padding:20px 24px;border-bottom:1px solid var(--line-soft)}
.modal-head h3{font-size:19px}
.modal-body{padding:22px 24px;max-height:66vh;overflow-y:auto}
.modal-foot{display:flex;justify-content:flex-end;gap:10px;padding:16px 24px;border-top:1px solid var(--line-soft);background:#fdfbf7;border-radius:0 0 20px 20px}
.x-btn{background:none;border:none;cursor:pointer;color:var(--muted);padding:6px;border-radius:8px;display:grid;place-items:center}
.x-btn:hover{background:var(--line-soft);color:var(--ink)}
.section-label{font-size:11px;text-transform:uppercase;letter-spacing:.1em;color:var(--muted);font-weight:800;margin:18px 0 10px}
.section-label:first-child{margin-top:0}
.toast-wrap{position:fixed;bottom:24px;right:24px;z-index:120;display:flex;flex-direction:column;gap:10px}
.toast{display:flex;align-items:center;gap:11px;background:var(--navy);color:#fff;padding:13px 17px;border-radius:13px;box-shadow:var(--shadow-lg);font-weight:600;font-size:13.5px;min-width:250px;animation:slidein .22s ease}
.toast.ok{background:#0f7a5c}
.toast.err{background:var(--coral-deep)}
.toast i{width:18px;height:18px}
.empty{text-align:center;padding:54px 20px;color:var(--muted)}
.empty i{width:40px;height:40px;color:var(--line);margin-bottom:12px}
.empty h4{font-size:16px;color:var(--navy-700);margin-bottom:4px}
.pagination{display:flex;align-items:center;justify-content:space-between;margin-top:16px;font-size:13px;color:var(--muted)}
.pagination .pages{display:flex;gap:6px}
.spinner{width:34px;height:34px;border:3px solid var(--line);border-top-color:var(--sky);border-radius:50%;animation:spin .7s linear infinite;margin:50px auto}
.loading-row{padding:40px;text-align:center;color:var(--muted)}
.breadcrumb{display:flex;align-items:center;gap:7px;font-size:12.5px;color:var(--muted);margin-bottom:6px}
.breadcrumb a{color:var(--muted);font-weight:600}
.breadcrumb a:hover{color:var(--sky-deep)}
.profile-head{display:flex;gap:22px;align-items:center;padding:24px;background:linear-gradient(120deg,var(--navy),var(--navy-600));border-radius:var(--radius);color:#fff;margin-bottom:18px;box-shadow:var(--shadow-md)}
.profile-avatar{width:84px;height:84px;border-radius:22px;background:linear-gradient(140deg,var(--sun),var(--coral));color:var(--navy);display:grid;place-items:center;font-family:var(--font-display);font-size:32px;font-weight:700;flex-shrink:0}
.profile-head h2{font-size:26px;color:#fff}
.profile-meta{display:flex;gap:18px;flex-wrap:wrap;margin-top:8px;color:rgba(255,255,255,.82);font-size:13px}
.profile-meta span{display:inline-flex;align-items:center;gap:6px}
.profile-meta i{width:15px;height:15px;color:var(--sun)}
.detail-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:2px 26px}
.detail-item{padding:11px 0;border-bottom:1px solid var(--line-soft)}
.detail-item .k{font-size:11.5px;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);font-weight:700}
.detail-item .v{font-size:14px;font-weight:600;margin-top:3px}
.bar-row{display:flex;align-items:center;gap:12px;margin-bottom:11px;font-size:13px}
.bar-row .bl{width:78px;font-weight:600;color:var(--navy-700);flex-shrink:0}
.bar-track{flex:1;height:10px;background:var(--line-soft);border-radius:999px;overflow:hidden}
.bar-fill{height:100%;border-radius:999px;background:linear-gradient(90deg,var(--sky),var(--sun));transition:width .5s ease}
.bar-row .bv{width:34px;text-align:right;font-weight:700;color:var(--muted)}
.list-item{display:flex;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid var(--line-soft)}
.list-item:last-child{border-bottom:none}
.list-item .grow{flex:1;min-width:0}
.tabs{display:flex;gap:4px;border-bottom:1px solid var(--line);margin-bottom:18px}
.tab{padding:10px 16px;font-weight:700;font-size:13.5px;color:var(--muted);cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-1px}
.tab.active{color:var(--sky-deep);border-bottom-color:var(--sky-deep)}
.tabs-arrow{display:none}
.tab-btn{display:inline-flex;align-items:center;gap:7px;background:none;border:none;border-bottom:2px solid transparent;margin-bottom:-1px;padding:10px 16px;font:inherit;font-weight:700;font-size:13.5px;color:var(--muted);cursor:pointer}
.tab-btn svg,.tab-btn i{width:16px;height:16px}
.tab-btn.active{color:var(--sky-deep);border-bottom-color:var(--sky-deep)}
.checkbox-row{display:flex;align-items:center;gap:9px;padding:7px 0;font-size:13.5px}
.checkbox-row input{width:17px;height:17px;accent-color:var(--sky-deep)}
@keyframes spin{to{transform:rotate(360deg)}}
@keyframes fade{from{opacity:0}to{opacity:1}}
@keyframes pop{from{opacity:0;transform:translateY(10px) scale(.98)}to{opacity:1;transform:none}}
@keyframes slidein{from{opacity:0;transform:translateX(20px)}to{opacity:1;transform:none}}
@media(max-width:1100px){
  .stat-grid{grid-template-columns:repeat(2,1fr)}
  .grid-2,.grid-2b{grid-template-columns:1fr}
  .detail-grid{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:820px){
  :root{--sidebar-w:0px}
  .sidebar{transform:translateX(-100%);transition:transform .25s;width:264px}
  .sidebar.open{transform:none}
  .main{margin-left:0}
  .mobile-toggle{display:grid !important}
  .form-grid{grid-template-columns:1fr}
  .auth-wrap{grid-template-columns:1fr}
  .auth-brand{display:none}
}
.mobile-toggle{display:none;place-items:center;background:#fff;border:1px solid var(--line);border-radius:10px;padding:8px;cursor:pointer}
.scrim{display:none}
@media(max-width:820px){.scrim.show{display:block;position:fixed;inset:0;background:rgba(14,42,67,.4);z-index:35}}
@media print{
  .sidebar,.topbar,.no-print{display:none !important}
  .main{margin-left:0}
  .content{padding:0}
  body{background:#fff}
}
.profile-avatar {
  width: 84px;
  height: 84px;
  min-width: 84px;
  min-height: 84px;
  overflow: hidden;
  border-radius: 20px;
  position: relative;
  flex-shrink: 0;
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  border-radius: inherit;
}
@media (max-width: 820px) {
  .topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 12px;
    row-gap: 9px;
    padding: 12px 18px 13px;
    align-items: center;
  }
  .topbar .mobile-toggle {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
  }
  .topbar > div:not(.topbar-spacer):not(.usermenu) {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }
  .topbar .page-title {
    font-size: 19px;
    line-height: 1.15;
    white-space: nowrap;
  }
  .topbar .page-sub {
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
  }
  .topbar-spacer {
    display: none;
  }
  .topbar .year-pill {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
    padding: 7px 12px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .topbar .usermenu {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
    min-width: 0;
    max-width: 100%;
    padding: 3px 0;
  }
  .topbar .avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
  }
  .topbar .usermenu .u-name {
    white-space: nowrap;
    font-size: 12.5px;
  }
  .topbar .usermenu .u-role {
    white-space: nowrap;
    font-size: 10.5px;
  }
}
.invoice-student-field {
  position: relative;
}
.student-combobox {
  position: relative;
}
.student-search-input {
  width: 100%;
}
.student-search-results {
  display: none;
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  z-index: 120;
  max-height: 280px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: 0 10px 28px rgba(14,42,67,.14);
}
.student-search-results.show {
  display: block;
}
.student-search-option {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.student-search-option:last-child {
  border-bottom: 0;
}
.student-search-option:hover {
  background: var(--paper);
}
.student-search-name {
  display: block;
  font-weight: 700;
  color: var(--ink);
  font-size: 13.5px;
}
.student-search-meta {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--muted);
}
.student-search-empty {
  padding: 14px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.parent-combobox {
  position: relative;
}
.parent-search-results {
  display: none;
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  z-index: 120;
  max-height: 280px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: 0 10px 28px rgba(14,42,67,.14);
}
.parent-search-results.show {
  display: block;
}
.parent-search-result {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.parent-search-result:last-child {
  border-bottom: 0;
}
.parent-search-result:hover {
  background: var(--paper);
}
@media (max-width: 820px) {
  .content { padding: 18px 14px 48px; }
  .topbar { grid-template-columns: 42px minmax(0, 1fr); padding: 10px 14px 11px; }
  .topbar .mobile-toggle { width: 42px; height: 42px; padding: 0; }
  .topbar .year-pill { grid-column: 1 / -1; }
  .topbar .usermenu { grid-column: 1 / -1; }
  .topbar .page-title,
  .topbar .page-sub { overflow: hidden; text-overflow: ellipsis; }
  .modal,
  .card,
  .field,
  .form-grid > *,
  .grid-2 > *,
  .grid-2b > *,
  .stat-grid > * { min-width: 0; }
  .input, .select, .textarea, select { max-width: 100%; min-width: 0; }
  .tabs {
    position: relative;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs .tab,
  .tabs .tab-btn { flex: 0 0 auto; white-space: nowrap; padding: 10px 12px; }
  .tabs > .tabs-arrow {
    display: block;
    position: sticky;
    z-index: 3;
    flex: 0 0 0px;
    width: 0;
    padding: 0;
    margin: 0;
    border: 0;
    background: none;
    align-self: stretch;
    cursor: pointer;
  }
  .tabs > .tabs-arrow[hidden] { display: none; }
  .tabs > .tabs-arrow[data-dir="prev"] { left: 0; }
  .tabs > .tabs-arrow[data-dir="next"] { right: 0; margin-left: auto; }
  .tabs > .tabs-arrow > span {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    padding-bottom: 3px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 2px 8px rgba(14, 42, 67, .18);
    color: var(--sky-deep);
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
  }
  .tabs > .tabs-arrow[data-dir="prev"] > span { left: 2px; }
  .tabs > .tabs-arrow[data-dir="next"] > span { right: 2px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px; margin-bottom: 18px; }
  .stat { padding: 14px; }
  .stat .ic { width: 36px; height: 36px; border-radius: 11px; margin-bottom: 10px; }
  .stat .ic i, .stat .ic svg { width: 19px; height: 19px; }
  .stat .label { font-size: 12px; }
  .stat .value { font-size: 21px; overflow-wrap: anywhere; }
  .stat-grid:has(> .card) { grid-template-columns: minmax(0, 1fr) !important; }
  .card-head { flex-wrap: wrap; padding: 14px 16px; }
  .card-head > div:first-child:not(:only-child) { flex: 1 1 180px !important; min-width: 0; }
  .card-pad { padding: 16px; }
  .toolbar { gap: 10px; }
  .toolbar > * { max-width: 100%; }
  .search-box,
  .toolbar .search-box { min-width: 0; flex: 1 1 100%; }
  .search-box input { width: 100%; }
  .profile-head { flex-wrap: wrap; gap: 14px; padding: 18px; }
  .profile-head .grow { flex: 1 1 calc(100% - 100px); min-width: 0; }
  .profile-head h2 { font-size: 21px; overflow-wrap: anywhere; }
  .profile-avatar { width: 64px; height: 64px; min-width: 64px; min-height: 64px; font-size: 24px; border-radius: 18px; }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-item .v { overflow-wrap: anywhere; }
  .modal-back { padding: 14px 10px; }
  .modal-head { padding: 15px 18px; }
  .modal-body { padding: 16px 18px; max-height: calc(100vh - 170px); }
  .modal-foot { padding: 12px 18px; flex-wrap: wrap; }
  .toast-wrap { left: 12px; right: 12px; bottom: 12px; }
  .toast { min-width: 0; }
  .pagination { flex-wrap: wrap; gap: 8px; }
  .m-wrap-deep [style*="display:flex"],
  .m-wrap-deep [style*="display: flex"] { flex-wrap: wrap; }
  .m-wrap-deep [style*="min-width"] { min-width: 0 !important; }
  .m-wrap-deep .grow { flex: 1 1 calc(100% - 44px); min-width: 0; }
  .m-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .m-line-row {
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px !important;
    padding: 10px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: #fcfaf6;
  }
  .m-line-row > * { flex: 1 1 calc(50% - 8px); min-width: 0; grid-column: auto !important; }
  .m-line-row > button,
  .m-line-row > .btn { flex: 0 0 auto; align-self: flex-end; }
  .m-line-row > .li-extension-host { flex-basis: 100%; }
}
@media (max-width: 480px) {
  .modal-foot .btn { flex: 1 1 auto; justify-content: center; }
}
.cal-toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:16px}
.cal-nav{display:flex;align-items:center;gap:6px}
.cal-title{font-size:19px;margin:0 6px;min-width:170px;text-align:center}
.cal-actions{display:flex;gap:8px;flex-wrap:wrap;margin-left:auto}
.cal-layout{display:grid;grid-template-columns:minmax(0,1fr);gap:18px;align-items:start}
.cal-card{overflow:hidden}
.cal-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr))}
.cal-head{padding:11px 6px;text-align:center;font-size:11px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--muted);background:var(--cream);border-bottom:1px solid var(--line)}
.cal-head-short{display:none}
.cal-cell{position:relative;min-height:108px;padding:9px 10px;display:flex;flex-direction:column;gap:3px;min-width:0;background:var(--paper);border-right:1px solid var(--line-soft);border-bottom:1px solid var(--line-soft);cursor:pointer;transition:background .15s,box-shadow .15s;outline:none}
.cal-grid>:nth-child(7n){border-right:none}
.cal-cell:hover{background:#fdfaf4}
.cal-cell:focus-visible{box-shadow:inset 0 0 0 2px var(--sky)}
.cal-cell.is-empty{background:repeating-linear-gradient(135deg,var(--cream) 0 6px,#f7f0e4 6px 12px);cursor:default}
.cal-cell.is-weekend{background:#faf8f4}
.cal-cell.is-holiday{background:rgba(239,77,99,.06)}
.cal-cell.is-event{background:rgba(14,127,184,.06)}
.cal-cell.is-selected{box-shadow:inset 0 0 0 2px var(--sky-deep)}
.cal-cell-top{display:flex;align-items:center;justify-content:space-between;gap:4px}
.cal-num{display:grid;place-items:center;width:28px;height:28px;border-radius:50%;font-weight:700;font-size:14px;color:var(--ink)}
.cal-cell.is-weekend .cal-num{color:var(--muted)}
.cal-cell.is-today .cal-num{background:var(--coral-deep);color:#fff}
.cal-today-chip{font-size:10px;font-weight:700;color:var(--coral-deep);background:rgba(239,77,99,.1);padding:2px 8px;border-radius:999px}
.cal-type{display:flex;align-items:center;gap:5px;margin-top:4px;font-size:11px;font-weight:700;color:var(--cal-c)}
.cal-type::before{content:"";width:7px;height:7px;border-radius:50%;background:var(--cal-c);flex:0 0 auto}
.cal-cell.is-working .cal-type{opacity:.75}
.cal-cell .cal-detail{font-size:11px;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cal-dot{display:none}
.cal-legend{display:flex;gap:16px;flex-wrap:wrap;padding:12px 16px;border-top:1px solid var(--line-soft);font-size:11.5px;color:var(--muted)}
.cal-legend span{display:inline-flex;align-items:center;gap:6px}
.cal-legend span::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--cal-c)}
.cal-side{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;align-items:start;min-width:0}
.cal-day-card{padding:16px}
.cal-day-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.cal-day-weekday{font-size:11px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--muted)}
.cal-day-date{font-size:17px;font-weight:700;color:var(--navy);margin-top:2px}
.cal-badge{flex:0 0 auto;font-size:11px;font-weight:700;color:var(--cal-c);padding:4px 10px;border-radius:999px;background:#fff;border:1px solid var(--cal-c)}
.cal-day-title{margin-top:12px;font-weight:700;color:var(--ink)}
.cal-day-desc{margin-top:4px;font-size:13px;color:var(--muted)}
.cal-day-extra:empty{display:none}
.cal-day-extra{margin-top:10px}
.cal-day-extra .cal-detail{font-size:12px !important;color:var(--muted)}
.cal-day-edit{margin-top:14px;width:100%;justify-content:center}
.cal-agenda{padding:14px 16px}
.cal-agenda-head{font-size:12px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--muted);margin-bottom:8px}
.cal-agenda-empty{font-size:13px;color:var(--muted);padding:6px 0}
.cal-agenda-row{display:flex;align-items:center;gap:12px;padding:9px 0;border-top:1px solid var(--line-soft);cursor:pointer}
.cal-agenda-row:first-of-type{border-top:none}
.cal-agenda-row:hover .cal-agenda-title{color:var(--sky-deep)}
.cal-agenda-date{flex:0 0 44px;height:44px;border-radius:12px;display:flex;flex-direction:column;align-items:center;justify-content:center;background:var(--cream);border-left:3px solid var(--cal-c)}
.cal-agenda-date b{font-size:16px;line-height:1;color:var(--ink)}
.cal-agenda-date span{font-size:10px;color:var(--muted);text-transform:uppercase;margin-top:2px}
.cal-agenda-text{min-width:0}
.cal-agenda-title{font-weight:600;font-size:13.5px;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cal-agenda-type{font-size:11px;font-weight:700;color:var(--cal-c)}
@media (min-width: 1280px) {
  .cal-layout{grid-template-columns:minmax(0,1fr) 300px}
  .cal-side{display:flex;flex-direction:column}
}
@media (max-width: 820px) {
  .cal-toolbar{flex-direction:column;align-items:stretch;gap:10px}
  .cal-nav{width:100%}
  .cal-title{flex:1;min-width:0;font-size:17px;margin:0}
  .cal-actions{margin-left:0;display:grid;grid-template-columns:1fr 1fr}
  .cal-actions .btn{justify-content:center;padding-left:8px;padding-right:8px;font-size:12.5px}
  .cal-side{display:flex;flex-direction:column;align-items:stretch}
  .cal-head{padding:8px 0;font-size:10.5px;letter-spacing:.02em}
  .cal-head-full{display:none}
  .cal-head-short{display:inline}
  .cal-cell{min-height:54px;padding:6px 0 7px;align-items:center;justify-content:flex-start;gap:4px;border-right:none;border-bottom:none}
  .cal-cell.is-empty{background:transparent}
  .cal-cell.is-weekend,.cal-cell.is-holiday,.cal-cell.is-event,.cal-cell:hover{background:transparent}
  .cal-cell.is-selected{box-shadow:none}
  .cal-cell-top{justify-content:center}
  .cal-num{width:34px;height:34px;font-size:14.5px;font-weight:600}
  .cal-cell.is-holiday .cal-num{color:var(--coral-deep)}
  .cal-cell.is-event .cal-num{color:var(--sky-deep)}
  .cal-cell.is-today .cal-num{background:transparent;color:var(--coral-deep);box-shadow:inset 0 0 0 1.5px var(--coral-deep)}
  .cal-cell.is-selected .cal-num{background:var(--navy);color:#fff;box-shadow:none}
  .cal-today-chip,.cal-type,.cal-cell .cal-detail{display:none !important}
  .cal-dot{display:block;width:6px;height:6px;border-radius:50%;background:var(--cal-c)}
  .cal-cell.is-working .cal-dot{background:transparent}
  .cal-grid{padding:4px 6px 6px}
  .cal-legend{justify-content:center;gap:12px;font-size:11px;padding:10px 12px}
}
@media (max-width: 820px) {
  .table-wrap.m-cards,
  .table-wrap.m-cards-auto { border: none; background: transparent; border-radius: 0; }
  .m-cards,
  .m-cards-auto { overflow: visible !important; }
  :is(.m-cards, .m-cards-auto) > table {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto !important;
  }
  :is(.m-cards, .m-cards-auto) > table > tbody,
  :is(.m-cards, .m-cards-auto) > table > tfoot,
  :is(.m-cards, .m-cards-auto) > table > tbody > tr,
  :is(.m-cards, .m-cards-auto) > table > tfoot > tr,
  :is(.m-cards, .m-cards-auto) > table > tbody > tr > td,
  :is(.m-cards, .m-cards-auto) > table > tfoot > tr > td,
  :is(.m-cards, .m-cards-auto) > table > tfoot > tr > th { display: block; width: 100% !important; }
  :is(.m-cards, .m-cards-auto) > table > thead { display: none; }
  :is(.m-cards, .m-cards-auto) > table > tbody > tr,
  :is(.m-cards, .m-cards-auto) > table > tfoot > tr {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px 14px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
  }
  :is(.m-cards, .m-cards-auto) > table > tfoot > tr { background: #faf6f0; }
  :is(.m-cards, .m-cards-auto) > table > tbody > tr > td,
  :is(.m-cards, .m-cards-auto) > table > tfoot > tr > td,
  :is(.m-cards, .m-cards-auto) > table > tfoot > tr > th {
    display: grid !important;
    grid-template-columns: minmax(0, 40%) minmax(0, 1fr);
    column-gap: 10px;
    align-items: start;
    padding: 6px 0 !important;
    border: none !important;
    text-align: right;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }
  :is(.m-cards, .m-cards-auto) > table > tbody > tr > td > *,
  :is(.m-cards, .m-cards-auto) > table > tfoot > tr > * > * { grid-column: 2; justify-self: end; max-width: 100%; }
  :is(.m-cards, .m-cards-auto) > table td::before,
  :is(.m-cards, .m-cards-auto) > table > tfoot th::before {
    content: attr(data-label);
    grid-column: 1;
    grid-row: 1 / span 30;
    padding-top: 1px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    white-space: normal;
  }
  :is(.m-cards, .m-cards-auto) > table > tbody > tr > td:first-child,
  :is(.m-cards, .m-cards-auto) > table td[data-label=""] { display: block !important; text-align: left; }
  :is(.m-cards, .m-cards-auto) > table > tbody > tr > td:first-child > *,
  :is(.m-cards, .m-cards-auto) > table td[data-label=""] > * { justify-self: auto; }
  :is(.m-cards, .m-cards-auto) > table > tbody > tr > td:first-child {
    font-size: 15px;
    padding-bottom: 9px !important;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--line-soft) !important;
  }
  :is(.m-cards, .m-cards-auto) > table > tbody > tr > td:first-child::before,
  :is(.m-cards, .m-cards-auto) > table td[data-label=""]::before { content: none; }
  :is(.m-cards, .m-cards-auto) > table td[data-label=""]:empty { display: none; }
  :is(.m-cards, .m-cards-auto) .row-actions { justify-content: flex-end; flex-wrap: wrap; }
  :is(.m-cards, .m-cards-auto) > table .input,
  :is(.m-cards, .m-cards-auto) > table .select { width: 100%; }
}

/* ---- Tabs rendered as <button class="tab"> look like the other tabs ---- */
button.tab{background:none;border:none;border-bottom:2px solid transparent;font:inherit;font-weight:700;font-size:13.5px;display:inline-flex;align-items:center;gap:7px;border-radius:0}
button.tab svg,button.tab i{width:16px;height:16px}
button.tab.active{border-bottom-color:var(--sky-deep)}

/* ---- Inventory ---- */
.inv-tiles{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:16px}
.inv-tile{display:flex;align-items:center;gap:12px;padding:14px 16px;border-radius:var(--radius);background:var(--paper);border:1px solid var(--line);box-shadow:var(--shadow-sm);text-align:left;font:inherit;color:inherit;min-width:0}
button.inv-tile{cursor:pointer;transition:border-color .15s,box-shadow .15s}
button.inv-tile:hover{border-color:#e0b04a}
button.inv-tile.is-active{border-color:#d97706;box-shadow:0 0 0 3px rgba(234,179,8,.18)}
.inv-tile-ic{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;flex:0 0 auto}
.inv-tile-ic svg{width:20px;height:20px}
.inv-tile-body{display:flex;flex-direction:column;min-width:0}
.inv-tile-body b{font-family:var(--font-display);font-size:21px;line-height:1.15;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.inv-tile-body span{font-size:12px;font-weight:700;color:var(--muted)}
.inv-tile-body small{font-size:11px;color:var(--muted)}
.inv-tile.t-navy .inv-tile-ic{background:rgba(14,43,76,.08);color:var(--navy)}
.inv-tile.t-sky .inv-tile-ic{background:rgba(42,165,224,.12);color:var(--sky-deep)}
.inv-tile.t-amber .inv-tile-ic{background:rgba(234,179,8,.16);color:#a16207}
.inv-tile.t-coral .inv-tile-ic{background:rgba(239,77,99,.12);color:var(--coral-deep)}
.inv-extra{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:6px;margin-top:-4px}
.inv-extra .chip{display:inline-flex;align-items:center;gap:5px}
.inv-extra .chip svg{width:13px;height:13px}
.inv-toolbar .inv-cat-filter{width:auto;min-width:170px}
.inv-toolbar .inv-sort{width:auto;min-width:200px}
.inv-toggle{display:inline-flex;align-items:center;gap:7px;padding:9px 13px;border-radius:999px;border:1px solid var(--line);background:#fff;font-size:13px;font-weight:700;color:var(--muted);cursor:pointer;user-select:none}
.inv-toggle input{position:absolute;opacity:0;pointer-events:none}
.inv-toggle svg{width:15px;height:15px}
.inv-toggle.is-on,.inv-toggle:has(input:checked){background:rgba(234,179,8,.14);border-color:#e0b04a;color:#a16207}
.inv-table table.data td,.inv-table table.data th{padding:11px 12px}
.inv-table .row-actions{gap:4px;flex-wrap:nowrap}
.inv-table .inv-num,.inv-table th.inv-num{text-align:right}
.inv-table td:first-child{min-width:190px}
.inv-stock{display:inline-flex;align-items:center;gap:6px;justify-content:flex-end}
.inv-stock-n{font-weight:800;color:var(--ink);font-variant-numeric:tabular-nums}
.inv-bar{height:4px;border-radius:999px;background:var(--line-soft);margin:6px 0 0 auto;width:72px;overflow:hidden}
.inv-bar span{display:block;height:100%;border-radius:999px;background:var(--emerald)}
.inv-bar.is-low span{background:#d97706}
.inv-bar.is-out span{background:var(--coral-deep)}
.inv-row.is-out td:first-child .cell-main{color:var(--coral-deep)}
.inv-foot{margin-top:10px;font-size:12px;color:var(--muted)}
.inv-addcat{display:flex;gap:8px;margin-bottom:16px}
@media (max-width:1100px){.inv-tiles{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:820px){
  .inv-tiles{gap:8px}
  .inv-tile{padding:11px 12px;gap:10px}
  .inv-tile-ic{width:34px;height:34px}
  .inv-tile-body b{font-size:18px}
  .inv-toolbar .inv-cat-filter,.inv-toolbar .inv-sort{flex:1 1 45%;min-width:0}
  .inv-toolbar .btn{flex:1 1 100%;justify-content:center}
  .inv-bar{margin-left:auto}
}


/* ---- Year rollover ---- */
.ro-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:start;margin-bottom:16px}
.ro-card{padding:18px 20px}
.ro-head{display:flex;gap:12px;align-items:flex-start;margin-bottom:14px}
.ro-head h3{margin:0;font-size:16px}
.ro-head p{margin:2px 0 0;font-size:13px;color:var(--muted)}
.ro-n{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;flex:0 0 auto;background:var(--navy);color:#fff;font-weight:800;font-size:13px}
.ro-activate{margin-top:6px}
.ro-arrow{width:16px;height:16px;color:var(--muted)}
.ro-map .select{min-width:120px;padding-top:6px;padding-bottom:6px}
.ro-map td{padding-top:6px;padding-bottom:6px}
.ro-map-now{white-space:nowrap}
.ro-previewbar{display:flex;align-items:center;gap:16px;padding:14px 20px;margin-bottom:16px}
.ro-previewbar .grow,.ro-head .grow{flex:1 1 auto;min-width:0}
.ro-stale-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:#eab308;margin-right:4px;vertical-align:middle}
#roPreview{transition:opacity .15s}
#roPreview.is-stale{opacity:.55}
.ro-toggle{width:100%;background:none;border:0;padding:0;font:inherit;text-align:left;cursor:pointer;color:inherit;margin-bottom:0}
.ro-toggle[aria-expanded="true"]{margin-bottom:14px}
.ro-toggle-btn{display:inline-flex;align-items:center;gap:4px;align-self:center;flex:0 0 auto;font-size:12px;font-weight:700;color:var(--sky-deep);padding:6px 12px;border-radius:999px;background:rgba(14,127,184,.08)}
.ro-toggle-btn svg{width:14px;height:14px;transition:transform .15s}
.ro-stu-bar{display:flex;align-items:center;gap:12px;margin-bottom:10px;flex-wrap:wrap}
.ro-classwise .ro-cw-row{cursor:pointer}
.ro-classwise .ro-cw-row:hover td,.ro-classwise .ro-cw-row.is-open td{background:#faf6f0}
.ro-cw-chev{width:28px;text-align:right}
.ro-cw-chev svg{width:16px;height:16px;color:var(--muted)}
.ro-classwise .ro-cw-sub td{padding:0;background:#fff}
.ro-cw-list{max-height:360px;overflow:auto;border-bottom:1px solid var(--line)}
.ro-num{display:inline-block;min-width:26px;padding:2px 8px;border-radius:999px;font-weight:800;font-size:12px;text-align:center}
.ro-num.ro-promote,.ro-chip.ro-promote b{background:rgba(24,177,132,.14);color:#0f8a66}
.ro-num.ro-graduate,.ro-chip.ro-graduate b{background:rgba(14,127,184,.12);color:var(--sky-deep)}
.ro-num.ro-hold,.ro-chip.ro-hold b{background:rgba(234,179,8,.18);color:#a16207}
.ro-num.ro-leave,.ro-chip.ro-leave b{background:rgba(239,77,99,.12);color:var(--coral-deep)}
.ro-stu{display:flex;align-items:center;gap:12px;padding:9px 14px;border-top:1px solid var(--line-soft)}
.ro-stu:first-child{border-top:0}
.ro-seg{display:inline-flex;border:1px solid var(--line);border-radius:999px;overflow:hidden;flex:0 0 auto}
.ro-seg button{background:#fff;border:none;padding:6px 12px;font:inherit;font-size:12px;font-weight:700;color:var(--muted);cursor:pointer}
.ro-seg button+button{border-left:1px solid var(--line)}
.ro-seg button.is-on.ro-promote{background:rgba(24,177,132,.14);color:#0f8a66}
.ro-seg button.is-on.ro-graduate{background:rgba(14,127,184,.12);color:var(--sky-deep)}
.ro-seg button.is-on.ro-hold{background:rgba(234,179,8,.18);color:#a16207}
.ro-seg button.is-on.ro-leave{background:rgba(239,77,99,.12);color:var(--coral-deep)}
.ro-warn{display:flex;gap:10px;align-items:flex-start;padding:10px 14px;border-radius:12px;background:rgba(234,179,8,.12);color:#8a5a00;font-size:13px;margin:4px 0 12px}
.ro-warn svg{width:18px;height:18px;flex:0 0 auto}
.ro-pct{max-width:320px;margin-top:10px}
.ro-ext{margin-top:14px;padding-top:14px;border-top:1px solid var(--line-soft)}
.ro-ext-title{display:flex;align-items:center;gap:6px;font-weight:800;font-size:13px;color:var(--navy);margin-bottom:8px}
.ro-ext-title svg{width:15px;height:15px}
.ro-chips{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:12px}
.ro-chip{display:flex;align-items:center;gap:10px;padding:10px 14px;border-radius:12px;border:1px solid var(--line);font-size:13px;font-weight:700;color:var(--navy)}
.ro-chip b{display:inline-grid;place-items:center;min-width:34px;height:30px;padding:0 8px;border-radius:10px;font-size:15px}
.ro-notes{margin:0 0 8px;padding-left:18px;font-size:13px;color:var(--muted)}
.ro-run-bar{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-top:8px}
.ro-run-bar .btn{flex:0 0 auto}
@media (max-width:1000px){
  .ro-grid{grid-template-columns:1fr}
}
@media (max-width:720px){
  .ro-card{padding:14px}
  .ro-previewbar{flex-wrap:wrap;padding:14px}
  .ro-previewbar .btn,.ro-run-bar .btn{width:100%;justify-content:center}
  .ro-run-bar{flex-wrap:wrap}
  .ro-chips{grid-template-columns:repeat(2,minmax(0,1fr))}
  .ro-stu{flex-wrap:wrap}
  .ro-seg{width:100%}
  .ro-seg button{flex:1}
}
