/* i-apotek 4.1 — readable, familiar, low-clutter operational UI */
:root{
  --ux-brand:#0f766e;
  --ux-brand-strong:#0b5f59;
  --ux-brand-soft:#ecfdf8;
  --ux-bg:#f5f7f8;
  --ux-surface:#ffffff;
  --ux-text:#17212b;
  --ux-muted:#5f6f7b;
  --ux-border:#d9e1e5;
  --ux-danger:#b42318;
  --ux-warning:#a15c00;
  --ux-focus:#14b8a6;
  --ux-shadow:0 1px 3px rgba(15,23,42,.055),0 8px 24px rgba(15,23,42,.035);
}

html{font-size:16px;text-rendering:optimizeLegibility;-webkit-text-size-adjust:100%}
body{font-size:16px;line-height:1.48;color:var(--ux-text);background:var(--ux-bg)}
button,input,select,textarea{font:inherit}
a,button,input,select,textarea{touch-action:manipulation}

/* Strong keyboard accessibility without adding visual noise for mouse users. */
:where(a,button,input,select,textarea,[tabindex]):focus-visible{
  outline:3px solid rgba(20,184,166,.28)!important;
  outline-offset:2px;
}

/* Sidebar: larger labels, fewer decorative effects. */
.sidebar{width:260px!important;padding:15px 12px 18px;background:#10252e!important;box-shadow:none!important}
.main{margin-left:260px!important}
.brand{min-height:58px;padding:5px 10px 16px;margin-bottom:3px}
.brand-logo,.brand-mark{width:42px!important;height:42px!important;border-radius:11px!important}
.brand b{font-size:20px!important;line-height:1.1}
.nav-group-toggle{min-height:32px;padding:9px 11px 4px!important}
.nav-group-toggle .section-title{font-size:11px!important;letter-spacing:.075em!important;color:#99aab2!important}
.nav-link{min-height:46px!important;padding:11px 12px!important;margin:2px 0!important;border-radius:9px!important;font-weight:650!important;color:#dbe5e9!important}
.nav-label{font-size:15px!important;line-height:1.2}
.nav-ico{width:24px!important;font-size:17px!important}
.nav-link.active{background:#0f766e!important}
.nav-link:hover{background:rgba(255,255,255,.075)!important}

/* Preserve compact sidebar behavior with the larger 4.1 desktop width. */
body.sidebar-collapsed .sidebar{width:78px!important;padding-left:9px!important;padding-right:9px!important}
body.sidebar-collapsed .main{margin-left:78px!important}
body.sidebar-collapsed .brand{justify-content:center!important;padding-left:0!important;padding-right:0!important}
body.sidebar-collapsed .nav-link{justify-content:center!important;padding-left:8px!important;padding-right:8px!important}

/* Top bar: prioritize page, branch, sale action, user. */
.topbar{height:72px!important;padding:0 24px!important;background:#fff!important;border-bottom:1px solid var(--ux-border)!important}
.topbar-context strong{font-size:18px!important;font-weight:760!important;color:var(--ux-text)!important}
.topbar-search{height:44px!important;width:min(390px,31vw)!important;background:#f7f9fa!important;border-color:#dfe6e9!important;border-radius:10px!important}
.topbar-search input{font-size:15px!important}
.topbar-search-icon{font-size:19px!important}
.top-actions{gap:8px!important}
.branch-switch,.branch-static{height:44px!important;border-color:#dfe6e9!important}
.branch-switch .select{font-size:13.5px!important;max-width:200px!important}
.top-sale-btn{min-height:42px!important;height:42px!important;font-size:15px!important;padding:0 16px!important}
.user-menu-trigger{height:44px!important;padding:5px 10px 5px 6px!important}
.user-menu-copy b{font-size:13.5px!important}
.user-menu-copy small{display:none!important}
.user-dropdown{font-size:14px}
.user-dropdown-item{min-height:43px}
.shift-status-pill{height:36px!important;font-size:11px!important}

/* Main rhythm and typography. */
.content{max-width:1600px!important;padding:28px 30px 40px!important}
.page-head{margin-bottom:18px!important;gap:18px!important}
.page-head h1{font-size:28px!important;line-height:1.16!important;font-weight:780!important;letter-spacing:-.025em!important;color:var(--ux-text)!important}
.page-head p{font-size:13.5px!important;line-height:1.45!important;color:var(--ux-muted)!important;max-width:760px}
h2{font-size:23px;line-height:1.25}h3{font-size:18px;line-height:1.3}h4{font-size:15.5px}
.subtle{font-size:13.5px;color:var(--ux-muted)!important;line-height:1.42}

/* Cards stay quiet so the data is what attracts attention. */
.card,.metric-card,.stat-card,.product-panel,.cart-panel{border:1px solid var(--ux-border)!important;border-radius:12px!important;box-shadow:var(--ux-shadow)!important;background:#fff!important}
.card{padding:20px!important}
.metric-label{font-size:13px!important;color:#5d6c77!important;font-weight:700!important}
.metric{font-size:30px!important;line-height:1.15!important;font-weight:800!important}
.metric-sm{font-size:22px!important;line-height:1.2!important;font-weight:770!important}
.stat-card{padding:18px 20px!important}.stat-card span{font-size:13px!important}.stat-card strong{font-size:30px!important}

/* Controls: minimum 44px target and readable text. */
.btn{min-height:44px;padding:0 16px!important;border-radius:9px!important;font-size:15px!important;font-weight:720!important;line-height:1.15!important;white-space:nowrap}
.btn-primary{background:var(--ux-brand)!important;color:#fff!important}.btn-primary:hover{background:var(--ux-brand-strong)!important}
.btn-secondary{background:#fff!important;border-color:#cfd9de!important;color:#33434e!important}.btn-secondary:hover{background:#f7faf9!important;border-color:#9bcfc8!important;color:#0b625d!important}
.btn-danger{background:var(--ux-danger)!important}.btn-warning{color:#8a4b00!important}
.btn-sm{min-height:36px!important;padding:0 11px!important;font-size:13px!important}
.btn-lg{min-height:50px!important;font-size:16px!important}
.input,.select,textarea{min-height:46px!important;border:1px solid #cbd6dc!important;border-radius:9px!important;padding:10px 12px!important;font-size:15px!important;background:#fff!important;color:var(--ux-text)!important}
textarea{min-height:96px!important;line-height:1.5}
.input:focus,.select:focus,textarea:focus{border-color:#5ebdb4!important;box-shadow:0 0 0 3px rgba(20,184,166,.10)!important;outline:0!important}
label{font-size:14.5px!important;font-weight:720!important;color:#2f3c46!important;margin-bottom:7px!important}
.field{margin-bottom:16px!important}.field small{display:block;margin-top:6px;color:#6b7a85;font-size:12.5px;line-height:1.4}
.form-row{gap:16px!important}
input[type="checkbox"],input[type="radio"]{width:18px;height:18px;accent-color:var(--ux-brand);vertical-align:-3px}

/* Tables: readable on desktop, horizontally scrollable on small screens. */
.table-wrap{border-radius:11px!important;border-color:var(--ux-border)!important;box-shadow:none!important;-webkit-overflow-scrolling:touch}
.table{font-size:15px!important}
.table th{padding:13px 15px!important;background:#f7f9fa!important;color:#586873!important;font-size:12px!important;font-weight:780!important;letter-spacing:.035em!important;white-space:nowrap}
.table td{padding:14px 15px!important;line-height:1.4!important;border-bottom-color:#e8edef!important}
.table tbody tr:hover{background:#f8fcfb!important}
.table b{font-weight:760}
.badge{font-size:12.5px!important;line-height:1.2!important;padding:6px 9px!important;font-weight:760!important}

/* Feedback */
.alert{padding:13px 15px!important;border-radius:9px!important;font-size:14px!important;line-height:1.45!important}
.toast{font-size:14px!important}.toast-body b{font-size:14px!important}.toast-body span{font-size:13px!important}
.empty{padding:38px 18px!important;font-size:14px!important}.empty b{font-size:17px!important}

/* Modals: clear section titles and larger form controls. */
.modal{padding:20px!important}
.modal-card{width:min(640px,100%);max-height:min(90vh,900px)!important;padding:22px!important;border-radius:14px!important}
.modal-card>.split:first-child{position:sticky;top:-22px;z-index:3;margin:-22px -22px 18px;padding:17px 22px;background:#fff;border-bottom:1px solid #e7ecef;border-radius:14px 14px 0 0}
.modal-card>.split:first-child h3{margin:0!important;font-size:19px!important}
.modal-card hr{border:0;border-top:1px solid #e7ecef;margin:22px 0!important}

/* Dashboard: large essential numbers; remove tiny decorative copy. */
.dashboard-page-head p{display:none!important}
.dashboard-kpis{gap:14px!important}.dashboard-kpis .kpi-card{min-height:124px!important;padding:18px 18px 16px 70px!important}
.kpi-icon{left:17px!important;top:18px!important;width:42px!important;height:42px!important}
.dashboard-secondary{gap:14px!important}.dashboard-secondary .card{min-height:108px!important}
.dashboard-card-head h3,.chart-card h3{font-size:16px!important}
.link-more{display:inline-block;margin-top:6px;font-size:13px!important;font-weight:650;color:#0f766e!important}

/* POS: readable at a glance and touch-friendly. */
.pos-layout{grid-template-columns:minmax(0,1.55fr) minmax(380px,.85fr)!important;gap:18px!important}
.product-panel{padding:18px!important}.product-grid{grid-template-columns:repeat(auto-fill,minmax(175px,1fr))!important;gap:12px!important}
.product-tile{min-height:130px!important;padding:14px!important;border-radius:11px!important}.product-tile .pname{font-size:15px!important;line-height:1.35!important;min-height:42px!important}.product-tile .price{font-size:18px!important}.product-tile .stock{font-size:12.5px!important}
.cart-head{padding:17px 18px!important}.cart-item{padding:13px 5px!important}.cart-item-title{font-size:14.5px!important}.qty-btn{width:36px!important;height:36px!important;font-size:18px!important}.cart-footer{padding:17px!important}.grand{font-size:28px!important}

/* Login / installer: calm, recognizable, readable. */
.login-page{background:#f3f7f6!important;padding:24px!important}
.login-card{width:min(450px,100%)!important;padding:32px!important;border-radius:16px!important;box-shadow:0 18px 55px rgba(15,23,42,.10)!important}
.login-logo-centered{justify-content:center!important;margin-bottom:18px!important}.login-app-logo{width:68px!important;height:68px!important}.login-brand-name{font-size:25px!important}
.login-card h2{text-align:center;font-size:25px!important;margin:0 0 24px!important}.login-alt-link{font-size:13px!important;margin-top:18px!important}
.install-wrap{max-width:800px!important;margin:32px auto!important}.install-title{font-size:23px!important;margin:0!important}

/* Cleaner settings / administration. */
.permission-card{padding:14px!important}.permission-card b{font-size:14.5px}
.security-badge{font-size:11.5px!important}
.actions{gap:8px!important}

/* Reports need density without becoming tiny. */
.report-card .table{font-size:13.5px!important}.report-card .table th{font-size:11.5px!important}.report-card .table th,.report-card .table td{padding:10px 11px!important}
.report-title h2{font-size:20px!important}.report-title>div{font-size:12.5px!important}

/* Respect user motion preferences. */
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}

@media(max-width:1280px){
  .topbar-search{width:min(320px,26vw)!important}
  .sidebar{width:246px!important}.main{margin-left:246px!important}
}
@media(max-width:980px){
  .sidebar{width:270px!important}.main,body.sidebar-collapsed .main{margin-left:0!important}
  .topbar{height:66px!important;padding:0 13px!important}
  .content{padding:20px 15px 30px!important}
  .pos-layout{grid-template-columns:1fr!important}
  .product-grid{grid-template-columns:repeat(auto-fill,minmax(165px,1fr))!important}
}
@media(max-width:760px){
  html{font-size:15px}.topbar-search{display:none!important}.topbar-context strong{font-size:17px!important}
  .page-head{align-items:flex-start!important;flex-direction:column!important}.page-head h1{font-size:25px!important}
  .page-head>.actions{width:100%;overflow-x:auto;flex-wrap:nowrap;padding-bottom:3px}.page-head>.actions>.btn,.page-head>.actions>a{flex:0 0 auto}
  .grid-3,.grid-4{grid-template-columns:1fr 1fr!important}
  .form-row{grid-template-columns:1fr!important}
}
@media(max-width:560px){
  body{font-size:15px}.content{padding:14px 10px 24px!important}.card{padding:16px!important}
  .grid-2,.grid-3,.grid-4{grid-template-columns:1fr!important}
  .metric{font-size:27px!important}.metric-sm{font-size:20px!important}
  .btn{min-height:43px;font-size:14px!important}.input,.select,textarea{min-height:46px!important;font-size:16px!important}
  .product-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px!important}.product-tile{min-height:122px!important;padding:12px!important}
  .modal{padding:8px!important}.modal-card{padding:18px!important;border-radius:12px!important}.modal-card>.split:first-child{top:-18px;margin:-18px -18px 16px;padding:14px 18px}
  .login-page{padding:14px!important}.login-card{padding:24px 20px!important}
}

@media print{
  html,body{font-size:11pt!important;background:#fff!important}
  .sidebar,.topbar,.no-print,.toast-stack{display:none!important}
  .main{margin:0!important}.content{max-width:none!important;padding:0!important}
  .card,.table-wrap{box-shadow:none!important}
}
