:root{
  --blue:#0B3D91;
  --blue-dark:#072B66;
  --blue-hover:#124BA8;
  --blue-soft:#EAF1FB;
  --bg:#F3F6FA;
  --card:#FFFFFF;
  --text:#1F2937;
  --muted:#6B7280;
  --border:#D9E2EC;
  --success:#2E9E5B;
  --success-soft:#E8F6ED;
  --danger:#C93A47;
  --danger-soft:#FDECEF;
  --warning:#D9822B;
  --warning-soft:#FFF4E8;
  --shadow:0 10px 30px rgba(7,43,102,.10);
  --shadow-sm:0 4px 14px rgba(7,43,102,.08);
  --sidebar-width:270px;
}

*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}

body{
  font-family:Inter, Arial, Helvetica, sans-serif;
  background:var(--bg);
  color:var(--text);
}

.hidden{display:none !important}

/* ============================================
   LOGIN
   ============================================ */
.login-page{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,.10), transparent 28%),
    radial-gradient(circle at bottom right, rgba(255,255,255,.10), transparent 24%),
    linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 100%);
}

.login-shell{
  width:100%;
  max-width:980px;
  display:grid;
  grid-template-columns:1.05fr .95fr;
  background:rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.14);
  border-radius:28px;
  overflow:hidden;
  backdrop-filter:blur(6px);
  box-shadow:0 20px 50px rgba(7,43,102,.22);
}

.login-hero{
  padding:52px 46px;
  color:#fff;
}

.login-brand{
  display:flex;
  align-items:center;
  gap:16px;
  margin-bottom:28px;
}

.login-logo{
  width:88px;
  height:88px;
  border-radius:20px;
  background:rgba(255,255,255,.16);
  border:1px solid rgba(255,255,255,.14);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:12px;
  flex:0 0 auto;
}

.login-logo img,
.side-logo img{
  max-width:100%;
  max-height:100%;
  object-fit:contain;
  display:block;
}

.login-overline{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.12em;
  font-weight:700;
  opacity:.78;
  margin-bottom:8px;
}

.login-panel-title{
  font-size:24px;
  font-weight:800;
  line-height:1.1;
}

.login-hero h1{
  font-size:38px;
  line-height:1.08;
  font-weight:800;
  margin-bottom:16px;
}

.login-hero p{
  font-size:17px;
  line-height:1.7;
  color:rgba(255,255,255,.88);
  max-width:560px;
}

.hero-list{
  margin-top:30px;
  display:grid;
  gap:12px;
}

.hero-list div{
  display:flex;
  align-items:flex-start;
  gap:10px;
  font-size:15px;
  line-height:1.55;
  color:rgba(255,255,255,.92);
}

.hero-list span{
  width:9px;
  height:9px;
  border-radius:50%;
  background:#fff;
  margin-top:6px;
  flex:0 0 auto;
}

.login-card-wrap{
  background:#fff;
  padding:34px 30px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.login-card{
  width:100%;
  max-width:420px;
  background:#fff;
  border:1px solid var(--border);
  border-radius:22px;
  box-shadow:var(--shadow);
  padding:30px 26px;
}

.login-card h2{
  font-size:28px;
  font-weight:800;
  margin-bottom:8px;
}

.login-card p{
  color:var(--muted);
  font-size:15px;
  line-height:1.6;
  margin-bottom:22px;
}

.form-group{margin-bottom:16px}

.form-label{
  display:block;
  font-size:13px;
  font-weight:700;
  color:#374151;
  margin-bottom:7px;
}

.form-input{
  width:100%;
  height:48px;
  border:1px solid var(--border);
  border-radius:12px;
  padding:0 14px;
  font-size:15px;
  color:var(--text);
  background:#fff;
  outline:none;
}

.form-input:focus{
  border-color:var(--blue);
  box-shadow:0 0 0 4px rgba(11,61,145,.10);
}

.btn{
  width:100%;
  height:50px;
  border:none;
  border-radius:12px;
  cursor:pointer;
  font-size:15px;
  font-weight:800;
}

.btn-primary{background:var(--blue);color:#fff}
.btn-primary:hover{background:var(--blue-hover)}

.login-error{
  margin-bottom:14px;
  padding:12px 14px;
  border-radius:12px;
  background:var(--danger-soft);
  color:var(--danger);
  font-size:14px;
  font-weight:700;
  display:none;
}

/* ============================================
   APP LAYOUT
   ============================================ */
.app{
  min-height:100vh;
  display:flex;
}

.sidebar{
  width:var(--sidebar-width);
  background:linear-gradient(180deg, var(--blue-dark) 0%, var(--blue) 100%);
  color:#fff;
  display:flex;
  flex-direction:column;
  min-height:100vh;
  box-shadow:8px 0 22px rgba(7,43,102,.08);
}

.sidebar-top{
  padding:22px 18px 18px;
  border-bottom:1px solid rgba(255,255,255,.10);
}

.side-brand{
  display:flex;
  align-items:center;
  gap:12px;
}

.side-logo{
  width:54px;
  height:54px;
  border-radius:14px;
  background:rgba(255,255,255,.16);
  border:1px solid rgba(255,255,255,.12);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:8px;
  flex:0 0 auto;
}

.side-title{
  font-size:24px;
  font-weight:800;
  line-height:1.05;
  margin-bottom:2px;
}

.side-sub{
  font-size:13px;
  color:rgba(255,255,255,.78);
}

.nav{
  padding:18px 12px;
  flex:1;
  overflow:auto;
}

.nav-section{margin-bottom:18px}

.nav-label{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.12em;
  color:rgba(255,255,255,.52);
  font-weight:700;
  padding:0 10px 10px;
}

.nav-link{
  display:flex;
  align-items:center;
  gap:12px;
  text-decoration:none;
  color:#fff;
  padding:12px 12px;
  border-radius:12px;
  font-size:15px;
  font-weight:700;
  margin-bottom:4px;
  opacity:.92;
  cursor:pointer;
}

.nav-link:hover{background:rgba(255,255,255,.10);opacity:1}
.nav-link.active{background:rgba(255,255,255,.16)}

.nav-ico{
  width:22px;
  text-align:center;
  flex:0 0 auto;
}

.sidebar-user{
  margin:12px;
  padding:16px;
  border-radius:16px;
  background:rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.10);
}

.sidebar-user-name{
  font-size:16px;
  font-weight:800;
  margin-bottom:4px;
}

.sidebar-user-mail{
  font-size:13px;
  color:rgba(255,255,255,.76);
  word-break:break-word;
  margin-bottom:14px;
}

.btn-logout{
  width:100%;
  height:42px;
  border:none;
  border-radius:10px;
  cursor:pointer;
  background:rgba(255,255,255,.14);
  color:#fff;
  font-weight:800;
  font-size:14px;
}

.btn-logout:hover{background:rgba(255,255,255,.22)}

.main{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
}

.topbar{
  min-height:76px;
  background:#fff;
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:16px 24px;
  position:sticky;
  top:0;
  z-index:20;
}

.topbar h1{
  font-size:30px;
  font-weight:800;
}

.topbar-sub{
  font-size:13px;
  color:var(--muted);
  margin-top:4px;
}

.topbar-right{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.top-pill{
  background:var(--blue-soft);
  color:var(--blue);
  border-radius:999px;
  padding:10px 14px;
  font-size:13px;
  font-weight:800;
}

.top-btn{
  height:42px;
  border:none;
  border-radius:12px;
  padding:0 16px;
  background:var(--blue);
  color:#fff;
  cursor:pointer;
  font-size:14px;
  font-weight:800;
  white-space:nowrap;
}

.top-btn:hover{background:var(--blue-hover)}

.content{
  padding:24px;
}

.view{display:none}
.view.active{display:block}

/* ============================================
   COMMON GRID / STATS
   ============================================ */
.grid{display:grid;gap:18px}
.grid-4{grid-template-columns:repeat(4,1fr)}

.stat-card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:16px;
  box-shadow:var(--shadow-sm);
  padding:14px 16px;
  position:relative;
  overflow:hidden;
}

.stat-card::before{
  content:'';
  position:absolute;
  left:0;
  right:0;
  top:0;
  height:3px;
  background:#D7E1EE;
}

.stat-card:nth-child(1)::before{background:var(--blue)}
.stat-card:nth-child(2)::before{background:var(--success)}
.stat-card:nth-child(3)::before{background:var(--danger)}
.stat-card:nth-child(4)::before{background:var(--warning)}

.stat-label{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:var(--muted);
  font-weight:800;
  margin-bottom:8px;
}

.stat-value{
  font-size:22px;
  font-weight:800;
  line-height:1;
  margin-bottom:6px;
}

.stat-success{color:var(--success)}
.stat-danger{color:var(--danger)}
.stat-warning{color:var(--warning)}

.stat-note{
  font-size:12px;
  color:var(--muted);
  line-height:1.35;
}

/* ============================================
   OLD DASHBOARD LAYOUT (kept for safety)
   ============================================ */
.dash-layout{
  display:grid;
  grid-template-columns:320px 1fr 320px;
  gap:18px;
  margin-top:18px;
  align-items:start;
}

/* ============================================
   PANEL / BLOCK SYSTEM
   ============================================ */
.panel{
  background:#fff;
  border:1px solid var(--border);
  border-radius:14px;
  box-shadow:var(--shadow-sm);
  overflow:hidden;
}

.panel-mt{margin-top:16px}

.panel-head{
  padding:12px 14px 10px;
  border-bottom:1px solid #EDF2F7;
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
}

.panel-title{
  font-size:14px;
  font-weight:800;
  margin-bottom:2px;
}

.panel-sub{
  font-size:11px;
  color:var(--muted);
  line-height:1.4;
}

.panel-body{
  padding:12px 14px 14px;
}

/* ============================================
   NEW DASHBOARD
   ============================================ */
.dashboard-lines-panel .panel-head{
  padding:14px 16px 12px;
}

.dashboard-lines-panel .panel-title{
  font-size:18px;
}

.dashboard-lines-panel .panel-sub{
  font-size:12px;
}

.dashboard-lines-panel .panel-body{
  padding:10px 12px 12px;
}

.dashboard-lines-wrap{
  display:grid;
  grid-template-columns:40px 1fr 40px;
  gap:10px;
  align-items:center;
}

.line-nav-btn{
  width:40px;
  height:40px;
  border-radius:50%;
  border:1px solid #D6E1EE;
  background:#fff;
  color:#5F6C7F;
  font-size:24px;
  line-height:1;
  box-shadow:var(--shadow-sm);
  cursor:pointer;
}

.line-nav-btn:hover{
  border-color:#9CB9E7;
  color:var(--blue);
  background:#F7FAFF;
}

.dashboard-lines-horizontal{
  display:flex;
  gap:8px;
  overflow-x:auto;
  padding:2px 0 8px;
  scroll-behavior:smooth;
  scroll-snap-type:x proximity;
  scrollbar-width:none;
  -ms-overflow-style:none;
}

.dashboard-lines-horizontal::-webkit-scrollbar{
  display:none;
}

.line-card-dashboard{
  flex:0 0 190px;
  border:1px solid #CFDAE8;
  background:#fff;
  border-radius:12px;
  padding:10px 10px 9px;
  text-align:left;
  cursor:pointer;
  transition:.15s ease;
  position:relative;
  scroll-snap-align:start;
}

.line-card-dashboard:hover{
  border-color:#9CB9E7;
  background:#FAFCFF;
  transform:translateY(-1px);
}

.line-card-dashboard.active{
  border-color:var(--blue);
  background:linear-gradient(180deg, #FFFFFF 0%, #F2F7FF 100%);
  box-shadow:0 0 0 2px rgba(11,61,145,.10);
}

.line-card-dashboard.active::after{
  content:'';
  position:absolute;
  left:10px;
  right:10px;
  bottom:0;
  height:3px;
  border-radius:3px 3px 0 0;
  background:var(--blue);
}

.line-card-dashboard-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:6px;
  margin-bottom:6px;
}

.line-card-dashboard-title{
  font-size:10px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.09em;
  color:#677487;
}

.line-card-dashboard-name{
  font-size:12px;
  font-weight:800;
  line-height:1.2;
  color:var(--text);
  margin-bottom:4px;
  min-height:30px;
}

.line-card-dashboard-meta{
  font-size:10px;
  color:var(--muted);
  line-height:1.35;
  min-height:16px;
  margin-bottom:6px;
}

.line-card-dashboard-progress{
  height:5px;
  border-radius:999px;
  background:#E8EEF6;
  overflow:hidden;
  margin-bottom:6px;
}

.line-card-dashboard-progress span{
  display:block;
  height:100%;
  background:linear-gradient(90deg,var(--blue),var(--blue-hover));
}

.line-card-dashboard-foot{
  display:flex;
  justify-content:space-between;
  gap:6px;
  font-size:10px;
  color:#5B687A;
  font-weight:700;
}

.dashboard-main-grid{
  display:grid;
  grid-template-columns:minmax(0, 1.95fr) minmax(290px, .72fr);
  gap:14px;
  margin-top:14px;
  align-items:start;
}

.dashboard-main-left,
.dashboard-main-right{
  min-width:0;
}

.dashboard-main-right{
  display:grid;
  gap:16px;
}

/* ============================================
   COMMON BADGES
   ============================================ */
.mini-badge{
  padding:5px 8px;
  border-radius:999px;
  font-size:10px;
  font-weight:800;
  white-space:nowrap;
}

.mini-green{background:var(--success-soft);color:var(--success)}
.mini-orange{background:var(--warning-soft);color:var(--warning)}
.mini-red{background:var(--danger-soft);color:var(--danger)}
.mini-blue{background:var(--blue-soft);color:var(--blue)}

.mini-badge-large{
  font-size:11px;
  padding:7px 10px;
}

/* ============================================
   FEED / NOTES
   ============================================ */
.flash-feed{
  display:grid;
  gap:7px;
  max-height:200px;
  overflow:auto;
}

.flash-item{
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 11px;
  background:#fff;
}

.flash-line{
  font-size:12px;
  font-weight:800;
  color:var(--blue);
  margin-bottom:4px;
}

.flash-text{
  font-size:12px;
  line-height:1.45;
  color:var(--text);
  margin-bottom:4px;
}

.flash-time{
  font-size:10px;
  color:var(--muted);
}

.note-list{
  display:grid;
  gap:7px;
  max-height:260px;
  overflow:auto;
}

.note-item{
  border:1px solid #E4EBF4;
  border-radius:12px;
  padding:10px;
  background:#fff;
  cursor:pointer;
}

.note-item:hover{
  background:#FAFBFD;
  border-color:#D6E1EE;
}

.note-top{
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin-bottom:6px;
  align-items:flex-start;
}

.note-title{
  font-size:12px;
  font-weight:800;
  line-height:1.35;
}

.note-meta{
  font-size:10px;
  color:var(--muted);
  line-height:1.4;
  margin-bottom:5px;
}

.note-preview{
  font-size:11px;
  color:var(--text);
  line-height:1.45;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

/* ============================================
   ACTIVE LINE DETAIL
   ============================================ */
.line-detail-top{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
  margin-bottom:14px;
}

.line-detail-title{
  font-size:17px;
  font-weight:800;
  line-height:1.2;
  margin-bottom:4px;
}

.line-detail-meta{
  font-size:11px;
  color:var(--muted);
  line-height:1.45;
}

.detail-progress{
  height:7px;
  background:#E9EEF6;
  border-radius:999px;
  overflow:hidden;
  margin-bottom:9px;
}

.detail-progress span{
  display:block;
  height:100%;
  background:linear-gradient(90deg,var(--blue),var(--blue-hover));
}

.detail-summary{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
  font-size:11px;
  color:var(--muted);
  margin-bottom:12px;
  flex-wrap:wrap;
  font-weight:700;
}

.detail-status-row{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}

.detail-status-chip{
  display:inline-flex;
  align-items:center;
  padding:4px 8px;
  border-radius:999px;
  font-size:10px;
  font-weight:800;
}

.chip-green{
  background:var(--success-soft);
  color:var(--success);
}

.chip-gray{
  background:#EEF2F7;
  color:#5E6B7C;
}

.chip-red{
  background:var(--danger-soft);
  color:var(--danger);
}

.chip-orange{
  background:var(--warning-soft);
  color:var(--warning);
}

.line-users-wrap{
  border:1px solid #E9EEF6;
  border-radius:12px;
  background:#FAFBFD;
  padding:8px;
  max-height:650px;
  overflow:auto;
}

.line-users{
  display:grid;
  gap:5px;
}

.line-user{
  border:1px solid #E4EBF4;
  border-left:4px solid transparent;
  border-radius:10px;
  padding:9px 10px;
  background:#fff;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  min-height:50px;
}

.line-user.delivered{
  background:linear-gradient(90deg, #F3FBF6 0%, #FFFFFF 100%);
  border-left-color:var(--success);
}

.line-user.failed{
  background:linear-gradient(90deg, #FFF5F6 0%, #FFFFFF 100%);
  border-left-color:var(--danger);
}

.line-user.sick{
  background:linear-gradient(90deg, #FFF8F0 0%, #FFFFFF 100%);
  border-left-color:var(--warning);
}

.line-user.waiting{
  background:linear-gradient(90deg, #F8FAFD 0%, #FFFFFF 100%);
  border-left-color:#B8C3D1;
}

.line-user-left{
  display:flex;
  align-items:flex-start;
  gap:10px;
  min-width:0;
  flex:1;
}

.user-order-box{
  width:24px;
  height:24px;
  border-radius:8px;
  background:#EEF3FA;
  color:#556273;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:11px;
  font-weight:800;
  flex:0 0 auto;
}

.line-user.delivered .user-order-box{
  background:var(--success);
  color:#fff;
}

.line-user.failed .user-order-box{
  background:var(--danger);
  color:#fff;
}

.line-user.sick .user-order-box{
  background:var(--warning);
  color:#fff;
}

.user-name{
  font-weight:800;
  font-size:13px;
  margin-bottom:2px;
  line-height:1.2;
  display:flex;
  align-items:center;
  gap:6px;
}

.user-meta{
  font-size:10px;
  color:var(--muted);
  line-height:1.3;
}

.user-marker{
  width:8px;
  height:8px;
  border-radius:50%;
  display:inline-block;
  flex:0 0 auto;
}

.user-marker-green{background:var(--success)}
.user-marker-red{background:var(--danger)}
.user-marker-orange{background:var(--warning)}
.user-marker-gray{background:#94A3B8}

.user-state{
  font-size:10px;
  font-weight:800;
  white-space:nowrap;
  text-align:right;
  min-width:90px;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.user-state-delivered{color:var(--success)}
.user-state-failed{color:var(--danger)}
.user-state-sick{color:var(--warning)}
.user-state-waiting{color:#64748B}

/* ============================================
   QUICK ACTIONS
   ============================================ */
.quick-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:8px;
  margin-top:0;
}

.quick-btn{
  border:1px solid #E0E8F2;
  background:#fff;
  border-radius:12px;
  padding:10px 10px;
  text-align:left;
  cursor:pointer;
  box-shadow:none;
  min-height:82px;
  transition:.15s ease;
}

.quick-btn:hover{
  border-color:#BCD0EA;
  background:#FAFCFF;
}

.quick-icon{
  width:30px;
  height:30px;
  border-radius:9px;
  background:var(--blue-soft);
  color:var(--blue);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:14px;
  margin-bottom:8px;
}

.quick-btn strong{
  display:block;
  font-size:13px;
  margin-bottom:4px;
}

.quick-btn span{
  display:block;
  font-size:11px;
  color:var(--muted);
  line-height:1.35;
}

/* ============================================
   TABLES / STATUS
   ============================================ */
.table-wrap,
.table-scroll{
  overflow:auto;
}

table{
  width:100%;
  border-collapse:collapse;
}

thead th{
  text-align:left;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.06em;
  color:#64748B;
  padding:16px 18px;
  background:#F8FAFC;
  border-bottom:1px solid var(--border);
  white-space:nowrap;
}

tbody td{
  padding:16px 18px;
  border-bottom:1px solid #EEF2F7;
  font-size:14px;
  vertical-align:middle;
}

tbody tr:hover{background:#FAFBFD}

.status-badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
}

.status-active{background:var(--success-soft);color:var(--success)}
.status-inactive{background:#EEF2F7;color:#64748B}
.status-danger{background:var(--danger-soft);color:var(--danger)}
.status-warning{background:var(--warning-soft);color:var(--warning)}

/* ============================================
   PAGE BLOCKS
   ============================================ */
.page-block{
  background:#fff;
  border:1px solid var(--border);
  border-radius:16px;
  box-shadow:var(--shadow-sm);
  overflow:hidden;
}

.page-block-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:14px 16px 12px;
  border-bottom:1px solid #EDF2F7;
  background:#fff;
}

.page-block-title{
  font-size:18px;
  font-weight:800;
}

.page-block-sub{
  font-size:12px;
  color:var(--muted);
  margin-top:3px;
}

.page-block-body{
  padding:14px 16px 16px;
}

/* ============================================
   ALERTS / EMPTY
   ============================================ */
.error-box{
  border:1px solid #F1B4BD;
  border-radius:16px;
  padding:18px;
  margin-bottom:18px;
  box-shadow:var(--shadow);
  background:var(--danger-soft);
  color:var(--danger);
  font-weight:700;
}

.empty-box{
  padding:14px;
  border:1px dashed var(--border);
  border-radius:14px;
  color:var(--muted);
  font-size:13px;
  line-height:1.5;
  background:#fff;
}

/* ============================================
   MODALS
   ============================================ */
.modal{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.45);
  display:none;
  align-items:center;
  justify-content:center;
  padding:20px;
  z-index:100;
}

.modal.show{display:flex}

.modal-card{
  width:100%;
  max-width:620px;
  background:#fff;
  border-radius:20px;
  box-shadow:0 24px 60px rgba(15,23,42,.24);
  overflow:hidden;
}

.modal-card-lg{
  max-width:900px;
}

.modal-head{
  padding:18px 20px;
  border-bottom:1px solid #EDF2F7;
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:flex-start;
}

.modal-title{
  font-size:22px;
  font-weight:800;
  margin-bottom:6px;
}

.modal-sub{
  font-size:13px;
  color:var(--muted);
  line-height:1.5;
}

.modal-close{
  width:42px;
  height:42px;
  border:none;
  border-radius:12px;
  background:#F3F6FA;
  cursor:pointer;
  font-size:22px;
  font-weight:700;
  color:#334155;
  flex:0 0 auto;
}

.modal-body{
  padding:18px 20px 22px;
  font-size:15px;
  line-height:1.7;
  color:var(--text);
  max-height:75vh;
  overflow:auto;
}

#modalBody{
  white-space:pre-wrap;
}

#korisnikModal .modal-body{
  white-space:normal;
  padding-top:16px;
}

#korisnikModal .form-grid{
  align-items:start;
}

.modal-foot{
  padding:14px 20px;
  border-top:1px solid #EDF2F7;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  background:#FAFBFD;
}

.modal-foot-right{
  display:flex;
  align-items:center;
  gap:10px;
}

/* ============================================
   FORMS / FILTERS
   ============================================ */
.form-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px 16px;
}

.form-field{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.form-field label{
  font-size:12px;
  font-weight:700;
  color:#374151;
}

.form-field input,
.form-field select,
.form-field textarea{
  width:100%;
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 12px;
  font-size:14px;
  background:#fff;
  color:var(--text);
  outline:none;
}

.form-field input,
.form-field select{
  height:44px;
}

.form-field textarea{
  min-height:96px;
  resize:vertical;
  line-height:1.5;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus{
  border-color:var(--blue);
  box-shadow:0 0 0 4px rgba(11,61,145,.10);
}

.form-field-wide{
  grid-column:span 2;
}

.filter-row{
  display:grid;
  grid-template-columns:repeat(7,minmax(0,1fr));
  gap:12px;
}

.filter-field{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.filter-field label{
  font-size:12px;
  font-weight:700;
  color:#374151;
}

.filter-field input,
.filter-field select{
  width:100%;
  height:42px;
  border:1px solid var(--border);
  border-radius:12px;
  padding:0 12px;
  font-size:14px;
  background:#fff;
  color:var(--text);
  outline:none;
}

.filter-field input:focus,
.filter-field select:focus{
  border-color:var(--blue);
  box-shadow:0 0 0 4px rgba(11,61,145,.10);
}

.filter-field-wide{
  grid-column:span 2;
}

.sum-bar{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:14px;
}

.sum-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:8px 12px;
  border-radius:999px;
  background:var(--blue-soft);
  color:var(--blue);
  font-size:12px;
  font-weight:800;
}

.pager-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-top:16px;
}

.pager-count{
  font-size:13px;
  color:var(--muted);
}

.pager-controls{
  display:flex;
  align-items:center;
  gap:8px;
}

.pager-info{
  font-size:13px;
  font-weight:800;
  color:var(--text);
}

/* ============================================
   KORISNICI SPECIFIC
   ============================================ */
#view-korisnici .top-btn{
  height:38px;
  padding:0 14px;
  font-size:13px;
  border-radius:10px;
}

.edit-korisnik-btn{
  min-width:58px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1320px){
  .dash-layout{
    grid-template-columns:280px 1fr;
  }

  .dash-side-right{
    grid-column:1 / -1;
  }

  .dashboard-main-grid{
    grid-template-columns:1fr;
  }

  .filter-row{
    grid-template-columns:repeat(4,minmax(0,1fr));
  }
}

@media (max-width: 1100px){
  .grid-4{grid-template-columns:repeat(2,1fr)}
  .dash-layout{grid-template-columns:1fr}
  .quick-grid{grid-template-columns:repeat(2,1fr)}
  .login-shell{grid-template-columns:1fr;max-width:640px}
}

@media (max-width: 900px){
  .app{flex-direction:column}
  .sidebar{width:100%;min-height:auto}
  .content{padding:16px}
  .topbar{padding:14px 16px}
  .form-grid{grid-template-columns:1fr}
  .form-field-wide{grid-column:span 1}
  .filter-row{grid-template-columns:repeat(2,minmax(0,1fr))}
  .dashboard-lines-wrap{
    grid-template-columns:34px 1fr 34px;
    gap:8px;
  }

  .line-nav-btn{
    width:34px;
    height:34px;
    font-size:20px;
  }
}

@media (max-width: 640px){
  .login-page{padding:14px}
  .login-hero{padding:28px 22px 24px}
  .login-card-wrap{padding:20px 16px}
  .login-card{padding:22px 18px}
  .grid-4{grid-template-columns:1fr}
  .quick-grid{grid-template-columns:1fr}
  .topbar{
    align-items:flex-start;
    flex-direction:column;
    gap:10px;
  }
  .line-detail-title{font-size:24px}
  .filter-row{grid-template-columns:1fr}
  .line-card-dashboard{flex-basis:170px}
  .pager-row{
    flex-direction:column;
    align-items:flex-start;
  }
}

.delivery-days-grid{
  display:grid;
  grid-template-columns:repeat(7, minmax(0, 1fr));
  gap:10px;
  margin-top:4px;
}

.day-check{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:44px;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#F8FAFD;
  cursor:pointer;
  font-size:13px;
  font-weight:700;
  color:var(--text);
  user-select:none;
}

.day-check:hover{
  border-color:#B8CAE3;
  background:#F3F7FD;
}

.day-check input[type="checkbox"]{
  width:16px;
  height:16px;
  margin:0;
  accent-color:var(--blue);
  flex:0 0 auto;
}

.day-check span{
  line-height:1;
  white-space:nowrap;
}

@media (max-width: 900px){
  .delivery-days-grid{
    grid-template-columns:repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 640px){
  .delivery-days-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
}

/* ============================================
   KORISNICI IZNIMKE
   ============================================ */
.iznimke-wrap{
  margin-top:24px;
  padding-top:20px;
  border-top:1px solid #EDF2F7;
}

.iznimke-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
  flex-wrap:wrap;
}

.iznimke-head .modal-title{
  font-size:18px;
  margin-bottom:4px;
}

.iznimke-head .modal-sub{
  font-size:12px;
  margin:0;
}

#btnDodajIznimku{
  flex:0 0 auto;
}

#iznimkeTbody td,
#iznimkeLogTbody td{
  font-size:13px;
  line-height:1.45;
}

#iznimkeTbody .top-btn,
#iznimkeLogTbody .top-btn{
  height:34px;
  padding:0 10px;
  font-size:12px;
  border-radius:10px;
}

#iznimkeTbody .top-btn + .top-btn{
  margin-left:6px;
}

#iznimkeTbody .mini-badge,
#iznimkeLogTbody .mini-badge{
  font-size:10px;
}

#iznimkeTbody td:last-child{
  white-space:nowrap;
}

#iznimkeLogTbody td{
  vertical-align:top;
}

#iznimkeLogTbody td:nth-child(4){
  min-width:240px;
}

#iznimkaModal .modal-card{
  max-width:720px;
}

#iznimkaModal .modal-body{
  white-space:normal;
}

#iznimkaModal .form-grid{
  align-items:start;
}

#iznimkaFormError{
  margin-bottom:14px;
}

#iznimkaModal .day-check{
  justify-content:flex-start;
  min-height:44px;
  padding:10px 12px;
}

#iznimkaModal textarea{
  min-height:110px;
}

#iznimkaModal .modal-foot .top-btn{
  min-width:120px;
}

/* malo kompaktniji prikaz tablica iznimki unutar modala */
#korisnikModal .iznimke-wrap .table-wrap{
  border:1px solid #E6EDF5;
  border-radius:14px;
  overflow:auto;
  background:#fff;
}

#korisnikModal .iznimke-wrap table{
  min-width:760px;
}

#korisnikModal .iznimke-wrap thead th{
  padding:12px 14px;
  font-size:11px;
}

#korisnikModal .iznimke-wrap tbody td{
  padding:12px 14px;
}

@media (max-width: 900px){
  .iznimke-head{
    flex-direction:column;
    align-items:stretch;
  }

  #btnDodajIznimku{
    width:100%;
  }

  #iznimkeTbody td:last-child{
    white-space:normal;
  }

  #iznimkeTbody .top-btn{
    margin-bottom:6px;
  }

  #iznimkeTbody .top-btn + .top-btn{
    margin-left:0;
  }
}

@media (max-width: 640px){
  #korisnikModal .iznimke-wrap table{
    min-width:680px;
  }

  #iznimkaModal .modal-card{
    max-width:100%;
  }
}

.manage-user-item{
  width:100%;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:4px;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  cursor:pointer;
  margin-bottom:8px;
  text-align:left;
}

.manage-user-item:hover{
  border-color:#B8CAE3;
  background:#F8FBFF;
}

.manage-user-item.selected{
  border-color:var(--blue);
  background:var(--blue-soft);
  box-shadow:0 0 0 2px rgba(11,61,145,.08);
}

.manage-user-item strong{
  font-size:13px;
  color:var(--text);
}

.manage-user-item span{
  font-size:12px;
  color:var(--muted);
  line-height:1.4;
}