:root {
    --bg: #f5f7fb;
    --bg-soft: #eef3f9;
    --panel: #ffffff;
    --panel-soft: rgba(255,255,255,.78);
    --text: #111827;
    --heading: #0f172a;
    --muted: #667085;
    --muted-2: #94a3b8;
    --primary: #174c7e;
    --primary-dark: #0d335c;
    --primary-soft: #e8f2ff;
    --accent: #b8860b;
    --accent-soft: #fff8e7;
    --success: #087443;
    --success-soft: #e9f9f0;
    --danger: #b42318;
    --danger-soft: #fff1f0;
    --warning: #b54708;
    --warning-soft: #fff7ed;
    --border: #dce5f0;
    --border-strong: #c8d5e3;
    --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow-sm: 0 8px 22px rgba(15, 23, 42, .07);
    --shadow-md: 0 18px 45px rgba(15, 23, 42, .10);
    --radius-sm: 0px;
    --radius-md: 0px;
    --radius-lg: 0px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: "Aptos Display", Aptos, "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background:
        radial-gradient(circle at 10% 0%, rgba(23, 76, 126, .10), transparent 28rem),
        linear-gradient(180deg, #f8fbff 0%, var(--bg) 44%, #f4f6fa 100%);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}
body.app-guest { background: linear-gradient(135deg, #0f2742 0%, #123f67 42%, #f3f7fb 42%, #f3f7fb 100%); }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: none; }
button, input, select, textarea { font: inherit; }
/* Sharp professional layout: no rounded container edges. */
:where(.panel, .auth-card, .panel-soft, .hero-head, .stat, .table-wrap, .btn, input, select, textarea, .flash, .empty, .empty-state, .notice, .approve-box, .return-box, .proposer-card, .user-summary, .chip, .badge, .soft-tag, .auth-points span, .workflow-stage.current-stage, .brand-mark, .brand-mark.large, .nav-link, .user-pill, .user-menu, .user-trigger, .user-avatar, .user-dropdown, .user-dropdown a, .user-actions a, .timeline li, .empty-icon) {
    border-radius: 0 !important;
}


.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 58%, #25689f 100%);
    border-bottom: 1px solid rgba(255,255,255,.16);
    box-shadow: 0 10px 28px rgba(13, 51, 92, .22);
}
.topbar-inner {
    width: 100%;
    margin: 0;
    min-height: 72px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: nowrap;
}
.topbar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    margin-left: auto;
    min-width: 0;
    flex: 1 1 auto;
    white-space: nowrap;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 245px;
    flex: 0 0 auto;
    color: #ffffff;
}
.brand:hover { color: #ffffff; }
.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 0;
    background:
        linear-gradient(145deg, rgba(255,255,255,.26), rgba(255,255,255,.03)),
        linear-gradient(135deg, #ffffff, #dbeafe);
    color: var(--primary-dark);
    font-weight: 950;
    letter-spacing: .06em;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.38), 0 12px 26px rgba(2, 20, 44, .18);
}
.brand-mark.large { width: 58px; height: 58px; border-radius: 0; font-size: 18px; background: linear-gradient(135deg, var(--primary-dark), var(--primary)); color: #fff; }
.brand-copy strong { display: block; font-size: 16px; letter-spacing: -.01em; color: #fff; }
.brand-copy small { display: block; color: rgba(255,255,255,.76); font-size: 12px; margin-top: 2px; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    justify-content: flex-end;
    margin-left: auto;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-link {
    color: rgba(255,255,255,.88);
    font-weight: 800;
    font-size: 13px;
    padding: 9px 12px;
    border-radius: 0;
    transition: .18s ease;
    border: 1px solid transparent;
}
.nav-link:hover { background: rgba(255,255,255,.14); color: #ffffff; }
.nav-link.active {
    background: #ffffff;
    color: var(--primary-dark);
    border-color: rgba(255,255,255,.30);
    box-shadow: 0 8px 20px rgba(2, 20, 44, .16);
}


.user-menu {
    position: relative;
    flex: 0 0 auto;
    margin-left: 4px;
}
.user-menu summary { list-style: none; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-trigger {
    height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 8px;
    border: 1px solid rgba(255,255,255,.24);
    background: rgba(255,255,255,.12);
    color: #fff;
    cursor: pointer;
    user-select: none;
    transition: background .16s ease, border-color .16s ease;
}
.user-trigger:hover,
.user-menu[open] .user-trigger {
    background: rgba(255,255,255,.22);
    border-color: rgba(255,255,255,.36);
}
.user-avatar {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    color: var(--primary-dark);
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(2, 20, 44, .16);
}
.user-avatar svg { width: 20px; height: 20px; fill: currentColor; }
.user-trigger-name {
    max-width: 118px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .01em;
    color: #fff;
}
.menu-caret {
    font-size: 13px;
    line-height: 1;
    color: rgba(255,255,255,.86);
    transition: transform .16s ease;
}
.user-menu[open] .menu-caret { transform: rotate(180deg); }
.user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: 245px;
    background: #ffffff;
    border: 1px solid var(--border-strong);
    box-shadow: 0 18px 42px rgba(15, 23, 42, .18);
    z-index: 100;
    overflow: hidden;
}
.user-dropdown::before {
    content: "";
    position: absolute;
    top: -7px;
    right: 17px;
    width: 14px;
    height: 14px;
    background: #ffffff;
    border-left: 1px solid var(--border-strong);
    border-top: 1px solid var(--border-strong);
    transform: rotate(45deg);
}
.user-dropdown-head {
    position: relative;
    display: grid;
    gap: 3px;
    padding: 14px 15px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}
.user-dropdown-head strong {
    color: var(--heading);
    font-size: 14px;
    line-height: 1.25;
}
.user-dropdown-head small {
    color: var(--muted);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-dropdown a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    color: #1f2937;
    font-size: 13px;
    font-weight: 850;
    border-bottom: 1px solid #edf2f7;
    background: #ffffff;
}
.user-dropdown a:hover {
    color: var(--primary-dark);
    background: #eff6ff;
}
.user-dropdown a:last-child { border-bottom: 0; }
.user-dropdown a.logout-link {
    color: var(--danger);
    background: #fffafa;
}
.user-dropdown a.logout-link:hover {
    color: #8a1f17;
    background: #fff1f0;
}

.page-bg-glow {
    position: fixed;
    inset: 74px 0 auto;
    height: 180px;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(23, 76, 126, .06), transparent);
    z-index: -1;
}
.container { width: min(1180px, calc(100% - 32px)); margin: 28px auto 52px; }
.footer {
    width: 100%;
    margin: 0;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 15px max(16px, calc((100vw - 1180px) / 2));
    color: rgba(255,255,255,.86);
    font-size: 12px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    border-radius: 0;
    box-shadow: 0 -8px 24px rgba(13, 51, 92, .12);
}

.page-head {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 18px;
}
.hero-head {
    padding: 22px;
    border: 1px solid rgba(220, 229, 240, .80);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(255,255,255,.92), rgba(255,255,255,.74)),
        radial-gradient(circle at 95% 10%, rgba(184,134,11,.15), transparent 18rem);
    box-shadow: var(--shadow-sm);
}
h1, h2, h3 { margin-top: 0; color: var(--heading); letter-spacing: -.02em; font-family: "Aptos Display", Aptos, "Segoe UI", ui-sans-serif, system-ui, sans-serif; }
h1 { font-size: clamp(28px, 3vw, 40px); line-height: 1.08; margin-bottom: 8px; }
h2 { font-size: 21px; margin-bottom: 14px; }
h3 { font-size: 15px; margin-bottom: 10px; }
.muted { color: var(--muted); margin-top: 0; line-height: 1.6; }
.center { text-align: center; }
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 9px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .13em;
    text-transform: uppercase;
}
.eyebrow::before {
    content: "";
    display: inline-block;
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    opacity: .65;
}

.panel, .auth-card, .panel-soft {
    background: var(--panel);
    border: 1px solid rgba(220, 229, 240, .92);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.panel {
    padding: 24px;
    overflow: hidden;
}
.panel + .panel { margin-top: 18px; }
.panel-soft {
    background: linear-gradient(145deg, rgba(255,255,255,.84), rgba(255,255,255,.68));
    backdrop-filter: blur(12px);
}
.narrow { max-width: 780px; margin: 0 auto; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 14px; }
.panel-head h2 { margin-bottom: 0; }

.auth-shell {
    min-height: calc(100vh - 160px);
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, .72fr);
    gap: 26px;
    align-items: center;
    padding: 34px 0;
}
.auth-hero {
    color: #fff;
    background:
        linear-gradient(135deg, rgba(15, 39, 66, .96), rgba(18, 63, 103, .92)),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,.22), transparent 18rem);
    border-color: rgba(255,255,255,.16);
    padding: clamp(28px, 4vw, 48px);
    min-height: 430px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.auth-hero .eyebrow { color: #f0cb63; }
.auth-hero h1 { color: #fff; font-size: clamp(34px, 5vw, 56px); max-width: 720px; }
.auth-hero p { color: rgba(255,255,255,.76); font-size: 17px; max-width: 640px; line-height: 1.7; }
.auth-points { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.auth-points span {
    border: 1px solid rgba(255,255,255,.18);
    color: rgba(255,255,255,.88);
    background: rgba(255,255,255,.08);
    padding: 9px 12px;
    border-radius: 0;
    font-size: 13px;
    font-weight: 750;
}
.auth-card { padding: 28px; width: 100%; }
.auth-card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.auth-card-head h1 { font-size: 28px; margin-bottom: 2px; }
.full-width { width: 100%; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.stats-grid a { color: inherit; text-decoration: none; }
.stat {
    display: block;
    position: relative;
    min-height: 138px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.90)),
        radial-gradient(circle at 85% 20%, rgba(23,76,126,.10), transparent 8rem);
    border: 1px solid rgba(220, 229, 240, .95);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: rgba(23, 76, 126, .30); }
.stat:focus-visible { outline: 3px solid rgba(23, 76, 126, .28); outline-offset: 3px; }
.stat::after {
    content: "";
    position: absolute;
    right: -26px;
    top: -26px;
    width: 88px;
    height: 88px;
    border-radius: 0;
    border: 18px solid rgba(23, 76, 126, .06);
}
.stat strong { display: block; font-size: 38px; color: var(--primary); line-height: 1; margin: 10px 0 8px; }
.stat .stat-label, .stat span { color: var(--heading); font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: .07em; }
.stat small { color: var(--muted); font-size: 13px; }

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
}
table { width: 100%; border-collapse: collapse; min-width: 780px; }
th, td { text-align: left; padding: 15px 14px; border-bottom: 1px solid #edf2f7; vertical-align: middle; }
th {
    font-size: 11px;
    text-transform: uppercase;
    color: #667085;
    letter-spacing: .08em;
    background: #f8fafc;
    font-weight: 900;
}
tbody tr { transition: background .16s ease, transform .16s ease; }
tbody tr:hover { background: #fbfdff; }
tbody tr:last-child td { border-bottom: 0; }
tr.overdue { background: #fff8f1; }
tr.overdue:hover { background: #fff4e8; }
.record-id { font-weight: 900; color: var(--primary); }
.soft-tag {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 0;
    background: #f1f5f9;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
}
small { color: var(--muted); }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 0;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 850;
    background: var(--primary-soft);
    color: #174c7e;
    border: 1px solid rgba(23,76,126,.12);
    white-space: nowrap;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: currentColor; opacity: .72; }
.badge.submitted { background: var(--warning-soft); color: var(--warning); border-color: #fed7aa; }
.badge.completed, .badge.project_uploaded, .badge.sme_approved, .badge.team_leader_approved, .badge.project_manager_approved { background: var(--success-soft); color: var(--success); border-color: #b7edcd; }
.badge.returned_to_editor { background: var(--danger-soft); color: var(--danger); border-color: #ffd0cc; }
.badge.assigned_to_team_leader, .badge.assigned_to_sme, .badge.sent_to_editor { background: #eef4ff; color: #1849a9; border-color: #c7d7fe; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 15px;
    border-radius: 13px;
    border: 1px solid var(--border-strong);
    background: #fff;
    color: #1f2937;
    font-weight: 850;
    cursor: pointer;
    text-decoration: none;
    box-shadow: var(--shadow-xs);
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 18px rgba(15,23,42,.10); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn.primary { background: linear-gradient(135deg, var(--primary), #24699f); border-color: transparent; color: white; box-shadow: 0 12px 24px rgba(23,76,126,.22); }
.btn.primary:hover { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); color: #fff; }
.btn.success { background: linear-gradient(135deg, #087443, #0b8f55); border-color: transparent; color: white; }
.btn.danger { background: linear-gradient(135deg, #a32118, #d92d20); border-color: transparent; color: white; }
.btn.small { padding: 7px 11px; font-size: 12px; border-radius: 10px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.form-grid { display: grid; gap: 16px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.single { grid-template-columns: 1fr; }
.form-grid .full { grid-column: 1 / -1; }
label { display: grid; gap: 8px; color: #344054; font-weight: 850; font-size: 13px; }
input, select, textarea {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid var(--border-strong);
    border-radius: 13px;
    color: var(--heading);
    background: #fff;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input::placeholder, textarea::placeholder { color: #98a2b3; }
input:focus, select:focus, textarea:focus {
    border-color: rgba(23, 76, 126, .65);
    box-shadow: 0 0 0 4px rgba(23, 76, 126, .10);
    background: #fff;
}
textarea { resize: vertical; min-height: 44px; }
select { cursor: pointer; }
.checkbox-line { display: flex; align-items: center; gap: 10px; margin-top: 25px; }
.checkbox-line input { width: 18px; height: 18px; }
.actions, .form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.stack-form { display: grid; gap: 12px; margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.stack-form:last-child { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(330px, .75fr); gap: 18px; align-items: start; margin-bottom: 18px; }
.details { display: grid; grid-template-columns: 180px 1fr; gap: 11px 16px; }
.details dt { font-weight: 900; color: #667085; }
.details dd { margin: 0; line-height: 1.55; }
.action-panel { position: sticky; top: 94px; }

.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.timeline li {
    position: relative;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    padding: 13px 14px 13px 16px;
    background: #fbfdff;
    border-radius: 0 14px 14px 0;
}
.timeline li::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 18px;
    width: 12px;
    height: 12px;
    border-radius: 0;
    background: var(--primary);
    border: 2px solid #fff;
}
.timeline span { display: block; color: var(--muted); font-size: 12px; }
.timeline p { margin: 7px 0 0; color: #475467; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip {
    padding: 9px 12px;
    border-radius: 0;
    background: #f1f5f9;
    color: #334155;
    font-size: 12px;
    font-weight: 850;
    border: 1px solid transparent;
}
.chip:hover { background: #e8eef6; }
.chip.active { background: var(--primary); color: white; box-shadow: 0 8px 16px rgba(23,76,126,.18); }
.flash-wrap { display: grid; gap: 10px; margin-bottom: 16px; }
.flash {
    padding: 13px 15px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: #fff;
    box-shadow: var(--shadow-xs);
    font-weight: 700;
}
.flash.success { border-color: #abefc6; background: #ecfdf3; color: #067647; }
.flash.danger { border-color: #fecdca; background: #fef3f2; color: #b42318; }
.flash.warning { border-color: #fedf89; background: #fffaeb; color: #b54708; }
.flash.info { border-color: #b2ddff; background: #eff8ff; color: #175cd3; }
.empty, .empty-state {
    padding: 34px;
    text-align: center;
    color: var(--muted);
    background: #f8fafc;
    border-radius: 18px;
    border: 1px dashed var(--border-strong);
}
.empty-icon {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border-radius: 14px;
    background: #eef4ff;
    color: var(--primary);
    font-size: 22px;
    margin-bottom: 10px;
}
.empty-state strong { display: block; color: var(--heading); margin-bottom: 6px; }
.empty-state p { margin: 0; }
.hidden { display: none; }
.notice {
    padding: 13px 14px;
    border: 1px dashed var(--border-strong);
    border-radius: 0;
    color: var(--muted);
    background: #f8fafc;
    line-height: 1.6;
}
.notice.compact { margin: 0 0 16px; font-size: 13px; }
.success-box { background: var(--success-soft); border-color: #abefc6; color: #067647; }
.approve-box { background: #f6fef9; border: 1px solid #abefc6; border-radius: 16px; padding: 14px; }
.return-box { background: #fffbfa; border: 1px solid #fecdca; border-radius: 16px; padding: 14px; }
.danger-text { color: var(--danger); font-weight: 900; }

.workflow-hierarchy { line-height: 1.6; margin-top: 4px; }
.workflow-line { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 9px; }
.workflow-stage {
    display: inline-flex;
    align-items: center;
    font-weight: 750;
    color: #64748b;
    font-size: 12px;
}
.workflow-stage.current-stage {
    padding: 5px 10px;
    border: 1px solid rgba(23, 76, 126, .22);
    border-radius: 0;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 950;
    box-shadow: 0 5px 14px rgba(23, 76, 126, 0.13);
}
.workflow-arrow { color: #a3afbf; font-weight: 900; }

.proposer-card {
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(135deg, #f8fafc, #ffffff);
    line-height: 1.7;
}
.actions-cell { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions-cell form { margin: 0; }
.user-summary {
    display: grid;
    gap: 6px;
    padding: 15px 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(135deg, #f8fafc, #fff);
    margin-bottom: 18px;
}
.user-summary span { color: #64748b; }

@media (max-width: 1100px) {
    .brand { min-width: 210px; }
    .brand-copy small { display: none; }
    .nav-link { white-space: nowrap; padding: 9px 10px; }
    .user-trigger-name { display: none; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-hero { min-height: auto; }
}
@media (max-width: 780px) {
    .topbar-inner { flex-wrap: wrap; padding: 10px 16px; align-items: flex-start; }
    .topbar-right { width: 100%; flex-wrap: nowrap; justify-content: flex-end; margin-left: 0; white-space: nowrap; }
    .brand { min-width: 0; }
    .nav-links { width: auto; justify-content: flex-end; padding-bottom: 2px; }
    .user-menu { margin-left: 0; }
    .user-dropdown { right: 0; }
}

@media (max-width: 820px) {
    .container { width: min(100% - 24px, 1180px); }
    .page-head, .footer { flex-direction: column; align-items: flex-start; }
    .stats-grid, .detail-grid, .form-grid.two { grid-template-columns: 1fr; }
    .action-panel { position: static; }
    .details { grid-template-columns: 1fr; gap: 6px; }
    .panel, .auth-card { padding: 18px; border-radius: 0; }
    .auth-shell { padding: 18px 0; min-height: auto; }
    h1 { font-size: 30px; }
}
@media (max-width: 520px) {
    .topbar-inner { gap: 10px; }
    .topbar-right { justify-content: space-between; gap: 8px; }
    .nav-links { flex: 1 1 auto; justify-content: flex-start; }
    .nav-link { padding: 8px 9px; font-size: 12px; }
    .user-trigger { padding: 0 7px; }
    .user-dropdown { right: 0; width: min(245px, calc(100vw - 24px)); }

    body.app-guest { background: #f3f7fb; }
    .brand-copy small, .user-meta small { display: none; }
    .brand { min-width: 0; }
    .brand-copy strong { font-size: 14px; }
    .stats-grid { gap: 12px; }
    .stat { min-height: auto; }
    .auth-hero { display: none; }
    .actions, .form-actions { align-items: stretch; }
    .actions .btn, .form-actions .btn { width: 100%; }
}


/* Enforce the requested square / pointed interface style. */
:where(.topbar, .topbar-inner, .container, .footer, .panel, .auth-card, .panel-soft, .hero-head, .stat, .table-wrap, .btn, input, select, textarea, .flash, .empty, .empty-state, .notice, .approve-box, .return-box, .proposer-card, .user-summary, .chip, .badge, .soft-tag, .auth-points span, .workflow-stage.current-stage, .brand-mark, .brand-mark.large, .nav-link, .user-menu, .user-trigger, .user-avatar, .user-dropdown, .user-dropdown a, .timeline li, .empty-icon) {
    border-radius: 0 !important;
}
