/* PSK Business ERP — component library */

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 9px; border: 1px solid transparent;
  font-size: 13.5px; font-weight: 600; white-space: nowrap; text-decoration: none !important; user-select: none;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .08s, color .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--secondary); color: #fff; box-shadow: 0 1px 2px rgba(37, 99, 235, .35); }
.btn-primary:hover { background: var(--secondary-600); }
.btn-navy { background: var(--primary); color: #fff; }
.btn-navy:hover { background: var(--primary-700); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--text); box-shadow: var(--shadow-xs); }
.btn-ghost:hover { background: var(--surface-2); border-color: #D3DBE8; }
.btn-soft { background: var(--blue-50); color: var(--secondary-600); }
.btn-soft:hover { background: #E0EAFF; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #B91C1C; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803D; }
.btn-accent { background: var(--accent); color: #2B1A00; box-shadow: 0 6px 18px rgba(245, 158, 11, .32); }
.btn-accent:hover { background: #FBB02E; }
.btn-glass { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .28); }
.btn-glass:hover { background: rgba(255, 255, 255, .18); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; gap: 6px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; border: 0; border-radius: 9px; background: transparent; color: var(--text-2);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: #EEF2F8; color: var(--text); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.badge-dot { position: absolute; top: 2px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px #fff; }

/* ---------- badges, chips, avatars ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: #EEF1F6; color: #4A5568; }
.badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge-green { background: var(--green-50); color: #15803D; }
.badge-blue { background: var(--blue-50); color: #1D4ED8; }
.badge-amber { background: var(--amber-50); color: #B45309; }
.badge-red { background: var(--red-50); color: #B91C1C; }
.badge-violet { background: var(--violet-50); color: #6D28D9; }
.badge-navy { background: var(--navy-50); color: var(--primary); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 7px; background: #EEF2F8; color: var(--text-2); font-size: 12px; font-weight: 500; white-space: nowrap; }
.chip-blue { background: var(--blue-50); color: #1D4ED8; } .chip-amber { background: var(--amber-50); color: #B45309; }
.chip-green { background: var(--green-50); color: #15803D; } .chip-red { background: var(--red-50); color: #B91C1C; }
.chip-violet { background: var(--violet-50); color: #6D28D9; } .chip-teal { background: var(--teal-50); color: #0F766E; } .chip-navy { background: var(--navy-50); color: var(--primary); }
.avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--blue-50); color: var(--secondary-600); letter-spacing: .02em; }
.avatar-navy { background: var(--primary); color: #fff; } .avatar-amber { background: var(--amber-50); color: #B45309; }
.avatar-green { background: var(--green-50); color: #15803D; } .avatar-violet { background: var(--violet-50); color: #6D28D9; } .avatar-teal { background: var(--teal-50); color: #0F766E; }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; border-radius: 16px; }
.progress { height: 6px; border-radius: 6px; background: #E9EEF5; overflow: hidden; min-width: 60px; }
.progress i { display: block; height: 100%; border-radius: 6px; transition: width .4s var(--ease); }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); min-width: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.card-head p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.card-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.card-body { padding: 16px 18px 18px; }
.card-body.flush { padding: 8px 0 0; }
.card-pad { padding: 18px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--line-2); font-size: 12.5px; color: var(--muted); }

/* ---------- KPI cards ---------- */
.kpi-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.kpi {
  display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); color: var(--text); min-width: 0; transition: box-shadow .18s, transform .18s, border-color .18s;
}
a.kpi:hover { text-decoration: none; box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: #D5DDEB; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.kpi-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--blue-50); color: var(--secondary); flex: none; }
.kpi-value { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; min-height: 30px; }
.kpi-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; min-width: 0; }
.kpi-sub { font-size: 12px; color: var(--muted); }
.delta { display: inline-flex; align-items: center; gap: 2px; height: 20px; padding: 0 6px; border-radius: 6px; font-size: 11.5px; font-weight: 700; }
.delta-up { background: var(--green-50); color: #15803D; }
.delta-down { background: var(--red-50); color: #B91C1C; }
.delta-flat { background: #EEF1F6; color: #4A5568; }
.kpi-navy .kpi-icon { background: var(--navy-50); color: var(--primary); }
.kpi-green .kpi-icon { background: var(--green-50); color: var(--success); }
.kpi-amber .kpi-icon { background: var(--amber-50); color: #D97706; }
.kpi-red .kpi-icon { background: var(--red-50); color: var(--danger); }
.kpi-violet .kpi-icon { background: var(--violet-50); color: var(--violet); }
.kpi-teal .kpi-icon { background: var(--teal-50); color: var(--teal); }
.spark { flex: none; }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px 16px; }
.span-full { grid-column: span 6; } .span-half { grid-column: span 3; } .span-third { grid-column: span 2; } .span-two-thirds { grid-column: span 4; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field > label em { color: var(--danger); font-style: normal; }
.input {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid #D8DFEB; border-radius: 9px; background: #fff; outline: none;
  transition: border-color .15s, box-shadow .15s; min-width: 0;
}
textarea.input { height: auto; padding: 9px 12px; resize: vertical; line-height: 1.5; }
select.input { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23718096' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input:hover { border-color: #C4CDDC; }
.input:focus { border-color: var(--secondary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .13); }
.input[readonly], .input:disabled { background: var(--surface-2); color: var(--text-2); }
.input::placeholder { color: #A3ADBF; }
.input-sm { height: 32px; font-size: 12.5px; border-radius: 8px; padding: 0 10px; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: 0; }
.input-group > :first-child { border-radius: 9px 0 0 9px; }
.input-group > :last-child { border-radius: 0 9px 9px 0; }
.affix { display: grid; place-items: center; padding: 0 11px; background: var(--surface-2); border: 1px solid #D8DFEB; color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.affix:first-child { border-right: 0; } .affix:last-child { border-left: 0; }
.field .hint { font-size: 11.5px; color: var(--muted); }
.field .error { font-size: 11.5px; color: var(--danger); font-weight: 500; display: none; }
.field.invalid .error { display: block; }
.field.invalid .input, .field.invalid .multi { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(220, 38, 38, .1); }
.check { display: inline-flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 500; cursor: pointer; min-height: 38px; }
.check input, .multi-opt input { width: 16px; height: 16px; accent-color: var(--secondary); }
.multi { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px; border: 1px solid #D8DFEB; border-radius: 9px; }
.multi-opt { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 7px; background: var(--surface-2); font-size: 12.5px; cursor: pointer; }
.form-section { display: flex; align-items: baseline; gap: 10px; padding-top: 6px; margin-top: 4px; border-top: 1px solid var(--line-2); }
.form-section:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.form-section span { font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--primary); }
.form-section small { color: var(--muted); font-size: 12px; }
.form-alert { display: flex; align-items: flex-start; gap: 9px; padding: 10px 12px; margin-bottom: 14px; border-radius: 9px; background: var(--red-50); color: #B91C1C; font-size: 13px; font-weight: 500; }
.form-intro { margin-bottom: 14px; color: var(--text-2); font-size: 13px; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 10px; background: var(--blue-50); color: #1E3A8A; font-size: 12.5px; line-height: 1.5; }
.note .icon { margin-top: 1px; }
.note-amber { background: var(--amber-50); color: #92400E; }
.note-red { background: var(--red-50); color: #991B1B; }
.note-green { background: var(--green-50); color: #166534; }
.note-gray { background: #F1F4F9; color: var(--text-2); }

/* segmented + date range */
.segmented { display: inline-flex; padding: 3px; border-radius: 10px; background: #E9EEF5; gap: 2px; }
.segmented button { height: 30px; padding: 0 13px; border: 0; border-radius: 8px; background: transparent; font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; transition: background .15s, color .15s, box-shadow .15s; }
.segmented button:hover { color: var(--text); }
.segmented button.active { background: #fff; color: var(--primary); box-shadow: var(--shadow-xs); }
.range { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.range-custom { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.range-custom .input { width: 142px; }

/* ---------- tables ---------- */
.table-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); min-width: 0; }
.table-toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; flex-wrap: wrap; border-bottom: 1px solid var(--line-2); }
.table-search { position: relative; flex: 1 1 220px; max-width: 320px; color: #9AA5B8; }
.table-search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); }
.table-search input { width: 100%; height: 34px; padding: 0 10px 0 33px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); outline: none; color: var(--text); font-size: 13px; }
.table-search input:focus { border-color: var(--secondary); background: #fff; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.table-filter { width: auto; max-width: 200px; }
.table-dates { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.table-dates .input { width: 136px; }
.table-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { position: sticky; top: 0; padding: 10px 14px; text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none; }
.table th span { display: inline-flex; align-items: center; gap: 5px; }
.table th.sortable { cursor: pointer; }
.table th.sortable:hover { color: var(--text); }
.table th.sortable .icon { opacity: .35; }
.table th.sorted { color: var(--primary); }
.table th.sorted .icon { opacity: 1; }
.table th.ta-right span { flex-direction: row-reverse; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #F8FAFE; }
.table tbody tr.clickable { cursor: pointer; }
.table tfoot td { padding: 11px 14px; background: var(--surface-2); border-top: 1px solid var(--line); font-weight: 700; }
.table .col-actions { width: 48px; text-align: right; padding-right: 8px; }
.table .empty-row:hover { background: transparent; }
.table-card.dense .table td { padding: 8px 14px; }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.table-count { font-size: 12.5px; color: var(--muted); }
.pager { display: flex; align-items: center; gap: 4px; }
.pager .icon-btn { width: 30px; height: 30px; }
.pager-num { min-width: 30px; height: 30px; padding: 0 6px; border: 0; border-radius: 8px; background: transparent; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.pager-num:hover { background: #EEF2F8; }
.pager-num.active { background: var(--primary); color: #fff; }
.pager-gap { color: var(--muted); padding: 0 2px; }
/* plain (non-interactive) table used inside cards and modals */
.simple-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.simple-table th { padding: 8px 12px; text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.simple-table td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.simple-table tr:last-child td { border-bottom: 0; }
.simple-table td a.strong, .table td a.strong { white-space: nowrap; font-weight: 600; }
.simple-table tfoot td { font-weight: 700; border-top: 1px solid var(--line); background: var(--surface-2); }
.simple-table .ta-right, .table .ta-right { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; margin-bottom: 18px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border: 0; background: transparent; font-size: 13.5px; font-weight: 600; color: var(--muted); white-space: nowrap; border-radius: 8px 8px 0 0; transition: color .15s, background .15s; }
.tab:hover { color: var(--text); background: rgba(23, 59, 104, .04); }
.tab.active { color: var(--primary); }
.tab.active::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2.5px; border-radius: 3px 3px 0 0; background: var(--secondary); }
.tab em { font-style: normal; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 9px; background: #E9EEF5; color: var(--text-2); }
.tab.active em { background: var(--blue-50); color: var(--secondary-600); }

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; background: rgba(13, 28, 51, .5); backdrop-filter: blur(2px); opacity: 0; transition: opacity .16s; }
.modal-backdrop.in { opacity: 1; }
.modal-backdrop.closing { opacity: 0; }
.modal { width: 100%; max-width: 620px; background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; transform: translateY(10px) scale(.985); transition: transform .2s var(--ease); margin: auto 0; }
.modal-backdrop.in .modal { transform: none; }
.modal-sm { max-width: 440px; } .modal-lg { max-width: 860px; } .modal-xl { max-width: 1120px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 22px 14px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { font-size: 16.5px; }
.modal-head p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.modal-x { margin: -6px -8px 0 0; }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line-2); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); flex-wrap: wrap; }
.confirm-body { display: flex; gap: 14px; align-items: flex-start; font-size: 13.5px; color: var(--text-2); line-height: 1.55; }
.confirm-icon { width: 42px; height: 42px; border-radius: 12px; flex: none; display: grid; place-items: center; background: var(--blue-50); color: var(--secondary); }
.confirm-icon.danger { background: var(--red-50); color: var(--danger); }

/* ---------- toast ---------- */
.toast-root { position: fixed; left: 50%; transform: translateX(-50%); bottom: 22px; z-index: 700; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 24px); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 420px; padding: 12px 12px 12px 14px; border-radius: 12px; background: #14233D; color: #fff; font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-lg); animation: toast-in .24s var(--ease); }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
.toast-success > .icon { color: #4ADE80; } .toast-error > .icon { color: #F87171; } .toast-warning > .icon { color: #FBBF24; } .toast-info > .icon { color: #93C5FD; }
.toast-x { border: 0; background: transparent; color: #8FA0BC; display: grid; place-items: center; padding: 4px; border-radius: 6px; margin-left: 4px; }
.toast-x:hover { color: #fff; background: rgba(255, 255, 255, .1); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }

/* ---------- menus / popovers ---------- */
.menu { position: fixed; z-index: 320; min-width: 190px; max-width: 340px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); animation: pop .13s var(--ease); }
.menu-wide { min-width: 250px; }
.menu-flush { padding: 0; width: 360px; max-width: calc(100vw - 16px); overflow: hidden; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; font-size: 13.5px; font-weight: 500; text-align: left; color: var(--text); }
.menu-item span { flex: 1; }
.menu-item small { color: var(--muted); font-size: 11.5px; }
.menu-item .icon { color: var(--muted); }
.menu-item:hover:not(:disabled) { background: var(--surface-2); }
.menu-item.active { color: var(--secondary-600); font-weight: 600; }
.menu-item.active .icon { color: var(--secondary); }
.menu-item.danger, .menu-item.danger .icon { color: var(--danger); }
.menu-item.danger:hover { background: var(--red-50); }
.menu-item:disabled { opacity: .5; cursor: not-allowed; }
.menu-sep { height: 1px; margin: 6px 4px; background: var(--line-2); }
.menu-head { padding: 7px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.menu-note { display: flex; gap: 8px; padding: 6px 10px 8px; font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.notif-pop-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--line-2); }
.notif-pop-head div { display: flex; flex-direction: column; }
.notif-pop-head b { font-size: 14.5px; }
.notif-pop-head small { color: var(--muted); font-size: 12px; }
.notif-pop-list { max-height: 380px; overflow-y: auto; }
.notif-row { display: flex; gap: 12px; padding: 11px 16px; color: var(--text); border-bottom: 1px solid var(--line-2); }
.notif-row:hover { background: var(--surface-2); text-decoration: none; }
.notif-row span:last-child { display: flex; flex-direction: column; min-width: 0; line-height: 1.4; }
.notif-row b { font-size: 13px; font-weight: 600; }
.notif-row small { color: var(--muted); font-size: 12px; }
.notif-row.read b { font-weight: 500; color: var(--text-2); }
.notif-ic { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--blue-50); color: var(--secondary); }
.sev-critical .notif-ic { background: var(--red-50); color: var(--danger); }
.sev-warning .notif-ic { background: var(--amber-50); color: #D97706; }
.notif-pop-foot { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 11px; font-size: 12.5px; font-weight: 600; background: var(--surface-2); }

/* ---------- empty, details, timeline, lists, skeleton ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 44px 20px; }
.empty-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--blue-50); color: var(--secondary); margin-bottom: 4px; }
.empty p { color: var(--muted); font-size: 13px; max-width: 380px; }
.empty .btn { margin-top: 8px; }
.details { display: grid; gap: 14px 24px; margin: 0; }
.details-1 { grid-template-columns: 1fr; } .details-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .details-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .details-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.details dt { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.details dd { margin: 0; font-size: 13.5px; font-weight: 500; overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; display: flex; gap: 14px; padding-bottom: 20px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ''; position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li.done::before { background: var(--success); }
.tl-dot { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 2px solid #CBD3E1; background: #fff; display: grid; place-items: center; color: #fff; z-index: 1; }
.timeline li.done .tl-dot { background: var(--success); border-color: var(--success); }
.timeline li.current .tl-dot { border-color: var(--secondary); box-shadow: 0 0 0 4px rgba(37, 99, 235, .15); }
.timeline li.tl-red .tl-dot { background: var(--danger); border-color: var(--danger); }
.tl-title { font-weight: 600; font-size: 13.5px; }
.tl-time { font-size: 12px; color: var(--muted); }
.tl-text { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.timeline li:not(.done):not(.current) .tl-title { color: var(--muted); font-weight: 500; }
.list { list-style: none; margin: 0; padding: 0; }
.list li > * { display: flex; align-items: center; gap: 12px; padding: 10px 18px; color: var(--text); border-bottom: 1px solid var(--line-2); }
.list li:last-child > * { border-bottom: 0; }
.list a:hover { background: var(--surface-2); text-decoration: none; }
.list-lead { flex: none; display: flex; }
.list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.list-main b { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-main small, .list-right small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-right { display: flex; flex-direction: column; align-items: flex-end; flex: none; line-height: 1.35; }
.list-right b { font-weight: 600; font-variant-numeric: tabular-nums; }
.list-empty { padding: 28px 18px; text-align: center; color: var(--muted); font-size: 13px; }
.skeleton-wrap { display: flex; flex-direction: column; gap: 14px; }
.skeleton-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.skeleton-row i, .skeleton-line { display: block; height: 96px; border-radius: var(--radius); background: linear-gradient(90deg, #EBEFF5 25%, #F5F7FB 50%, #EBEFF5 75%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.skeleton-line { height: 46px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- charts ---------- */
.chart { position: relative; }
.chart svg { display: block; overflow: visible; }
.chart .grid { stroke: #EDF1F7; stroke-width: 1; }
.chart .base { stroke: #D5DCE8; stroke-width: 1; }
.chart .axis { fill: #8592A8; font-size: 11px; font-family: var(--font); }
.chart .line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart .dot { stroke-width: 2; }
.chart .cross { stroke: #B9C3D4; stroke-width: 1; stroke-dasharray: 3 3; }
.chart .band { fill: transparent; }
.chart .band.on { fill: rgba(23, 59, 104, .045); }
.chart .bar { transition: opacity .15s; }
.chart .arc { transition: opacity .15s; cursor: pointer; }
.chart .arc.dim { opacity: .3; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 10px; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; }
.chart-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 150px; padding: 9px 11px; border-radius: 10px; background: #14233D; color: #fff; font-size: 12px; box-shadow: var(--shadow-md); white-space: nowrap; }
.chart-tip b { display: block; margin-bottom: 5px; font-size: 12px; color: #C9D6EA; font-weight: 600; }
.chart-tip div { display: flex; align-items: center; gap: 7px; line-height: 1.7; }
.chart-tip i { width: 8px; height: 8px; border-radius: 2px; }
.chart-tip span { flex: 1; color: #DCE6F5; }
.chart-tip strong { font-variant-numeric: tabular-nums; margin-left: 12px; }
.chart-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 180px; color: var(--muted); font-size: 13px; }
.donut { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: center; }
.donut-ring { position: relative; flex: none; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; padding: 0 34px; }
.donut-center small { color: var(--muted); font-size: 11.5px; line-height: 1.2; }
.donut-center b { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.donut-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 190px; }
.donut-legend li { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 8px; font-size: 13px; cursor: default; }
.donut-legend li.on { background: var(--surface-2); }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.donut-legend span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.donut-legend b { font-weight: 600; font-variant-numeric: tabular-nums; }
.donut-legend em { font-style: normal; color: var(--muted); font-size: 12px; width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.hbars { display: flex; flex-direction: column; gap: 13px; }
.hbar-top { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; margin-bottom: 5px; }
.hbar-top span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.hbar-top small { color: var(--muted); margin-left: 8px; font-weight: 400; }
.hbar-top b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; flex: none; }
.hbar-track { height: 8px; border-radius: 6px; background: #EEF2F8; overflow: hidden; }
.hbar-track i { display: block; height: 100%; border-radius: 0 4px 4px 0; transition: width .5s var(--ease); }

/* ---------- welcome screen ---------- */
.welcome { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px; overflow-y: auto; background: radial-gradient(1200px 700px at 15% 0%, #1F4B82 0%, #173B68 38%, #0D223E 100%); opacity: 0; transition: opacity .26s; }
.welcome.in { opacity: 1; }
.welcome-card { width: 100%; max-width: 1120px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 48px; align-items: center; color: #fff; transform: translateY(12px); transition: transform .4s var(--ease); }
.welcome.in .welcome-card { transform: none; }
.welcome-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 36px; }
.welcome-brand div:last-child { display: flex; flex-direction: column; line-height: 1.3; }
.welcome-brand strong { font-size: 18px; }
.welcome-brand small { color: #9FB4D4; font-size: 12.5px; }
.welcome-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #FBBF24; margin-bottom: 14px; }
.welcome h1 { font-size: clamp(30px, 4.2vw, 46px); font-weight: 700; letter-spacing: -.03em; line-height: 1.12; }
.welcome-sub { margin-top: 16px; font-size: 17px; color: #C9D6EA; max-width: 520px; line-height: 1.55; }
.welcome-tag { margin-top: 10px; font-size: 14px; font-weight: 600; color: #fff; }
.welcome-actions { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.welcome-mods { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; max-width: 520px; }
.welcome-mods span { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 8px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .1); font-size: 12.5px; color: #DCE6F5; }
.welcome-foot { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 36px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 12.5px; color: #9FB4D4; }
.welcome-foot b { color: #fff; }
.welcome-right { display: flex; flex-direction: column; gap: 14px; }
.wv-card { background: rgba(255, 255, 255, .97); color: var(--text); border-radius: 16px; padding: 18px; box-shadow: 0 24px 60px rgba(4, 14, 30, .35); }
.wv-card small { color: var(--muted); font-size: 12px; display: block; }
.wv-card b { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.wv-main { position: relative; }
.wv-main .spark { position: absolute; right: 18px; top: 22px; }
.wv-bars { display: flex; align-items: flex-end; gap: 10px; height: 92px; margin-top: 14px; }
.wv-bars i { flex: 1; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, #2563EB, #93B4F8); }
.wv-bars i:nth-child(even) { background: linear-gradient(180deg, #F59E0B, #FCD38A); }
.wv-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.wv-row .wv-card { padding: 14px; }
.wv-row b { font-size: 21px; display: block; margin-top: 8px; }
.wv-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; }
.wv-ic.blue { background: var(--blue-50); color: var(--secondary); } .wv-ic.amber { background: var(--amber-50); color: #D97706; } .wv-ic.teal { background: var(--teal-50); color: var(--teal); }
.wv-list { display: flex; flex-direction: column; gap: 9px; font-size: 13px; font-weight: 500; }
.wv-list div { display: flex; align-items: center; gap: 10px; }

/* ---------- login page (role sign-in) ---------- */
.login-card { background: #fff; color: var(--text); border-radius: 20px; padding: 26px 24px 20px; box-shadow: 0 24px 60px rgba(4, 14, 30, .38); }
.login-card h2 { font-size: 19px; letter-spacing: -.01em; }
.login-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.login-roles { display: flex; flex-direction: column; gap: 7px; margin: 16px 0; }
.login-role { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: left; transition: border-color .15s, background .15s, box-shadow .15s; }
.login-role:hover { border-color: #C4CDDC; background: var(--surface-2); }
.login-role.active { border-color: var(--secondary); background: var(--blue-50); box-shadow: 0 0 0 3px rgba(37, 99, 235, .13); }
.login-role-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.login-role-text b { font-size: 13.5px; font-weight: 650; }
.login-role-text small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.login-role em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--text-2); background: #EEF2F8; padding: 2px 7px; border-radius: 8px; white-space: nowrap; }
.login-role.active em { background: #fff; color: var(--secondary-600); }
.login-check { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #CBD3E1; display: grid; place-items: center; color: transparent; flex: none; }
.login-role.active .login-check { background: var(--secondary); border-color: var(--secondary); color: #fff; }
.login-tour { margin-top: 10px; }
.login-note { display: flex; gap: 7px; align-items: flex-start; margin-top: 14px; font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.login-note .icon { margin-top: 2px; }
@media (max-width: 1024px) {
  .welcome { place-items: start center; }
  .welcome-left .welcome-mods, .welcome-left .welcome-foot { display: none; }
  .welcome-brand { margin-bottom: 18px; }
}
@media (max-width: 760px) {
  .login-card { padding: 20px 16px 16px; border-radius: 16px; }
  .login-role em { display: none; }
}
