:root {
    --bg: #0f172a;
    --bg-soft: #111827;
    --bg-elevated: #162033;
    --panel: #1e293b;
    --panel-2: #334155;
    --panel-3: #0b1220;
    --border: #475569;
    --border-soft: rgba(255,255,255,0.06);
    --text: #e5e7eb;
    --text-soft: #94a3b8;
    --text-faint: #64748b;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-soft: rgba(59,130,246,0.14);
    --success: #10b981;
    --success-soft: rgba(16,185,129,0.16);
    --danger: #ef4444;
    --danger-soft: rgba(239,68,68,0.16);
    --warning: #f59e0b;
    --warning-soft: rgba(245,158,11,0.16);
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 10px 30px rgba(0,0,0,0.25);
    --shadow-soft: 0 6px 18px rgba(0,0,0,0.18);
    --font: Inter, Arial, Helvetica, sans-serif;
    --content-padding: 24px;
    --transition: 0.2s ease;
    --sidebar-z: 1000;
    --topbar-z: 900;
    --overlay-z: 950;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    height: 100%;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img,
svg {
    display: block;
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    border: 0;
}

input,
select,
textarea {
    width: 100%;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-soft);
    color: var(--text);
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-faint);
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(59,130,246,0.45);
    background: rgba(255,255,255,0.04);
    box-shadow: 0 0 0 4px rgba(59,130,246,0.12);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

hr {
    border: 0;
    border-top: 1px solid var(--border-soft);
    margin: 20px 0;
}

/* =========================
   App Layout
   ========================= */

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: var(--topbar-height) 1fr;
    grid-template-areas:
        "sidebar topbar"
        "sidebar main";
    min-height: calc(100vh - 120px);
}

.sidebar {
    grid-area: sidebar;
    background: linear-gradient(180deg, #0b1220 0%, #111827 100%);
    border-right: 1px solid var(--border-soft);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: var(--sidebar-z);
}

.sidebar::-webkit-scrollbar,
.main::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.sidebar::-webkit-scrollbar-thumb,
.main::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
    border-radius: 999px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.03);
}

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--accent), #60a5fa);
    font-weight: 700;
    color: white;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brand-text strong {
    font-size: 15px;
    line-height: 1.2;
}

.brand-text span {
    font-size: 12px;
    color: var(--text-soft);
    margin-top: 2px;
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-soft);
    padding: 0 12px 6px;
}

.akte-group .nav-title {
    color: #f97316;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    color: var(--text-soft);
    transition: background var(--transition), color var(--transition), transform var(--transition);
    min-height: 44px;
}

.nav-item:hover,
.nav-item.active {
    background: var(--accent-soft);
    color: var(--text);
}

.nav-item:active {
    transform: translateY(1px);
}

.sidebar-spacer {
    flex: 1;
}

.sidebar-footer {
    margin-top: 0;
    padding-top: 6px;
}

.sidebar-card {
    padding: 14px;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.04);
}

.sidebar-card strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
}

.sidebar-card span {
    font-size: 12px;
    color: var(--text-soft);
}

.topbar {
    grid-area: topbar;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: var(--topbar-height);
    padding: 0 24px;
    border-bottom: 1px solid var(--border-soft);
    background: rgba(15,23,42,0.86);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: var(--topbar-z);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.topbar-left h1 {
    margin: 0;
    font-size: 18px;
    line-height: 1.2;
}

.topbar-left span {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-soft);
    line-height: 1.3;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.user-chip,
.status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    color: var(--text-soft);
    font-size: 13px;
    white-space: nowrap;
    border: 1px solid rgba(255,255,255,0.04);
}

.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    color: var(--text);
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
    flex-shrink: 0;
}

.menu-toggle:hover {
    background: rgba(255,255,255,0.1);
}

.menu-toggle:active {
    transform: scale(0.98);
}

.sidebar-overlay {
    display: none;
}

.main {
    grid-area: main;
    padding: var(--content-padding);
    overflow: auto;
    min-width: 0;
    position: relative;
    z-index: 1;
}

/* =========================
   Content
   ========================= */

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

.card {
    background: linear-gradient(180deg, rgba(30,41,59,0.95), rgba(17,24,39,0.95));
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    min-width: 0;
}

.card h2,
.card h3,
.card h4 {
    margin-top: 0;
    margin-bottom: 10px;
    line-height: 1.3;
}

.card-muted {
    color: var(--text-soft);
    font-size: 14px;
    line-height: 1.5;
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.card-header-left {
    min-width: 0;
}

.card-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.span-12 { grid-column: span 12; }
.span-10 { grid-column: span 10; }
.span-9  { grid-column: span 9; }
.span-8  { grid-column: span 8; }
.span-7  { grid-column: span 7; }
.span-6  { grid-column: span 6; }
.span-5  { grid-column: span 5; }
.span-4  { grid-column: span 4; }
.span-3  { grid-column: span 3; }
.span-2  { grid-column: span 2; }

.stat {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-soft);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
}

.stat-meta {
    font-size: 12px;
    color: var(--success);
}

.stat-meta.warning {
    color: var(--warning);
}

.stat-meta.danger {
    color: var(--danger);
}

.table-wrap {
    overflow-x: auto;
    border-radius: 12px;
}

.app-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

.app-table th,
.app-table td {
    text-align: left;
    padding: 14px 12px;
    border-bottom: 1px solid var(--border-soft);
    font-size: 14px;
    vertical-align: middle;
}

.app-table th {
    color: var(--text-soft);
    font-weight: 600;
    white-space: nowrap;
}

.app-table tbody tr {
    transition: background var(--transition);
}

.app-table tbody tr:hover {
    background: rgba(255,255,255,0.025);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1;
    background: var(--accent-soft);
    color: #bfdbfe;
    border: 1px solid rgba(59,130,246,0.12);
    white-space: nowrap;
}

.badge.success {
    background: var(--success-soft);
    color: #a7f3d0;
    border-color: rgba(16,185,129,0.12);
}

.badge.warning {
    background: var(--warning-soft);
    color: #fde68a;
    border-color: rgba(245,158,11,0.12);
}

.badge.danger {
    background: var(--danger-soft);
    color: #fecaca;
    border-color: rgba(239,68,68,0.12);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--accent);
    color: white;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    box-shadow: var(--shadow-soft);
    white-space: nowrap;
}

.btn:hover {
    background: var(--accent-hover);
}

.btn:active {
    transform: translateY(1px);
}

.btn-secondary {
    background: rgba(255,255,255,0.06);
    color: var(--text);
    box-shadow: none;
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.1);
}

.btn-success {
    background: var(--success);
}

.btn-success:hover {
    filter: brightness(1.05);
}

.btn-danger {
    background: var(--danger);
}

.btn-danger:hover {
    filter: brightness(1.05);
}

.btn-block {
    width: 100%;
}

.panel-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.panel-item {
    padding: 14px;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.04);
    transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.panel-item:hover {
    background: rgba(255,255,255,0.045);
    border-color: rgba(255,255,255,0.08);
}

.panel-item strong {
    display: block;
    margin-bottom: 4px;
    line-height: 1.3;
}

.panel-item span {
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.5;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    color: var(--text-soft);
}

.col-12 { grid-column: span 12; }
.col-8  { grid-column: span 8; }
.col-6  { grid-column: span 6; }
.col-4  { grid-column: span 4; }
.col-3  { grid-column: span 3; }

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.empty-state {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-soft);
}

.list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.04);
}

.list-item-main {
    min-width: 0;
}

.list-item-title {
    font-weight: 600;
    margin-bottom: 3px;
}

.list-item-subtitle {
    font-size: 13px;
    color: var(--text-soft);
}

.kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-soft);
    font-size: 12px;
}

/* =========================
   Guest / Auth Layout
   ========================= */

.guest-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, 520px) 1fr;
    background:
        radial-gradient(circle at top left, rgba(59,130,246,0.18), transparent 28%),
        radial-gradient(circle at bottom right, rgba(16,185,129,0.10), transparent 22%),
        linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
}

.guest-layout-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    border-right: 1px solid rgba(255,255,255,0.06);
    background: rgba(11,18,32,0.72);
    backdrop-filter: blur(12px);
}

.guest-layout-panel-inner {
    width: 100%;
    max-width: 380px;
}

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

.guest-brand-logo {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--accent), #60a5fa);
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}

.guest-brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.guest-brand-text strong {
    font-size: 18px;
    line-height: 1.2;
}

.guest-brand-text span {
    font-size: 12px;
    color: var(--text-soft);
    margin-top: 2px;
}

.guest-intro {
    margin-bottom: 24px;
}

.guest-intro h1 {
    margin: 14px 0 10px;
    font-size: 30px;
    line-height: 1.15;
}

.guest-intro p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.7;
    font-size: 15px;
}

.guest-feature-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.guest-feature-item {
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
}

.guest-feature-item strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    line-height: 1.3;
}

.guest-feature-item span {
    display: block;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.6;
}

.guest-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.guest-layout-content {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 28px;
}

.guest-layout-content-inner {
    width: 100%;
    max-width: 460px;
}

.guest-card {
    padding: 28px;
}

.guest-meta {
    margin-top: 14px;
    text-align: center;
    font-size: 12px;
    color: var(--text-faint);
}

/* Breeze / Auth Form Styling innerhalb Guest Card */

.guest-card .mb-4 {
    margin-bottom: 16px;
}

.guest-card .mt-4 {
    margin-top: 16px;
}

.guest-card .mt-6 {
    margin-top: 24px;
}

.guest-card .block {
    display: block;
    width: 100%;
}

.guest-card label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-soft);
}

.guest-card input[type="text"],
.guest-card input[type="email"],
.guest-card input[type="password"] {
    width: 100%;
}

.guest-card .text-sm {
    font-size: 13px;
}

.guest-card .text-gray-600,
.guest-card .text-gray-500,
.guest-card .text-gray-700 {
    color: var(--text-soft) !important;
}

.guest-card .text-red-600,
.guest-card .text-red-500 {
    color: #fca5a5 !important;
}

.guest-card .underline {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.guest-card .items-center {
    display: flex;
    align-items: center;
}

.guest-card .justify-end {
    display: flex;
    justify-content: flex-end;
}

.guest-card .justify-between {
    display: flex;
    justify-content: space-between;
}

.guest-card .w-full {
    width: 100%;
}

.guest-card .rounded-md {
    border-radius: 10px;
}

.guest-card .border-gray-300,
.guest-card .border-gray-400 {
    border-color: rgba(255,255,255,0.08) !important;
}

.guest-card .shadow-sm,
.guest-card .shadow {
    box-shadow: none !important;
}

.guest-card button[type="submit"],
.guest-card input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 14px;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: white;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
    white-space: nowrap;
}

.guest-card button[type="submit"]:hover,
.guest-card input[type="submit"]:hover {
    background: var(--accent-hover);
}

.guest-card button[type="submit"]:active,
.guest-card input[type="submit"]:active {
    transform: translateY(1px);
}

.guest-card .ms-3,
.guest-card .ml-3 {
    margin-left: 12px;
}

.guest-card .me-3,
.guest-card .mr-3 {
    margin-right: 12px;
}

.guest-card .remember-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.guest-card input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

/* =========================
   Welcome Page
   ========================= */

.welcome-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at top left, rgba(59,130,246,0.16), transparent 28%),
        radial-gradient(circle at bottom right, rgba(16,185,129,0.10), transparent 24%),
        linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
}

.welcome-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 32px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

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

.welcome-brand-logo {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--accent), #60a5fa);
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.welcome-brand-text {
    display: flex;
    flex-direction: column;
}

.welcome-brand-text strong {
    font-size: 17px;
    line-height: 1.2;
}

.welcome-brand-text span {
    font-size: 12px;
    color: var(--text-soft);
    margin-top: 2px;
}

.welcome-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.welcome-main {
    flex: 1;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.welcome-hero {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 24px;
    align-items: center;
    min-height: 420px;
}

.welcome-hero-copy h1 {
    margin: 14px 0 14px;
    font-size: 42px;
    line-height: 1.1;
    max-width: 12ch;
}

.welcome-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 22px;
}

.welcome-hero-panel {
    display: flex;
    align-items: stretch;
}

.welcome-grid {
    margin-top: 0;
}

.welcome-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 32px;
    border-top: 1px solid rgba(255,255,255,0.06);
    color: var(--text-faint);
    font-size: 12px;
}

/* =========================
   Auth Forms
   ========================= */

.auth-form-head {
    margin-bottom: 20px;
}

.auth-form-head h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    line-height: 1.2;
}

.auth-form {
    width: 100%;
}

.auth-status {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(16,185,129,0.12);
    border: 1px solid rgba(16,185,129,0.18);
    color: #a7f3d0;
    font-size: 13px;
    line-height: 1.5;
}

.auth-error {
    color: #fca5a5 !important;
    font-size: 13px;
    line-height: 1.5;
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.auth-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.auth-submit {
    min-width: 140px;
    justify-content: center;
}

.auth-actions-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.auth-link {
    font-size: 0.875rem;
    color: #6b7280;
    text-decoration: underline;
    cursor: pointer;
}

.auth-link:hover {
    color: #111827;
}

/* =========================
   Footer
   ========================= */

.site-footer {
    border-top: 1px solid var(--border-soft);
    background: rgba(15,23,42,0.96);
    backdrop-filter: blur(10px);
    padding: 20px 24px;
    position: relative;
    z-index: 1;
}

.site-footer-inner {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.site-footer-col h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    line-height: 1.3;
    color: var(--text);
}

.site-footer-col p {
    margin: 0 0 6px 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-soft);
}

.site-footer-col a {
    color: var(--text-soft);
    text-decoration: none;
    transition: color var(--transition);
}

.site-footer-col a:hover {
    color: var(--text);
}

/* =========================
   Responsive
   ========================= */

@media (max-width: 1400px) {
    :root {
        --sidebar-width: 240px;
    }
}

@media (max-width: 1200px) {
    :root {
        --sidebar-width: 220px;
        --content-padding: 18px;
    }

    .card {
        padding: 16px;
    }

    .stat-value {
        font-size: 24px;
    }

    .page-grid {
        gap: 16px;
    }
}

@media (max-width: 1100px) {
    .guest-layout {
        grid-template-columns: 420px 1fr;
    }
}

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

    .span-12,
    .span-10,
    .span-9,
    .span-8,
    .span-7,
    .span-6,
    .span-5,
    .span-4,
    .span-3,
    .span-2 {
        grid-column: span 2;
    }

    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .col-12,
    .col-8,
    .col-6,
    .col-4,
    .col-3 {
        grid-column: span 2;
    }

    .topbar {
        padding: 0 16px;
    }

    .status-chip {
        display: none;
    }

    .site-footer-inner {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .welcome-hero {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .welcome-hero-copy h1 {
        font-size: 34px;
        max-width: 100%;
    }
}

@media (max-width: 900px) {
    .guest-layout {
        grid-template-columns: 1fr;
    }

    .guest-layout-panel {
        padding: 28px 20px;
        border-right: 0;
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }

    .guest-layout-panel-inner {
        max-width: 100%;
    }

    .guest-layout-content {
        padding: 20px;
    }

    .guest-layout-content-inner {
        max-width: 560px;
    }
}

@media (max-width: 768px) {
    :root {
        --content-padding: 14px;
        --topbar-height: 60px;
    }

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .app-shell {
        grid-template-columns: 1fr;
        grid-template-rows: var(--topbar-height) 1fr;
        grid-template-areas:
            "topbar"
            "main";
        min-height: auto;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -320px;
        width: 300px;
        max-width: calc(100vw - 32px);
        height: 100vh;
        overflow-y: auto;
        transition: left 0.25s ease;
        box-shadow: 18px 0 40px rgba(0,0,0,0.45);
        border-right: 1px solid rgba(255,255,255,0.08);
        z-index: 1000;
        padding-bottom: 24px;
    }

    body.sidebar-open .sidebar {
        left: 0;
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(2,6,23,0.72);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
        z-index: var(--overlay-z);
    }

    body.sidebar-open .sidebar-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 900;
        padding: 0 14px;
    }

    .topbar-left {
        min-width: 0;
        flex: 1;
    }

    .topbar-left h1 {
        font-size: 16px;
    }

    .topbar-left span {
        display: none;
    }

    .topbar-right {
        gap: 8px;
    }

    .status-chip {
        display: none;
    }

    .user-chip {
        font-size: 12px;
        padding: 6px 10px;
        min-height: 34px;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .main {
        padding: 14px;
    }

    .page-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .span-12,
    .span-10,
    .span-9,
    .span-8,
    .span-7,
    .span-6,
    .span-5,
    .span-4,
    .span-3,
    .span-2 {
        grid-column: span 1;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .col-12,
    .col-8,
    .col-6,
    .col-4,
    .col-3 {
        grid-column: span 1;
    }

    .card {
        padding: 14px;
        border-radius: 12px;
    }

    .card-header {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-left,
    .toolbar-right {
        width: 100%;
    }

    .toolbar-right .btn,
    .toolbar-left .btn {
        width: 100%;
    }

    .stat-value {
        font-size: 22px;
    }

    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .app-table {
        min-width: 560px;
    }

    .app-table th,
    .app-table td {
        padding: 10px 8px;
        font-size: 13px;
        white-space: nowrap;
    }

    .list-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .site-footer {
        padding: 18px 14px 24px;
    }

    .site-footer-inner {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .site-footer-col h3 {
        font-size: 13px;
        margin-bottom: 8px;
    }

    .site-footer-col p {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .welcome-header,
    .welcome-main,
    .welcome-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .welcome-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .welcome-nav {
        width: 100%;
    }

    .welcome-nav .btn {
        flex: 1 1 auto;
    }

    .welcome-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .welcome-actions .btn {
        width: 100%;
    }

    .welcome-hero-copy h1 {
        font-size: 28px;
    }

    .welcome-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .guest-layout-panel,
    .guest-layout-content {
        padding: 16px;
    }

    .guest-intro h1 {
        font-size: 24px;
    }

    .guest-intro p {
        font-size: 14px;
    }

    .guest-card {
        padding: 18px;
        border-radius: 12px;
    }

    .guest-nav {
        flex-direction: column;
        align-items: stretch;
    }

    .guest-nav .btn {
        width: 100%;
    }

    .auth-form-head h2 {
        font-size: 22px;
    }

    .auth-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .auth-actions .auth-submit,
    .auth-actions a {
        width: 100%;
    }

    .auth-actions a {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .brand {
        padding: 8px 10px;
    }

    .brand-logo {
        width: 34px;
        height: 34px;
        border-radius: 10px;
        font-size: 13px;
    }

    .brand-text strong {
        font-size: 14px;
    }

    .brand-text span {
        font-size: 11px;
    }

    .nav-item {
        min-height: 42px;
        padding: 10px 12px;
        font-size: 14px;
    }

    .topbar {
        gap: 10px;
    }

    .topbar-left h1 {
        font-size: 15px;
    }

    .topbar-left span {
        display: none;
    }

    .user-chip {
        max-width: 88px;
        padding: 6px 8px;
    }

    .menu-toggle {
        width: 38px;
        height: 38px;
        margin-right: 2px;
    }

    .main {
        padding: 12px;
    }

    .card {
        padding: 12px;
    }

    .card-muted,
    .panel-item span,
    .list-item-subtitle {
        font-size: 12px;
    }

    .stat-label {
        font-size: 12px;
    }

    .stat-value {
        font-size: 20px;
    }

    .badge {
        font-size: 11px;
        padding: 5px 8px;
    }

    .btn {
        min-height: 40px;
        padding: 9px 12px;
        font-size: 14px;
    }

    .app-table {
        min-width: 520px;
    }

    .welcome-brand-logo {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        font-size: 16px;
    }

    .welcome-brand-text strong {
        font-size: 15px;
    }

    .welcome-brand-text span {
        font-size: 11px;
    }

    .welcome-hero-copy h1 {
        font-size: 24px;
    }
}