/* PedidosFlow UI — CSS puro, mobile-first, sin dependencias de compilación. */
:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #dbeafe;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --success: #059669;
  --success-soft: #d1fae5;
  --sidebar: #0b1220;
  --sidebar-hover: #172033;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .06);
  --shadow: 0 12px 30px rgba(15, 23, 42, .10);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: light; background: var(--bg); }
html, body { width: 100%; max-width: 100%; min-height: 100%; overflow-x: hidden; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { touch-action: manipulation; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: .875rem; }

/* Login */
.login-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 8% 5%, rgba(59, 130, 246, .22), transparent 30%),
    radial-gradient(circle at 94% 92%, rgba(99, 102, 241, .16), transparent 28%),
    linear-gradient(145deg, #f8fafc, #eef4ff);
}
.login-card {
  width: min(100%, 430px);
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 26px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 30px 80px rgba(30, 64, 175, .14);
  backdrop-filter: blur(16px);
}
.login-card h1 { margin: 24px 0 3px; font-size: clamp(1.65rem, 5vw, 2.05rem); line-height: 1.15; letter-spacing: -.035em; }
.brand-mark {
  width: 58px; height: 58px; display: grid; place-items: center;
  border-radius: 18px; color: #fff; font-size: 1.45rem; font-weight: 900;
  background: linear-gradient(135deg, #3b82f6, #4f46e5);
  box-shadow: 0 14px 28px rgba(37, 99, 235, .28);
}
.brand-mark.small { width: 40px; height: 40px; border-radius: 12px; font-size: 1rem; box-shadow: none; }
label { color: #334155; }
.login-card label, .form-grid label { display: grid; gap: 7px; margin-top: 17px; font-size: .86rem; font-weight: 700; }
input, select, textarea {
  width: 100%; min-height: 46px; padding: 10px 13px;
  border: 1px solid var(--line-strong); border-radius: 12px;
  outline: 0; background: #fff; color: var(--text);
  box-shadow: inset 0 1px 1px rgba(15, 23, 42, .025);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { min-height: 96px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #94a3b8; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }

/* Botones */
.btn {
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 15px; border: 1px solid var(--line-strong); border-radius: 12px;
  background: #fff; color: #334155; font-size: .875rem; font-weight: 750;
  box-shadow: var(--shadow-sm); cursor: pointer; transition: transform .12s, background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { border-color: #94a3b8; background: var(--surface-soft); box-shadow: 0 4px 12px rgba(15,23,42,.08); }
.btn:active { transform: scale(.975); }
.btn:focus-visible { outline: 0; box-shadow: 0 0 0 4px var(--primary-soft); }
.btn-primary { border-color: var(--primary); background: var(--primary); color: #fff; box-shadow: 0 8px 18px rgba(37,99,235,.2); }
.btn-primary:hover { border-color: var(--primary-dark); background: var(--primary-dark); }
.btn-danger { border-color: #fecaca; background: var(--danger-soft); color: #b91c1c; }
.btn-danger:hover { border-color: #fca5a5; background: #fee2e2; }
.full { width: 100%; margin-top: 22px; }
.icon-button { width: 44px; height: 44px; display: grid; flex: 0 0 auto; place-items: center; padding: 0; border: 0; border-radius: 12px; background: transparent; color: #475569; font-size: 1.4rem; cursor: pointer; }
.icon-button:hover { background: #f1f5f9; }
.error { min-height: 20px; margin: 10px 0 0; color: #b91c1c; font-size: .875rem; font-weight: 600; }

/* Estructura principal */
.app-shell { min-height: 100dvh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40; width: 272px;
  display: flex; flex-direction: column; padding: 17px;
  background: linear-gradient(180deg, #0b1220, #101827); color: #cbd5e1;
  box-shadow: 18px 0 50px rgba(2, 6, 23, .14);
  transform: translateX(-105%); transition: transform .2s ease;
}
.sidebar.open { transform: translateX(0); }
.sidebar-head { display: flex; align-items: center; gap: 12px; padding: 2px 7px 18px; border-bottom: 1px solid rgba(148,163,184,.14); color: #fff; font-size: 1.05rem; }
.sidebar nav { display: grid; gap: 4px; margin-top: 16px; overflow-y: auto; }
.nav-link {
  width: 100%; min-height: 46px; display: flex; align-items: center; gap: 11px;
  padding: 10px 13px; border: 0; border-radius: 12px;
  background: transparent; color: #94a3b8; text-align: left; font-size: .9rem; font-weight: 650; cursor: pointer;
  transition: color .15s, background .15s, transform .12s;
}
.nav-link::before { content: ""; width: 7px; height: 7px; flex: 0 0 auto; border-radius: 999px; background: #475569; transition: background .15s, box-shadow .15s; }
.nav-link:hover { background: var(--sidebar-hover); color: #fff; }
.nav-link.active { background: linear-gradient(135deg, #2563eb, #3158d6); color: #fff; box-shadow: 0 10px 24px rgba(37,99,235,.2); }
.nav-link.active::before { background: #bfdbfe; box-shadow: 0 0 0 4px rgba(191,219,254,.14); }
.nav-link.logout { margin-top: auto; color: #94a3b8; }
.nav-link.logout:hover { background: rgba(127,29,29,.2); color: #fecaca; }
.backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(2,6,23,.54); backdrop-filter: blur(3px); }
.main-content { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; min-height: 76px;
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  border-bottom: 1px solid rgba(226,232,240,.9); background: rgba(255,255,255,.91); backdrop-filter: blur(16px);
}
.topbar h2 { margin: 0; font-size: 1.08rem; line-height: 1.25; letter-spacing: -.02em; }
.topbar > .status-pill { margin-left: auto; }
.role-switch { display: grid; gap: 2px; margin-left: auto; color: var(--muted); font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.role-switch select { min-height: 38px; width: auto; max-width: 180px; padding: 5px 32px 5px 10px; font-size: .82rem; font-weight: 750; text-transform: none; letter-spacing: normal; }
.role-switch + .status-pill { margin-left: 0; }
.content { width: 100%; min-width: 0; padding: 18px 14px 30px; }
.card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--success-soft); color: #047857; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 99px; background: #10b981; }
.status-pill.offline { background: #fee2e2; color: #b91c1c; }
.status-pill.offline::before { background: #ef4444; }
.alert { margin: 14px 14px 0; padding: 12px 14px; border: 1px solid #bfdbfe; border-radius: 12px; background: #eff6ff; color: #1e40af; font-size: .875rem; font-weight: 600; }
.alert.error-alert { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }

/* Dashboard y tablas */
.dashboard-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.metric { position: relative; overflow: hidden; padding: 20px; }
.metric::after { content: ""; position: absolute; right: -25px; bottom: -35px; width: 100px; height: 100px; border-radius: 50%; background: var(--primary-soft); opacity: .65; }
.metric strong { position: relative; z-index: 1; display: block; margin-top: 5px; font-size: 2rem; line-height: 1.1; letter-spacing: -.04em; }
.toolbar { display: flex; flex-direction: column; align-items: stretch; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.toolbar h3 { margin: 0; font-size: 1.28rem; letter-spacing: -.025em; }
.table-card { width: 100%; min-width: 0; max-width: 100%; overflow: hidden; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-sm); }
.table-wrap { width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.data-table { width: 100% !important; }
.empty { padding: 46px 20px; text-align: center; color: var(--muted); }
.page-error { max-width: 640px; margin: 24px auto; padding: 24px; border-color: #fecaca; background: #fffafa; }
.page-error strong { display: block; color: #991b1b; font-size: 1.05rem; }
.page-error p { margin: 8px 0 18px; color: #7f1d1d; }

/* DataTables */
.dt-container { width: 100%; min-width: 0; max-width: 100%; color: #334155; font-size: .875rem; }
.dt-container .dt-layout-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 13px !important; }
.dt-container .dt-layout-row:last-child { margin: 14px 0 0 !important; }
.dt-container .dt-layout-cell { min-width: 0; max-width: 100%; }
.dt-container .dt-search { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 7px; width: 100%; }
.dt-container .dt-search input { width: 100%; min-width: 0; min-height: 40px; margin: 0 !important; }
.dt-container .dt-length select { width: auto; min-height: 40px; padding-block: 5px; }
.dt-container .dt-info { color: var(--muted); font-size: .8rem; }
.dt-container .dt-paging { display: flex; flex-wrap: wrap; gap: 4px; }
.dt-container .dt-paging .dt-paging-button { min-width: 38px; min-height: 38px; margin: 0 !important; border: 1px solid var(--line) !important; border-radius: 10px !important; background: #fff !important; color: #475569 !important; }
.dt-container .dt-paging .dt-paging-button.current { border-color: var(--primary) !important; background: var(--primary) !important; color: #fff !important; }
table.dataTable { border-collapse: separate !important; border-spacing: 0; }
table.dataTable thead th { padding: 12px 10px !important; border-bottom: 1px solid var(--line) !important; background: #f8fafc; color: #64748b; font-size: .72rem; font-weight: 800; letter-spacing: .045em; text-transform: uppercase; white-space: nowrap; }
table.dataTable tbody td { padding: 12px 10px !important; border-bottom: 1px solid #f1f5f9 !important; vertical-align: middle; }
table.dataTable tbody tr:hover > * { background: #f8fbff !important; }
table.dataTable tbody tr:last-child td { border-bottom: 0 !important; }

/* Formularios modales */
dialog { width: calc(100vw - 12px); max-width: 720px; max-height: calc(100dvh - 12px); margin: auto; padding: 0; overflow: hidden; border: 0; border-radius: 22px; background: transparent; box-shadow: 0 30px 90px rgba(2,6,23,.3); }
dialog::backdrop { background: rgba(2,6,23,.62); backdrop-filter: blur(4px); }
.dialog-card { width: 100%; max-height: calc(100dvh - 12px); margin: 0; padding: 17px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 22px; background: #fff; }
.dialog-head { position: sticky; top: -17px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -17px -17px 0; padding: 15px 17px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.97); backdrop-filter: blur(12px); }
.dialog-head h3 { margin: 0; font-size: 1.15rem; letter-spacing: -.02em; }
.dialog-head .icon-button { display: grid; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 0; }
.roles-field { grid-column: 1 / -1; margin: 18px 0 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.roles-field legend { padding: 0 6px; color: #334155; font-size: .86rem; font-weight: 800; }
.roles-field label { display: flex; align-items: center; gap: 9px; min-height: 38px; margin: 0; cursor: pointer; }
.roles-field input[type="checkbox"] { width: 19px; height: 19px; min-height: 0; padding: 0; accent-color: var(--primary); box-shadow: none; }
.form-tabs { grid-column:1/-1; display:flex; gap:4px; margin:4px 0 18px; padding:4px; border-radius:13px; background:#f1f5f9; }
.form-tab { min-height:40px; flex:1; padding:8px 14px; border:0; border-radius:10px; background:transparent; color:#64748b; font-size:.85rem; font-weight:750; cursor:pointer; }
.form-tab.active { background:#fff; color:#4338ca; box-shadow:0 1px 4px rgba(15,23,42,.1); }
.tab-pane { display:none; grid-column:1/-1; }
.tab-pane.active { display:block; }
.address-panel { min-height:220px; }
.address-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
.compact-table { width:100%; overflow-x:auto; border:1px solid var(--line); border-radius:14px; }
.compact-table table { width:100%; border-collapse:collapse; }
.compact-table th,.compact-table td { padding:10px 12px; border-bottom:1px solid #eef2f7; text-align:left; font-size:.82rem; }
.compact-table th { background:#f8fafc; color:#64748b; font-size:.7rem; text-transform:uppercase; letter-spacing:.04em; }
.compact-table tr:last-child td { border-bottom:0; }
.empty-row { padding:25px!important; color:#94a3b8; text-align:center!important; }
.address-editor { margin-top:14px; padding:14px; border:1px solid #c7d2fe; border-radius:14px; background:#f8faff; }
.wide-field,.inline-actions,.order-products,.image-field { grid-column:1/-1; }
.inline-actions { display:flex; justify-content:flex-end; gap:9px; margin-top:14px; }
.image-picker { position:relative; min-height:110px; display:flex; align-items:center; gap:15px; padding:14px; border:1px dashed #a5b4fc; border-radius:14px; background:#f8faff; overflow:hidden; }
.image-picker img { width:82px; height:82px; flex:0 0 auto; object-fit:cover; border-radius:12px; background:#e2e8f0; }
.image-picker img:not([src]),.image-picker img[src=""] { display:none; }
.image-picker input { position:absolute; inset:0; min-height:100%; opacity:0; cursor:pointer; }
.product-thumb { width:44px; height:44px; display:block; object-fit:cover; border-radius:10px; background:#f1f5f9; }
.product-thumb.missing { visibility:hidden; }
.order-products { margin-top:18px; }
.order-grid select,.order-grid input { min-width:105px; min-height:40px; padding:7px 9px; }
.order-grid select { min-width:220px; }
.line-total { white-space:nowrap; font-weight:750; color:#334155; }
.order-summary { width:min(100%,360px); display:grid; gap:8px; margin:16px 0 0 auto; padding:14px 16px; border:1px solid var(--line); border-radius:14px; background:#f8fafc; }
.order-summary>div { display:flex; align-items:center; justify-content:space-between; gap:16px; color:#64748b; font-size:.84rem; }
.order-summary output { color:#334155; font-weight:750; }
.order-summary .summary-total { margin-top:3px; padding-top:10px; border-top:1px solid var(--line); color:#111827; font-size:1rem; font-weight:850; }
.order-summary .summary-total output { color:#4338ca; font-size:1.18rem; }
.actions { position: sticky; bottom: -17px; z-index: 5; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 22px -17px -17px; padding: 14px 17px; border-top: 1px solid var(--line); background: rgba(255,255,255,.97); backdrop-filter: blur(12px); }
.order-line { margin-top: 12px; padding: 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-soft); }

/* Mapa y seguimiento */
.map { width: 100%; height: 64dvh; min-height: 380px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.tracking-card { max-width: 650px; padding: 22px; }
.tracking-card h3 { margin-top: 0; }
.tracking-state { display: flex; align-items: center; gap: 12px; margin: 20px 0; }
.pulse { width: 12px; height: 12px; border-radius: 50%; background: #94a3b8; }
.pulse.active { background: #10b981; box-shadow: 0 0 0 7px #d1fae5; }

@media (min-width: 640px) {
  .content { padding: 24px; }
  .alert { margin-inline: 24px; }
  .toolbar { flex-direction: row; align-items: center; }
  .dashboard-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .table-card { padding: 18px; }
  .dt-container .dt-search { width: auto; }
  .dt-container .dt-search input { width: 210px; }
  .form-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 16px; }
  dialog { width: calc(100vw - 32px); max-height: calc(100dvh - 32px); }
  .dialog-card { max-height: calc(100dvh - 32px); padding: 24px; }
  .dialog-head { top: -24px; margin: -24px -24px 0; padding: 19px 24px; }
  .actions { bottom: -24px; display: flex; justify-content: flex-end; margin: 24px -24px -24px; padding: 16px 24px; }
}

@media (min-width: 1024px) {
  .sidebar { transform: translateX(0); }
  .main-content { margin-left: 272px; }
  #menu-button { display: none; }
  .content { padding: 28px 30px; }
  .alert { margin-inline: 30px; }
  .dashboard-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .map { height: calc(100vh - 185px); }
}

@media (max-width: 639px) {
  .login-card { padding: 24px 20px; }
  .topbar .muted { display: block; max-width: 48vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .role-switch { position: fixed; right: 12px; bottom: 12px; z-index: 25; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.96); box-shadow: var(--shadow); }
  .role-switch select { max-width: 155px; }
  .toolbar > .btn { width: 100%; }
  .dt-container .dt-layout-cell { width: 100%; }
  .dt-container .dt-paging { justify-content: center; }
  .btn.edit-row, .btn.delete-row { min-height: 40px; padding-inline: 11px; }
  .address-toolbar { align-items:stretch; flex-direction:column; }
  .order-grid thead { display:none; }
  .order-grid table,.order-grid tbody,.order-grid tr,.order-grid td { display:block; width:100%; }
  .order-grid tr { padding:12px; border-bottom:1px solid var(--line); }
  .order-grid td { display:grid; grid-template-columns:88px 1fr; align-items:center; gap:8px; padding:5px!important; border:0; }
  .order-grid td[data-label]::before { content:attr(data-label); color:#64748b; font-size:.72rem; font-weight:750; }
  .order-grid select,.order-grid input { width:100%; min-width:0; }
}

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

/* Rediseño visual 2026 */
:root {
  --bg: #f6f7fb;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-soft: #eef2ff;
  --sidebar: #ffffff;
  --sidebar-hover: #f1f5f9;
}
.login-shell { display: grid; padding: 24px; background: #eef2f7; }
.login-layout { width: min(100%, 980px); min-height: 620px; display: grid; grid-template-columns: minmax(0,1.2fr) minmax(360px,.8fr); overflow: hidden; border: 1px solid rgba(255,255,255,.8); border-radius: 32px; background: #fff; box-shadow: 0 32px 90px rgba(30,41,59,.14); }
.login-visual { position: relative; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 42px; color: #fff; background: linear-gradient(145deg,#111827 0%,#312e81 55%,#4f46e5 100%); }
.login-visual::before { content:""; position:absolute; width:420px; height:420px; right:-180px; top:-150px; border:1px solid rgba(255,255,255,.12); border-radius:50%; box-shadow:0 0 0 55px rgba(255,255,255,.035),0 0 0 110px rgba(255,255,255,.025); }
.login-visual::after { content:""; position:absolute; width:220px; height:220px; left:-100px; bottom:-100px; border-radius:50%; background:rgba(96,165,250,.18); filter:blur(2px); }
.login-brand,.mobile-brand { position:relative; z-index:1; display:flex; align-items:center; gap:13px; }
.login-brand strong,.mobile-brand strong { display:block; font-size:1.05rem; }
.login-brand small { display:block; margin-top:1px; color:#c7d2fe; font-size:.74rem; }
.login-copy { position:relative; z-index:1; max-width:470px; }
.eyebrow { display:block; margin-bottom:12px; color:#6366f1; font-size:.72rem; font-weight:850; letter-spacing:.13em; text-transform:uppercase; }
.login-visual .eyebrow { color:#a5b4fc; }
.login-copy h2 { margin:0; font-size:clamp(2rem,4vw,3rem); line-height:1.08; letter-spacing:-.045em; }
.login-copy p { max-width:390px; margin:20px 0 0; color:#c7d2fe; font-size:1rem; }
.login-feature { position:relative; z-index:1; display:flex; align-items:center; gap:13px; width:max-content; max-width:100%; padding:13px 16px; border:1px solid rgba(255,255,255,.14); border-radius:16px; background:rgba(255,255,255,.08); backdrop-filter:blur(12px); }
.login-feature>span { width:34px; height:34px; display:grid; place-items:center; border-radius:10px; background:rgba(255,255,255,.15); font-weight:900; }
.login-feature strong,.login-feature small { display:block; }
.login-feature small { margin-top:2px; color:#c7d2fe; }
.login-card { align-self:center; width:100%; max-width:none; padding:48px 44px; border:0; border-radius:0; background:#fff; box-shadow:none; backdrop-filter:none; }
.login-card h1 { margin:0 0 6px; font-size:2rem; }
.login-card>.muted { display:block; margin-bottom:26px; }
.mobile-brand { display:none; margin-bottom:34px; }

.sidebar { width:250px; padding:18px 14px; border-right:1px solid #e5e7eb; background:#fff; color:#334155; box-shadow:none; }
.sidebar-head { gap:11px; padding:2px 7px 19px; border-bottom:1px solid #eef2f7; color:#111827; }
.sidebar-head>div { min-width:0; }
.sidebar-head strong,.sidebar-head small { display:block; }
.sidebar-head small { margin-top:1px; color:#94a3b8; font-size:.68rem; font-weight:600; }
.sidebar nav { gap:3px; margin-top:18px; }
.nav-link { position:relative; min-height:44px; padding:10px 12px; color:#64748b; font-size:.875rem; }
.nav-link::before { display:none; }
.ui-icon { width:19px; height:19px; flex:0 0 auto; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.nav-link:hover { background:#f6f7fb; color:#1e293b; }
.nav-link.active { background:#eef2ff; color:#4338ca; box-shadow:none; }
.nav-link.logout { color:#94a3b8; }
.nav-link.logout:hover { background:#fff1f2; color:#be123c; }
.main-content { background:#f6f7fb; }
.topbar { min-height:78px; border-bottom:1px solid #e5e7eb; background:rgba(255,255,255,.88); }
.page-heading h2 { font-size:1.25rem; }
.page-heading .muted { margin-top:1px; }
.user-avatar { width:38px; height:38px; display:grid; place-items:center; margin-left:auto; border:1px solid #dbeafe; border-radius:12px; background:linear-gradient(145deg,#eef2ff,#e0e7ff); color:#4338ca; font-size:.76rem; font-weight:900; letter-spacing:.02em; }
.user-avatar + .role-switch { margin-left:0; }
.content { max-width:1600px; margin:0 auto; }
.card,.table-card { border-color:#e5e7eb; box-shadow:0 1px 2px rgba(15,23,42,.03); }
.metric { min-height:128px; padding:22px; }
.metric::after { right:-32px; bottom:-45px; background:#e0e7ff; }
.metric strong { color:#111827; font-size:2.25rem; }
.metric-top { position:relative; z-index:1; display:flex; align-items:center; justify-content:space-between; gap:12px; }
.metric-icon { width:36px; height:36px; display:grid; place-items:center; border-radius:11px; background:#eef2ff; color:#4f46e5; }
.metric-icon .ui-icon { width:18px; height:18px; }
.metric>small { position:relative; z-index:1; color:#94a3b8; font-size:.72rem; }
.toolbar h3 { font-size:1.35rem; }
.btn { border-color:#e2e8f0; box-shadow:0 1px 2px rgba(15,23,42,.04); }
.btn-primary { border-color:#4f46e5; background:#4f46e5; box-shadow:0 7px 16px rgba(79,70,229,.18); }
.btn-primary:hover { border-color:#4338ca; background:#4338ca; }
.status-pill { background:#ecfdf5; }
.table-card { border-radius:18px; }
table.dataTable thead th { background:#fafafa; color:#6b7280; }
table.dataTable tbody td { color:#374151; }
.dt-container .dt-paging .dt-paging-button.current { border-color:#4f46e5!important; background:#4f46e5!important; }
.dialog-card { border-radius:24px; }

@media (min-width:1024px) {
  .main-content { margin-left:250px; }
}
@media (max-width:760px) {
  .login-shell { padding:0; background:#fff; }
  .login-layout { min-height:100dvh; display:block; border:0; border-radius:0; box-shadow:none; }
  .login-visual { display:none; }
  .login-card { min-height:100dvh; display:flex; flex-direction:column; justify-content:center; padding:32px 22px; }
  .mobile-brand { display:flex; }
  .sidebar { width:min(82vw,280px); }
  .topbar { min-height:70px; }
  .page-heading .muted { max-width:45vw; }
  .user-avatar { display:none; }
}
