/* ===== Portal Admin - Lemon Soda / Quadrant Corners ===== */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,800&family=Noto+Sans+JP:wght@300;400;500;600;700&display=swap');

:root {
    --bg: #F6F5F0;
    --bg-card: #FFFFFF;
    --bg-elevated: #EEEDDF;
    --bg-hover: #F0EEE2;
    --bg-input: #FAFAF6;
    --border: #DCD8C4;
    --border-light: #E8E4D4;
    --text: #282418;
    --text-muted: #7C7860;
    --text-dim: #A8A48C;
    --accent: #B89C10;
    --accent-hover: #A08808;
    --accent-light: rgba(184, 156, 16, 0.08);
    --accent-glow: rgba(184, 156, 16, 0.18);
    --success: #448838;
    --success-bg: rgba(68, 136, 56, 0.08);
    --error: #C84848;
    --error-bg: rgba(200, 72, 72, 0.08);
    --warning: #B89C10;
    --warning-bg: rgba(184, 156, 16, 0.08);
    --info: #3C78B0;
    --info-bg: rgba(60, 120, 176, 0.08);
    --sp-1: 4px; --sp-2: 8px; --sp-3: 12px;
    --sp-4: 16px; --sp-5: 20px; --sp-6: 24px;
    --sp-7: 32px; --sp-8: 40px; --sp-9: 48px;
    --radius: 6px;
    --radius-lg: 10px;
    --corner-inset: 28px;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; }
* { font-family: 'DM Sans', 'Noto Sans JP', sans-serif; }
body { background: var(--bg); color: var(--text); min-height: 100vh; margin: 0; }

/* ===== Four Corners Layout ===== */

/* Top-Left: Brand */
.corner-tl {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 900;
    background: #fff;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-bottom-right-radius: 16px;
    padding: 16px 28px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}
.corner-tl-text {
    background-image: linear-gradient(135deg, var(--accent), #D4B830);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.corner-tl img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }

/* Top-Right: User */
.corner-tr {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 900;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 19px 28px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    cursor: pointer;
}
.corner-tr .online-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--success);
    display: inline-block;
}

.corner-tr-dropdown {
    position: absolute;
    top: 100%;
    right: -1px;
    left: -1px;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-right: none;
    border-top: none;
    padding: 0 28px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease, padding 0.25s ease;
    z-index: 901;
}
.corner-tr-dropdown.show {
    max-height: 60px;
    padding: var(--sp-3) 28px;
}
.corner-tr-dropdown a {
    display: block;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: var(--sp-2) 0;
    transition: color 0.15s;
}
.corner-tr-dropdown a:hover { color: var(--error); }

/* Bottom-Left: Navigator */
.corner-bl {
    position: fixed;
    bottom: var(--corner-inset);
    left: var(--corner-inset);
    z-index: 2001;
}
.corner-bl-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 100px;
    height: 100px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    box-shadow: 0 4px 16px rgba(184, 156, 16, 0.25);
}
.corner-bl-btn .hamburger {
    width: 18px;
    height: 12px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.corner-bl-btn .hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: #fff;
    border-radius: 1px;
    transition: all 0.3s ease;
    transform-origin: center;
}
.corner-bl-btn.is-open .hamburger span:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
}
.corner-bl-btn.is-open .hamburger span:nth-child(2) {
    opacity: 0;
}
.corner-bl-btn.is-open .hamburger span:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
}
.corner-bl-btn:hover { background: var(--accent-hover); box-shadow: 0 4px 16px rgba(184, 156, 16, 0.25); opacity: 0.85; }

/* Bottom-Right: Primary Action */
.corner-br {
    position: fixed;
    bottom: var(--corner-inset);
    right: var(--corner-inset);
    z-index: 900;
}
.corner-br .btn-solid {
    border-radius: 50%;
    width: 100px;
    height: 100px;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    line-height: 1.3;
    box-shadow: 0 4px 16px rgba(184, 156, 16, 0.25);
}
.corner-br .btn-solid:hover {
    background: var(--accent-hover);
    opacity: 0.85;
}

/* ===== Navigation Overlay ===== */
.nav-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(246, 245, 240, 0.92);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s, backdrop-filter 0.6s ease;
}
.nav-overlay.show {
    opacity: 1;
    visibility: visible;
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
}

.nav-overlay-close {
    display: none;
    position: absolute;
    bottom: var(--corner-inset);
    left: var(--corner-inset);
    background: var(--accent);
    border: none;
    color: #fff;
    border-radius: 50%;
    width: 100px;
    height: 100px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: all 0.25s;
    box-shadow: 0 4px 16px rgba(184, 156, 16, 0.25);
}
.nav-overlay-close:hover { background: var(--accent-hover); opacity: 0.85; }

.nav-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    max-width: 800px;
    width: 100%;
    padding: var(--sp-6);
}

.nav-grid a {
    display: block;
    text-decoration: none;
    padding: 40px 24px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
    transition: all 0.2s;
    opacity: 0;
}
.nav-overlay.show .nav-grid a {
    opacity: 1;
    transition: all 0.2s, opacity 0.4s ease;
}
.nav-overlay.show .nav-grid a:nth-child(1) { transition-delay: 0.05s; }
.nav-overlay.show .nav-grid a:nth-child(2) { transition-delay: 0.08s; }
.nav-overlay.show .nav-grid a:nth-child(3) { transition-delay: 0.11s; }
.nav-overlay.show .nav-grid a:nth-child(4) { transition-delay: 0.14s; }
.nav-overlay.show .nav-grid a:nth-child(5) { transition-delay: 0.17s; }
.nav-overlay.show .nav-grid a:nth-child(6) { transition-delay: 0.20s; }
.nav-overlay.show .nav-grid a:nth-child(7) { transition-delay: 0.23s; }
.nav-overlay.show .nav-grid a:nth-child(8) { transition-delay: 0.26s; }
.nav-overlay.show .nav-grid a:nth-child(9) { transition-delay: 0.29s; }
.nav-grid a:hover {
    background: var(--bg-elevated);
}
.nav-grid a:hover .room-id { color: var(--border); }
.nav-grid a:hover .room-name { color: var(--text); }

.nav-grid a.is-active {
    background: var(--accent-light);
    border-color: var(--accent);
}
.nav-grid a.is-active .room-id { color: rgba(184, 156, 16, 0.12); }
.nav-grid a.is-active .room-name { color: var(--accent-hover); }

.nav-grid a.wide { grid-column: span 2; }

.nav-grid .room-id {
    font-size: 3rem;
    font-weight: 900;
    color: var(--border-light);
    position: absolute;
    top: -4px;
    right: 8px;
    line-height: 1;
    transition: color 0.2s;
}

.nav-grid .room-name {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    position: relative;
    z-index: 1;
    transition: color 0.15s;
}

.nav-grid .room-sub {
    display: block;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-top: 10px;
    position: relative;
    z-index: 1;
}

/* ===== Legacy sidebar (hidden) ===== */
.sidebar { display: none; }
.top-header { display: none; }
.topbar { display: none; }

/* ===== Main Content ===== */
.main-content {
    margin: 0;
    min-height: 100vh;
    padding: 90px 80px 100px;
}

.content-body {
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeUp 0.4s ease;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Page Title (typography-driven) ===== */
.page-title {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #B8B4A0;
    margin-bottom: var(--sp-7);
    line-height: 1.1;
}
.page-title .title-sub {
    display: block;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 6px;
}

/* ===== Buttons ===== */
.btn-solid,
.btn-purple {
    background: var(--accent);
    border: 1px solid var(--accent);
    color: #fff;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(184, 156, 16, 0.2);
}
.btn-solid:hover, .btn-purple:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
    box-shadow: 0 4px 16px rgba(184, 156, 16, 0.3);
}
.btn-solid:active, .btn-solid:focus,
.btn-purple:active, .btn-purple:focus {
    box-shadow: 0 0 0 3px var(--accent-glow) !important;
}

.btn-ghost,
.btn-outline-purple {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    text-decoration: none;
}
.btn-ghost:hover, .btn-outline-purple:hover {
    border-color: var(--text);
    background: var(--bg-hover);
}

.btn-icon {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 32px; height: 32px;
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    padding: 0;
    font-size: 0.85rem;
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text); border-color: var(--text-dim); }

.btn-reorder {
    width: 26px; height: 26px; padding: 0;
    font-size: 0.72rem; line-height: 1;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.btn-reorder:hover { background: var(--accent-light); border-color: var(--accent); color: var(--accent-hover); }
.btn-reorder:disabled { opacity: 0.25; cursor: not-allowed; }

/* ===== Stat Cards ===== */
.stat-card {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-left: none;
    border-right: none;
    border-radius: 0;
    transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card .card-body { padding: var(--sp-5); }
.stat-card .stat-icon {
    width: 40px; height: 40px; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.stat-card .stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1; color: var(--text); }
.stat-card .stat-label {
    color: var(--text-muted); font-size: 0.65rem; margin-top: var(--sp-1);
    text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600;
}

/* ===== Tables ===== */
.table-container {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-left: none;
    border-right: none;
    border-radius: 0;
    overflow: hidden;
}

.table-container .table-header {
    padding: var(--sp-5) var(--sp-6);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.table-container .table-header h2 {
    font-size: 1.1rem; font-weight: 700; margin: 0; color: var(--text);
}

.table-responsive { overflow-x: auto; }

.data-table, .table { width: 100%; border-collapse: collapse; margin-bottom: 0; }

.data-table thead th, .table thead th {
    background: var(--bg-elevated);
    border-bottom: 2px solid var(--border);
    font-weight: 700;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: var(--sp-3) var(--sp-5);
    white-space: nowrap;
    text-align: left;
}

.data-table tbody td, .table tbody td {
    padding: var(--sp-3) var(--sp-5);
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.82rem;
    color: var(--text);
}
.data-table tbody tr:hover, .table tbody tr:hover { background: var(--bg-hover); }
.data-table tbody tr:last-child td, .table tbody tr:last-child td { border-bottom: none; }
.table tbody tr.clickable { cursor: pointer; }

/* ===== Badges ===== */
[class*="badge-"] {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.4;
}

.badge-draft { background: var(--bg-hover); color: var(--text-muted); }
.badge-pending { background: var(--warning-bg); color: #8C7A08; border: 1px solid rgba(184,156,16,0.15); }
.badge-published { background: var(--success-bg); color: var(--success); border: 1px solid rgba(68,136,56,0.15); }
.badge-rejected { background: var(--error-bg); color: var(--error); border: 1px solid rgba(200,72,72,0.15); }
.badge-active { background: var(--success-bg); color: var(--success); border: 1px solid rgba(68,136,56,0.15); }
.badge-inactive { background: var(--bg-hover); color: var(--text-dim); }
.badge-locked { background: var(--error-bg); color: var(--error); border: 1px solid rgba(200,72,72,0.15); }
.badge-admin { background: var(--accent-light); color: var(--accent-hover); border: 1px solid rgba(184,156,16,0.15); }
.badge-user { background: var(--info-bg); color: var(--info); border: 1px solid rgba(60,120,176,0.15); }

/* ===== Filter Tabs ===== */
.filter-tabs {
    display: flex; gap: 0; margin-bottom: var(--sp-5);
    border-bottom: 2px solid var(--border);
}
.filter-tabs .filter-tab {
    padding: var(--sp-2) var(--sp-5);
    font-size: 0.75rem; font-weight: 600;
    background: transparent; border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted); cursor: pointer;
    transition: all 0.15s; text-decoration: none; margin-bottom: -2px;
}
.filter-tabs .filter-tab:hover { color: var(--text); }
.filter-tabs .filter-tab.active { color: var(--accent-hover); border-bottom-color: var(--accent); font-weight: 700; }

/* ===== Pagination ===== */
.pagination { display: flex; justify-content: center; align-items: center; gap: 2px; }
.pagination a, .pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 32px; height: 32px; padding: 0 8px;
    font-size: 0.75rem; font-weight: 600;
    color: var(--text-muted); border-radius: var(--radius);
    transition: all 0.15s; text-decoration: none;
}
.pagination a:hover { color: var(--accent-hover); background: var(--accent-light); }
.pagination .is-current { color: var(--bg-card); background: var(--text); font-weight: 700; pointer-events: none; }
.pagination .is-disabled { opacity: .3; pointer-events: none; }
.pagination .is-ellipsis { color: var(--text-dim); }

/* ===== Forms ===== */
.field { margin-bottom: var(--sp-5); }
.field input, .field select, .field textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    padding: 10px var(--sp-4);
    color: var(--text);
    background: var(--bg-input);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    outline: none;
}
.field input::placeholder { color: var(--text-dim); }
.field input[readonly] { color: var(--text-muted); background: var(--bg-elevated); }

.field-label {
    display: block; margin-bottom: 6px;
    font-size: 0.62rem; font-weight: 700;
    letter-spacing: .1em; text-transform: uppercase;
    color: var(--text-muted);
}

.form-control, .form-select {
    border: 1px solid var(--border); border-radius: var(--radius);
    font-size: 0.85rem; padding: 10px var(--sp-4);
    color: var(--text); background: var(--bg-input);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    outline: none;
}
.form-control::placeholder { color: var(--text-dim); }
.form-label {
    font-size: 0.65rem; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: var(--sp-1);
}

/* ===== Toast ===== */
.toast-container {
    position: fixed; top: var(--sp-6); right: var(--sp-6);
    z-index: 9999; display: flex; flex-direction: column; gap: var(--sp-2);
}
.toast {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: var(--sp-3) var(--sp-5);
    font-size: 0.82rem; min-width: 280px; color: var(--text);
    display: flex; align-items: center; justify-content: space-between;
    animation: slideIn 0.3s ease;
}
@keyframes slideIn {
    from { opacity: 0; transform: translateX(16px); }
    to { opacity: 1; transform: translateX(0); }
}
.toast.toast-success { border-left: 3px solid var(--success); }
.toast.toast-error { border-left: 3px solid var(--error); }
.toast.toast-warning { border-left: 3px solid var(--warning); }
.toast.toast-info { border-left: 3px solid var(--info); }

/* ===== Loading / Spinner ===== */
.loading-overlay { display: flex; justify-content: center; align-items: center; padding: var(--sp-9); }
.spinner {
    width: 20px; height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Login ===== */
.login-bg { min-height: 100vh; background: var(--bg); display: flex; align-items: center; justify-content: center; }
.login-card {
    max-width: 400px; width: 100%; margin: 2rem;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 2.5rem;
}
.login-card h2 { color: var(--text); font-size: 1rem; font-weight: 700; letter-spacing: 0.06em; }
.login-card .form-label {
    font-size: 0.65rem; font-weight: 700; color: var(--text-muted);
    letter-spacing: 0.08em; margin-bottom: 0.3rem; display: block; text-transform: uppercase;
}
.login-card .form-control {
    width: 100%; padding: 10px 14px;
    border: 1px solid var(--border); border-radius: var(--radius);
    font-size: 0.85rem; background: var(--bg-input); color: var(--text);
    transition: border-color 0.2s;
}
.login-card .form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.login-card .mb-3 { margin-bottom: 1rem; }

.btn-login {
    width: 100%; padding: 12px;
    background: var(--accent); color: #fff; border: none;
    border-radius: var(--radius); font-size: 0.75rem;
    font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
    cursor: pointer; transition: all 0.2s; margin-top: 0.5rem;
}
.btn-login:hover { background: var(--accent-hover); opacity: 0.85; }
.btn-login:disabled { opacity: 0.5; cursor: not-allowed; }

.error-box {
    background: var(--error-bg); color: var(--error);
    padding: 10px 14px; border-radius: var(--radius);
    font-size: 0.82rem; margin-bottom: 1rem; display: none;
    border: 1px solid rgba(200,72,72,0.15);
}
.error-box.show { display: block; }

.divider-text {
    display: flex; align-items: center; margin: var(--sp-5) 0;
    color: var(--text-dim); font-size: 0.75rem;
}
.divider-text::before, .divider-text::after { content: ''; flex: 1; border-bottom: 1px solid var(--border); }
.divider-text span { padding: 0 var(--sp-3); }

/* ===== Modal ===== */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(246, 245, 240, 0.7);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    z-index: 2000;
    align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal-dialog {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 16px 48px rgba(0,0,0,0.1);
    width: 100%; max-width: 520px; max-height: 90vh;
    overflow-y: auto; margin: var(--sp-4);
    animation: modalIn 0.25s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.97) translateY(6px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
    border-bottom: 1px solid var(--border);
    padding: var(--sp-5) var(--sp-6);
    display: flex; justify-content: space-between; align-items: center;
}
.modal-header .modal-title {
    font-size: 0.82rem; font-weight: 700; color: var(--text);
    display: flex; align-items: center; gap: var(--sp-2); margin: 0;
}
.modal-close {
    background: none; border: none; font-size: 18px;
    color: var(--text-dim); cursor: pointer;
    padding: var(--sp-1); line-height: 1; transition: color .2s;
}
.modal-close:hover { color: var(--error); }
.modal-body { padding: var(--sp-6); }
.modal-body hr { border: none; border-top: 1px solid var(--border); margin: var(--sp-5) 0; }
.modal-footer {
    border-top: 1px solid var(--border);
    padding: var(--sp-4) var(--sp-6);
    display: flex; justify-content: flex-end; gap: var(--sp-3);
}

/* ===== Toggle Switch ===== */
.toggle-switch {
    display: flex; align-items: center; gap: var(--sp-2);
    cursor: pointer; font-size: 0.82rem; font-weight: 500; color: var(--text-muted);
}
.toggle-switch input[type="checkbox"] {
    width: 36px; height: 20px; appearance: none; -webkit-appearance: none;
    background: var(--border); border-radius: 10px;
    position: relative; cursor: pointer; transition: background .2s;
    border: none; padding: 0; flex-shrink: 0;
}
.toggle-switch input[type="checkbox"]::after {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 16px; height: 16px; background: #FFFFFF;
    border-radius: 50%; transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle-switch input[type="checkbox"]:checked { background: var(--accent); }
.toggle-switch input[type="checkbox"]:checked::after { transform: translateX(16px); }

.toggle-inline { display: inline-flex; align-items: center; }
.toggle-inline input[type="checkbox"] {
    width: 32px; height: 18px; appearance: none; -webkit-appearance: none;
    background: var(--border); border-radius: 9px;
    position: relative; cursor: pointer; transition: background .2s;
    border: none; padding: 0;
}
.toggle-inline input[type="checkbox"]::after {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 14px; height: 14px; background: #FFFFFF;
    border-radius: 50%; transition: transform .2s;
}
.toggle-inline input[type="checkbox"]:checked { background: var(--accent); }
.toggle-inline input[type="checkbox"]:checked::after { transform: translateX(14px); }

/* ===== Alert ===== */
.alert-box {
    padding: var(--sp-3) var(--sp-4); border-radius: var(--radius);
    font-size: 0.82rem; margin-bottom: var(--sp-4);
    display: flex; align-items: center; gap: var(--sp-2);
}
.alert-box.is-danger { background: var(--error-bg); color: var(--error); border: 1px solid rgba(200,72,72,0.15); }
.alert-box.is-warning { background: var(--warning-bg); color: #8C7A08; border: 1px solid rgba(184,156,16,0.15); }

/* ===== Utilities ===== */
.hidden { display: none !important; }
.btn-sm { padding: var(--sp-1) var(--sp-3) !important; font-size: 0.72rem !important; letter-spacing: 0 !important; text-transform: none !important; }

.btn-secondary {
    background: var(--bg-elevated); border: 1px solid var(--border);
    color: var(--text-muted); padding: 10px 20px; border-radius: var(--radius);
    font-size: 0.75rem; font-weight: 600; cursor: pointer;
    transition: all 0.2s; display: inline-flex; align-items: center; gap: var(--sp-2);
}
.btn-secondary:hover { background: var(--bg-hover); color: var(--text); }

.btn-success {
    background: var(--accent); border: 1px solid var(--accent); color: #fff;
    padding: 10px 24px; border-radius: var(--radius);
    font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s; display: inline-flex; align-items: center; gap: var(--sp-2);
}
.btn-success:hover { background: var(--accent-hover); opacity: 0.85; }

.btn-danger {
    background: transparent; border: 1px solid var(--border); color: var(--text-muted);
    padding: 10px 24px; border-radius: var(--radius);
    font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s; display: inline-flex; align-items: center; gap: var(--sp-2);
}
.btn-danger:hover { border-color: var(--accent); color: var(--accent); }

.btn-outline-danger {
    background: transparent; border: 1px solid var(--error); color: var(--error);
    padding: 10px 20px; border-radius: var(--radius);
    font-size: 0.75rem; font-weight: 600; cursor: pointer;
    transition: all 0.2s; display: inline-flex; align-items: center; gap: var(--sp-2);
}
.btn-outline-danger:hover { background: var(--error-bg); }

.btn-outline-warning {
    background: transparent; border: 1px solid var(--warning); color: #8C7A08;
    padding: 10px 20px; border-radius: var(--radius);
    font-size: 0.75rem; font-weight: 600; cursor: pointer;
    transition: all 0.2s; display: inline-flex; align-items: center; gap: var(--sp-2);
}
.btn-outline-warning:hover { background: var(--warning-bg); }

.btn-outline-secondary {
    background: transparent; border: 1px solid var(--border); color: var(--text-muted);
    padding: 10px 20px; border-radius: var(--radius);
    font-size: 0.75rem; font-weight: 600; cursor: pointer;
    transition: all 0.2s; display: inline-flex; align-items: center; gap: var(--sp-2);
    text-decoration: none;
}
.btn-outline-secondary:hover { background: var(--bg-hover); color: var(--text); }

/* ===== Search row ===== */
.search-row {
    display: flex; align-items: center; gap: var(--sp-4); margin-bottom: var(--sp-6);
}
.search-input-group {
    display: flex; align-items: center; flex: 1;
    max-width: 400px; border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    background: var(--bg-input); transition: border-color .2s, box-shadow .2s;
}
.search-input-group:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.search-input-group .search-icon { padding: 0 var(--sp-3); color: var(--text-dim); font-size: 0.85rem; }
.search-input-group input {
    border: none; outline: none; padding: 10px var(--sp-3); padding-left: 0;
    flex: 1; font-size: 0.82rem; box-shadow: none;
    background: transparent; color: var(--text);
}
.search-input-group input:focus { box-shadow: none; border: none; }
.search-input-group input::placeholder { color: var(--text-dim); }
.search-row .search-actions { margin-left: auto; }

/* ===== Filter card / bar ===== */
.filter-card {
    border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
    border-left: none; border-right: none; border-radius: 0;
    padding: var(--sp-5); margin-bottom: var(--sp-5); background: var(--bg-card);
}
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--sp-4); align-items: end; }
.filter-group { display: flex; flex-direction: column; gap: var(--sp-1); }
.filter-group label { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
.filter-group input, .filter-group select {
    width: 100%; border: 1px solid var(--border); border-radius: var(--radius);
    font-size: 0.85rem; padding: 10px var(--sp-4); color: var(--text); background: var(--bg-input);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.filter-group input:focus, .filter-group select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); outline: none; }
.filter-group input::placeholder { color: var(--text-dim); }

.filter-bar {
    display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap;
    padding: var(--sp-4) var(--sp-5); margin-bottom: var(--sp-4);
    border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
    border-left: none; border-right: none; border-radius: 0; background: var(--bg-card);
}
.filter-bar-label { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.filter-bar input, .filter-bar select {
    border: 1px solid var(--border); border-radius: var(--radius);
    font-size: 0.85rem; padding: 10px var(--sp-4); color: var(--text); background: var(--bg-input);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); outline: none; }
.filter-bar input::placeholder { color: var(--text-dim); }

/* ===== Pagination Bar ===== */
.pagination-bar {
    display: flex; align-items: center; justify-content: flex-end;
    gap: var(--sp-3); padding: var(--sp-2) 0; font-size: 0.85rem;
}
.pagination-bar .page-info { color: var(--text-muted); }
.pagination-bar .pager-link { color: var(--accent-hover); text-decoration: none; font-size: 0.85rem; }
.pagination-bar .pager-link:hover:not(.is-disabled) { text-decoration: underline; }
.pagination-bar .pager-link.is-disabled { color: var(--text-dim); pointer-events: none; }
.pagination-bar .page-size-select {
    border: 1px solid var(--border); border-radius: var(--radius);
    font-size: 0.85rem; padding: var(--sp-1) var(--sp-2); color: var(--text); background: var(--bg-input);
}

/* ===== Stat / Detail / Misc ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--sp-4); margin-bottom: var(--sp-5); }
.stat-card-inner { display: flex; justify-content: space-between; align-items: flex-start; }
.quick-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-5); }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--sp-4); }
.action-buttons { display: flex; gap: var(--sp-3); }
.empty-state { text-align: center; color: var(--text-dim); padding: var(--sp-8) var(--sp-6); }
.empty-state i { font-size: 2rem; }
.empty-state p { margin-top: var(--sp-2); font-size: 0.82rem; }
.inline-flex { display: inline-flex; align-items: center; gap: var(--sp-2); }
.reject-alert { background: var(--error-bg); border: 1px solid rgba(200,72,72,0.15); border-radius: var(--radius); padding: var(--sp-3) var(--sp-4); color: var(--error); font-size: 0.82rem; }
.flex-center { display: flex; justify-content: center; padding: var(--sp-4); }
.detail-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: var(--sp-5); }
.detail-card-header h2 { font-size: 1.1rem; font-weight: 700; color: var(--text); margin: 0; }
.detail-card { background: var(--bg-card); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); border-left: none; border-right: none; border-radius: 0; padding: var(--sp-6); }
.detail-card .detail-label { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: var(--sp-1); }
.detail-card .detail-value { font-size: 0.85rem; margin-bottom: var(--sp-4); color: var(--text); }
.detail-row { display: none; }
.detail-row.show { display: table-row; }
.detail-row td { background: var(--bg-elevated); padding: var(--sp-4) var(--sp-5) !important; }
.detail-row pre { background: var(--bg); color: var(--text); border: 1px solid var(--border); padding: var(--sp-4); border-radius: var(--radius); font-size: 0.75rem; max-height: 300px; overflow: auto; font-family: 'SF Mono','Cascadia Code','Consolas',monospace; }

.text-accent { color: var(--accent-hover); }
.text-muted { color: var(--text-muted) !important; }
.text-dim { color: var(--text-dim); }
.bg-elevated { background: var(--bg-elevated); }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .main-content { padding: 80px 20px 100px; }
    .corner-tl, .corner-tr, .corner-bl, .corner-br { --corner-inset: 16px; }
    .nav-grid { grid-template-columns: repeat(2, 1fr); padding: var(--sp-4); gap: 0; }
    .nav-grid a { padding: var(--sp-4); font-size: 0.78rem; }
    .filter-tabs { overflow-x: auto; }
    .login-card { margin: 1rem; max-width: none; }
    .search-row { flex-wrap: wrap; }
    .search-input-group { max-width: 100%; flex: 1 1 100%; }
}
@media (max-width: 480px) {
    .stat-card .stat-value { font-size: 1.5rem; }
    .stat-card .card-body { padding: var(--sp-4); }
    .nav-grid { grid-template-columns: 1fr; }
}
