/* Univara theme: deep navy, teal, muted gold, soft blue background */
:root {
  --ak-ink: #003f6b;
  --ak-ink-2: #00577a;
  --ak-accent: #d6b44a;
  --ak-accent-d: #b9952f;
  --ak-paper: #f3f8fa;
  --ak-card: #ffffff;
  --ak-text: #17394e;
  --ak-muted: #708793;
  --ak-line: #d9e5ea;
  --univara-teal: #009ba7;
  --univara-teal-dark: #007d89;
  --univara-teal-light: #e7f7f8;
  --ak-side: 240px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { font-family: 'Manrope', system-ui, sans-serif; background: var(--ak-paper); color: var(--ak-text); font-size: 15px; }
a { color: var(--ak-ink); }
a:hover { color: #009ba7; }
:focus-visible { outline: 2px solid #009ba7; outline-offset: 2px; }

.ak-mark { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: linear-gradient(135deg, #009ba7, #00b2ba); color: #fff; font-weight: 800; font-size: 20px; box-shadow: 0 5px 15px rgba(0,155,167,.25); }
.ak-mark-lg { width: 56px; height: 56px; font-size: 30px; border-radius: 14px; }

/* shell */
.ak-shell { display: flex; min-height: 100vh; }
.ak-side { width: var(--ak-side); background: linear-gradient(180deg, #002f55 0%, #003f6b 50%, #005d75 100%); color: #d7edf1; display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 1030; transition: transform .2s; }
.ak-brand { display: flex; align-items: center; gap: 12px; padding: 20px; color: #fff; font-weight: 800; font-size: 20px; text-decoration: none; line-height: 1.1; }
    .ak-brand:hover {
        color: #fff;
        TEXT-DECORATION: NONE;
    }
.ak-brand small { display: block; font-size: 12px; font-weight: 500; color: #91cbd0; }
.ak-nav { padding: 8px 12px; flex: 1; }
.ak-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; color: #d5e8ed; border-radius: 8px; text-decoration: none; font-weight: 600; margin-bottom: 4px; }
.ak-nav a i { width: 18px; text-align: center; }
.ak-nav a:hover { background: rgba(0,155,167,.20); color: #fff; }
.ak-nav a.active { background: linear-gradient(90deg, #009ba7, #00aeb6); color: #fff; box-shadow: 0 5px 15px rgba(0,155,167,.25); }
.ak-side-foot { padding: 16px 20px; font-size: 12px; color: #86b7c2; }

.ak-main { flex: 1; margin-left: var(--ak-side); min-width: 0; display: flex; flex-direction: column; }
.ak-top { display: flex; align-items: center; gap: 12px; padding: 14px 24px; background: var(--ak-card); border-bottom: 1px solid var(--ak-line); position: sticky; top: 0; z-index: 1020; }
.ak-title { font-size: 20px; font-weight: 800; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #003f6b; }
.ak-burger { display: none; border: 0; background: none; font-size: 20px; color: var(--ak-ink); }
.ak-user { display: flex; align-items: center; gap: 10px; border: 1px solid var(--ak-line); background: #fff; border-radius: 999px; padding: 4px 14px 4px 4px; font-weight: 600; }
.ak-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #003f6b, #009ba7); color: #fff; display: grid; place-items: center; font-weight: 700; }
.ak-role { font-size: 11px; background: #e5f6f7; color: #007b84; padding: 2px 8px; border-radius: 999px; }
.ak-content { padding: 24px; }

/* panels & bars */
.ak-panel { background: var(--ak-card); border: 1px solid var(--ak-line); border-radius: 12px; padding: 20px; box-shadow: 0 5px 20px rgba(0,63,107,.05); }
.ak-h2 { font-size: 17px; font-weight: 800; margin-bottom: 16px; }
.ak-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.ak-owner { display: flex; align-items: center; gap: 10px; }
.ak-owner select { min-width: 220px; }
.ak-meta { color: var(--ak-muted); font-size: 13px; }
.ak-toolbar { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.ak-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ak-search input { min-width: 220px; }
.ak-crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-weight: 600; }
.ak-crumbs span { color: var(--ak-muted); }
.ak-crumbs a { text-decoration: none; }

/* buttons */
.ak-btn { background: linear-gradient(90deg, #003f6b 0%, #007b91 50%, #009ba7 100%); color: #fff; border: 0; font-weight: 700; box-shadow: 0 5px 15px rgba(0,105,130,.18); }
.ak-btn:hover { background: linear-gradient(90deg, #002f55, #008894); color: #fff; box-shadow: 0 8px 20px rgba(0,105,130,.25); }
.ak-btn-ghost { background: #fff; border: 1px solid var(--ak-line); color: var(--ak-ink); font-weight: 700; }
.ak-btn-ghost:hover { border-color: var(--ak-ink); }
.ak-icon { color: var(--ak-ink); background: transparent; border: 0; }
.ak-icon:hover { background: #e7f7f8; color: var(--ak-ink); }
.ak-del:hover { background: #fdeaea; color: #c0392b; }
.ak-alert-ok { background: #e7f7f3; border-color: #b9e4d9; color: #087365; }
.ak-badge-admin { background: var(--ak-accent); color: var(--ak-ink); }
.ak-pager .page-link { color: var(--ak-ink); }
.ak-pager .active .page-link { background: #009ba7; border-color: #009ba7; color: #fff; }

/* drop zone */
.ak-drop { border: 2px dashed var(--ak-line); border-radius: 10px; padding: 14px; text-align: center; color: var(--ak-muted); margin-bottom: 16px; transition: .15s; }
.ak-drop i { color: #009ba7; margin-right: 6px; }
.ak-drop.over { border-color: #009ba7; background: #eaf9fa; color: var(--ak-ink); }
.ak-progress { height: 8px; margin-top: 10px; }
.ak-progress .progress-bar { background: linear-gradient(90deg, #009ba7, #d6b44a); }

/* table */
.ak-table { margin: 0; }
.ak-table th { border-top: 0; border-bottom: 2px solid var(--ak-line); font-size: 13px; color: var(--ak-muted); font-weight: 700; }
.ak-table td { vertical-align: middle; border-color: var(--ak-line); }
.ak-name { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ak-text); text-decoration: none; word-break: break-word; }
.ak-folder { color: var(--ak-accent); font-size: 20px; }
.ak-file { color: #009ba7; font-size: 20px; }
.ak-empty { text-align: center; padding: 48px 12px; color: var(--ak-muted); }
.ak-empty i { font-size: 44px; color: var(--ak-line); }

/* login */
.ak-login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.ak-login-art { background: radial-gradient(circle at 15% 20%, rgba(0,178,186,.35), transparent 35%), linear-gradient(135deg, #002f55 0%, #003f6b 45%, #007d89 100%); color: #fff; padding: 64px; display: flex; flex-direction: column; justify-content: center; }
.ak-login-art h2 { font-weight: 800; font-size: 34px; max-width: 460px; margin: 24px 0 12px; line-height: 1.2; }
.ak-login-art p { color: #c3e0e5; max-width: 420px; }
.ak-login-card { padding: 64px; align-self: center; width: 100%; max-width: 480px; margin: 0 auto; }
.ak-login-card h1 { font-size: 26px; font-weight: 800; color: #003f6b; }

/* responsive */
@media (max-width: 991px) {
  .ak-side { transform: translateX(-100%); }
  .ak-side.open { transform: none; }
  .ak-main { margin-left: 0; }
  .ak-burger { display: block; }
  .ak-content { padding: 16px; }
  .ak-login { grid-template-columns: 1fr; }
  .ak-login-art { display: none; }
  .ak-login-card { padding: 32px 20px; }
}
@media (max-width: 575px) {
  .ak-search, .ak-search input, .ak-owner, .ak-owner select { width: 100%; }
  .ak-owner { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ===================================================================== additions */
.ak-nav { overflow-y: auto; }
.ak-nav-group { margin: 14px 14px 6px; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #86b7c2; }
.ak-scrim { display: none; }
.ak-content { max-width: 1440px; width: 100%; }

/* role badges */
.ak-badge-super { background: #003f6b; color: #fff; }
.ak-badge-admin { background: var(--ak-accent); color: var(--ak-ink); }
.ak-badge-tl { background: #e1f4f6; color: #00727c; }
.ak-badge-user { background: #eef2f4; color: #4a6270; }
.ak-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: #e7f7f8; color: #007b84; white-space: nowrap; text-decoration: none; }
.ak-chip:hover { text-decoration: none; background: #d3f0f2; color: #005f66; }
.ak-chip-muted { background: #eef2f4; color: var(--ak-muted); }
.ak-chip-new { background: #fff3d6; color: #8a6500; }
.badge { font-weight: 700; }

/* stat tiles */
.ak-stat { background: var(--ak-card); border: 1px solid var(--ak-line); border-radius: 12px; padding: 14px 16px; height: 100%; }
.ak-stat .ak-meta { margin-bottom: 2px; }
.ak-stat .v { font-size: 24px; font-weight: 800; color: var(--ak-ink); line-height: 1.2; }

/* filters */
.ak-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-bottom: 16px; }
.ak-filters .form-group { margin: 0; min-width: 150px; flex: 1 1 150px; }
.ak-filters .form-group.wide { flex: 2 1 220px; }
.ak-filters label { font-size: 12px; color: var(--ak-muted); font-weight: 700; margin-bottom: 4px; }
.ak-filters .ak-filter-btns { display: flex; gap: 8px; flex: 0 0 auto; }

/* multi-select user picker */
.ak-picker { border: 1px solid var(--ak-line); border-radius: 10px; overflow: hidden; background: #fff; }
.ak-picker-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px; border-bottom: 1px solid var(--ak-line); background: #f7fbfc; }
.ak-picker-head input[type=search] { flex: 1 1 180px; min-width: 0; }
.ak-picker-list { max-height: 300px; overflow-y: auto; }
.ak-pick { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-bottom: 1px solid #eef3f5; cursor: pointer; margin: 0; }
.ak-pick:last-child { border-bottom: 0; }
.ak-pick:hover { background: #f3fafb; }
.ak-pick input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: #009ba7; }
.ak-pick .who { min-width: 0; flex: 1; }
.ak-pick .who b { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ak-pick .who small { color: var(--ak-muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ak-pick .state { font-size: 11px; color: var(--ak-muted); text-align: right; flex: 0 0 auto; }
.ak-pick.is-on { background: #eaf8f9; }
.ak-picker-foot { padding: 8px 12px; font-size: 13px; color: var(--ak-muted); border-top: 1px solid var(--ak-line); background: #f7fbfc; }
.ak-picked { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* upload modal */
.ak-filelist { list-style: none; padding: 0; margin: 8px 0 0; max-height: 160px; overflow-y: auto; }
.ak-filelist li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--ak-line); font-size: 14px; }
.ak-filelist li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ak-filelist li.bad { color: #c0392b; }
.ak-drop-sm { border: 2px dashed var(--ak-line); border-radius: 10px; padding: 18px; text-align: center; color: var(--ak-muted); cursor: pointer; }
.ak-drop-sm.over, .ak-drop-sm:hover { border-color: #009ba7; background: #eaf9fa; color: var(--ak-ink); }

/* bulk bar */
.ak-bulk { display: none; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 10px; background: #e7f7f8; margin-bottom: 12px; font-weight: 700; color: var(--ak-ink); }
.ak-bulk.show { display: flex; }
.ak-check { width: 18px; height: 18px; accent-color: #009ba7; vertical-align: middle; }

/* template editor + preview */
.ak-tokens { display: flex; flex-wrap: wrap; gap: 6px; }
.ak-token { border: 1px solid var(--ak-line); background: #fff; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; color: var(--ak-ink); cursor: pointer; }
.ak-token:hover { border-color: #009ba7; background: #e7f7f8; }
.ak-preview-frame { width: 100%; height: 560px; border: 1px solid var(--ak-line); border-radius: 10px; background: #fff; }
.ak-device-toggle .btn.active { background: var(--ak-ink); color: #fff; }
.ak-mailhead { font-size: 14px; border: 1px solid var(--ak-line); border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; background: #f7fbfc; word-break: break-word; }
.ak-mailhead div { padding: 2px 0; }
.ak-mailhead span { color: var(--ak-muted); display: inline-block; min-width: 64px; }
.ak-code { font-family: SFMono-Regular, Consolas, monospace; font-size: 13px; }
.ak-steps { counter-reset: s; list-style: none; padding: 0; margin: 0 0 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.ak-steps li { counter-increment: s; font-size: 13px; font-weight: 700; color: var(--ak-muted); display: flex; align-items: center; gap: 6px; }
.ak-steps li::before { content: counter(s); width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; background: #eef2f4; font-size: 12px; }
.ak-steps li.on { color: var(--ak-ink); }
.ak-steps li.on::before { background: #009ba7; color: #fff; }
.ak-issues { max-height: 220px; overflow-y: auto; font-size: 13px; }
.ak-wrap { word-break: break-word; }
.ak-msg { max-width: 360px; word-break: break-word; }

/* SMTP cards */
.ak-smtp { border: 1px solid var(--ak-line); border-radius: 12px; padding: 16px; background: #fff; height: 100%; display: flex; flex-direction: column; gap: 6px; }
.ak-smtp.off { opacity: .65; }
.ak-smtp h3 { font-size: 16px; font-weight: 800; margin: 0; word-break: break-word; }
.ak-smtp .line { font-size: 13px; color: var(--ak-muted); word-break: break-all; }
.ak-smtp .acts { margin-top: auto; padding-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }

/* stacked tables on phones: <table class="ak-table ak-stack"> + data-label on each td */
@media (max-width: 767px) {
  .ak-stack thead { display: none; }
  .ak-stack, .ak-stack tbody, .ak-stack tr, .ak-stack td { display: block; width: 100%; }
  .ak-stack tr { border: 1px solid var(--ak-line); border-radius: 10px; margin-bottom: 10px; padding: 6px 12px; background: #fff; }
  .ak-stack td { border: 0 !important; padding: 5px 0 !important; text-align: left !important; display: flex; gap: 10px; justify-content: space-between; align-items: center; }
  .ak-stack td[data-label]::before { content: attr(data-label); font-size: 12px; font-weight: 700; color: var(--ak-muted); flex: 0 0 38%; }
  .ak-stack td.ak-td-main { font-size: 15px; }
  .ak-stack td.ak-td-actions { justify-content: flex-end; border-top: 1px solid var(--ak-line) !important; margin-top: 4px; padding-top: 8px !important; }
  .ak-stack td.ak-td-empty { justify-content: center; }
  .table-responsive { overflow: visible; }
  .ak-preview-frame { height: 460px; }
  .ak-content .modal-dialog { margin: 8px; }
}
@media (max-width: 991px) {
  .ak-scrim.show { display: block; position: fixed; inset: 0; background: rgba(0,20,40,.45); z-index: 1025; }
  .ak-top { padding: 12px 16px; }
}
@media (max-width: 575px) {
  .ak-toolbar .ak-actions { width: 100%; }
  .ak-toolbar .ak-actions .btn { flex: 1 1 auto; }
  .ak-panel { padding: 14px; }
  .ak-title { font-size: 17px; }
  .ak-stat .v { font-size: 20px; }
  .ak-filters .ak-filter-btns { width: 100%; }
  .ak-filters .ak-filter-btns .btn { flex: 1; }
  .ak-user { padding: 3px; }
}
.validation-summary-valid { display: none; }
.field-validation-error { color: #c0392b; font-size: 13px; }
.input-validation-error { border-color: #c0392b; }
