/* ── Design System ── */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    --bg-primary: #070b12;
    --bg-secondary: #0d1421;
    --bg-surface: #131d2f;
    --bg-surface-hover: #1a2740;
    --border-subtle: #1e2d46;
    --border-strong: #2a3f60;
    --text-primary: #edf2f9;
    --text-secondary: #a0b8d4;
    --text-muted: #5e7a9a;
    --accent-blue: #4f8cff;
    --accent-blue-glow: rgba(79, 140, 255, 0.15);
    --accent-green: #3ddc84;
    --accent-green-glow: rgba(61, 220, 132, 0.12);
    --accent-red: #ff5a6a;
    --accent-red-glow: rgba(255, 90, 106, 0.10);
    --accent-purple: #b388ff;
    --accent-cyan: #4dd0e1;
    --accent-orange: #ffab40;
    --accent-yellow: #f5c542;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-dropdown: 0 12px 48px rgba(0, 0, 0, 0.6);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --bg-gradient-1: radial-gradient(ellipse at 20% 10%, rgba(79, 140, 255, 0.04) 0%, transparent 60%);
    --bg-gradient-2: radial-gradient(ellipse at 80% 90%, rgba(179, 136, 255, 0.04) 0%, transparent 60%);
    --modal-bg: rgba(7, 11, 18, 0.92);
    --toast-bg: var(--bg-surface);
    --header-bg: rgba(13, 20, 33, 0.92);
}

body.light-mode {
    --bg-primary: #f0f4f9;
    --bg-secondary: #e8ecf2;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f5f7fa;
    --border-subtle: #d0d8e4;
    --border-strong: #b0bccd;
    --text-primary: #1a2332;
    --text-secondary: #3a4a62;
    --text-muted: #7a8ea8;
    --accent-blue: #3b7ad9;
    --accent-blue-glow: rgba(59, 122, 217, 0.12);
    --accent-green: #2b9e5e;
    --accent-green-glow: rgba(43, 158, 94, 0.10);
    --accent-red: #d9444f;
    --accent-red-glow: rgba(217, 68, 79, 0.08);
    --accent-purple: #8b6fd4;
    --accent-cyan: #2a9dab;
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-dropdown: 0 12px 40px rgba(0, 0, 0, 0.12);
    --bg-gradient-1: radial-gradient(ellipse at 20% 10%, rgba(59, 122, 217, 0.04) 0%, transparent 60%);
    --bg-gradient-2: radial-gradient(ellipse at 80% 90%, rgba(139, 111, 212, 0.04) 0%, transparent 60%);
    --modal-bg: rgba(240, 244, 249, 0.92);
    --toast-bg: var(--bg-surface);
    --header-bg: rgba(255, 255, 255, 0.92);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    background-image: var(--bg-gradient-1), var(--bg-gradient-2);
    transition: background 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}

/* ── Header ── */
header {
    background: var(--header-bg);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 14px 32px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background 0.3s, border-color 0.3s;
}

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

header .brand .logo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--accent-blue);
    background: var(--accent-blue-glow);
    border: 1px solid rgba(79, 140, 255, 0.2);
    padding: 5px 14px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    transition: background 0.3s, border-color 0.3s;
}

header .brand h1 {
    font-size: 17px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-primary) 50%, var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
    transition: background 0.3s;
}

header .badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-muted);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    padding: 2px 14px;
    letter-spacing: 0.04em;
    transition: background 0.3s, border-color 0.3s, color 0.3s;
}

header .spacer {
    flex: 1;
}

header .status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

header .status-indicator .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 16px var(--accent-green-glow);
    animation: pulse-dot 2.4s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.4;
        transform: scale(0.8);
    }
}

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

header .theme-toggle {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    padding: 5px 10px;
    transition: var(--transition);
    line-height: 1;
}

header .theme-toggle:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

header .reset-btn {
    background: var(--accent-red-glow);
    border: 1px solid rgba(255, 90, 106, 0.15);
    color: var(--accent-red);
    font-size: 11px;
    font-weight: 600;
    padding: 6px 18px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
}

header .reset-btn:hover {
    background: rgba(255, 90, 106, 0.18);
    transform: scale(1.02);
}

/* ── Navigation ── */
nav {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0 28px;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: none;
    flex-wrap: nowrap;
    transition: background 0.3s, border-color 0.3s;
}

nav::-webkit-scrollbar {
    display: none;
}

nav button {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    padding: 13px 20px;
    white-space: nowrap;
    transition: var(--transition);
    letter-spacing: 0.01em;
    position: relative;
}

nav button:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

nav button .nav-icon {
    margin-right: 8px;
    font-size: 15px;
}

nav button.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

/* ── Dropdown (fixed) ── */
.nav-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nav-dropdown>button {
    padding: 13px 16px;
    cursor: pointer;
    user-select: none;
}

.nav-dropdown>button::after {
    content: '▾';
    font-size: 10px;
    margin-left: 6px;
    color: var(--text-muted);
    transition: var(--transition);
}

.nav-dropdown.open>button::after {
    transform: rotate(180deg);
}

.nav-dropdown .dropdown-menu {
    position: fixed;
    top: 0;
    right: auto;
    min-width: 200px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 6px 0;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px) scale(0.97);
    transition: var(--transition);
    box-shadow: var(--shadow-dropdown);
    z-index: 60;
    backdrop-filter: blur(12px);
}

.nav-dropdown.open .dropdown-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.dropdown-menu button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 9px 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.dropdown-menu button:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.dropdown-menu button .dd-icon {
    font-size: 16px;
    width: 22px;
    text-align: center;
}

.dropdown-menu .divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 4px 12px;
}

/* ── Main ── */
main {
    max-width: 1120px;
    margin: 0 auto;
    padding: 28px 28px 60px;
}

.tab-content {
    display: none;
    animation: fadeSlide 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

/* ── Section ── */
.section {
    margin-bottom: 36px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.section-title-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.section-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 14px;
}

.section-title .count-badge {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 0 14px;
    letter-spacing: 0;
    text-transform: none;
}

.section-title .title-accent {
    width: 3px;
    height: 20px;
    border-radius: 2px;
    background: var(--accent-blue);
    flex-shrink: 0;
}

.edit-title-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    line-height: 1;
    opacity: 0.5;
}

.edit-title-btn:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    opacity: 1;
}

.section-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── Cards ── */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.card:hover {
    border-color: var(--border-strong);
}

/* ── CRUD Buttons ── */
.crud-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 11px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    padding: 5px 16px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
}

.crud-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
}

.crud-btn.add {
    color: var(--accent-green);
    border-color: rgba(61, 220, 132, 0.2);
    background: var(--accent-green-glow);
}

.crud-btn.add:hover {
    background: rgba(61, 220, 132, 0.16);
}

.crud-btn.edit {
    color: var(--accent-blue);
    border-color: rgba(79, 140, 255, 0.15);
    background: var(--accent-blue-glow);
}

.crud-btn.edit:hover {
    background: rgba(79, 140, 255, 0.14);
}

.crud-btn.del {
    color: var(--accent-red);
    border-color: rgba(255, 90, 106, 0.12);
    background: var(--accent-red-glow);
}

.crud-btn.del:hover {
    background: rgba(255, 90, 106, 0.16);
}

.crud-btn.purple {
    color: var(--accent-purple);
    border-color: rgba(179, 136, 255, 0.15);
    background: rgba(179, 136, 255, 0.06);
}

.crud-btn.purple:hover {
    background: rgba(179, 136, 255, 0.14);
}

.crud-btn.orange {
    color: var(--accent-orange);
    border-color: rgba(255, 171, 64, 0.15);
    background: rgba(255, 171, 64, 0.06);
}

.crud-btn.orange:hover {
    background: rgba(255, 171, 64, 0.14);
}

.crud-btn.small {
    padding: 2px 8px;
    font-size: 10px;
    height: 26px;
}

.item-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.item-actions .crud-btn {
    padding: 2px 8px;
    font-size: 10px;
    height: 26px;
}

.empty-state {
    color: var(--text-muted);
    font-size: 13px;
    padding: 36px 16px;
    text-align: center;
    font-style: italic;
}

/* ── Credentials Table ── */
.cred-table {
    width: 100%;
    border-collapse: collapse;
}

.cred-table th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 12px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

.cred-table td {
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

.cred-table tr:last-child td {
    border-bottom: none;
}

.cred-table tr:hover td {
    background: rgba(255, 255, 255, 0.015);
}

.cred-table .resource {
    font-weight: 600;
    color: var(--text-primary);
    width: 150px;
}

.cred-table .detail {
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

.cred-table .pwd {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--accent-green);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.copy-btn {
    background: var(--accent-green-glow);
    border: 1px solid rgba(61, 220, 132, 0.12);
    border-radius: 4px;
    color: var(--accent-green);
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 12px;
    transition: var(--transition);
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
}

.copy-btn:hover {
    background: rgba(61, 220, 132, 0.18);
}

.copy-btn.copied {
    color: var(--accent-blue);
    border-color: rgba(79, 140, 255, 0.2);
    background: var(--accent-blue-glow);
}

/* ── Procedures ── */
.proc-list {
    list-style: none;
}

.proc-step {
    display: flex;
    gap: 16px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-subtle);
    align-items: flex-start;
}

.proc-step:last-child {
    border-bottom: none;
}

.step-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-blue);
    background: var(--accent-blue-glow);
    border: 1px solid rgba(79, 140, 255, 0.12);
    border-radius: 4px;
    padding: 2px 10px;
    flex-shrink: 0;
    margin-top: 1px;
}

.step-body {
    flex: 1;
}

.step-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.step-desc {
    color: var(--text-secondary);
    font-size: 13px;
}

.step-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--accent-cyan);
    background: rgba(77, 208, 225, 0.06);
    border: 1px solid rgba(77, 208, 225, 0.1);
    border-radius: 4px;
    padding: 2px 12px;
    display: inline-block;
    margin-top: 4px;
}

.section .section-header .delete-section-btn {
    background: var(--accent-red-glow);
    border: 1px solid rgba(255, 90, 106, 0.12);
    color: var(--accent-red);
    font-size: 10px;
    font-weight: 600;
    padding: 3px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    height: 28px;
}

.section .section-header .delete-section-btn:hover {
    background: rgba(255, 90, 106, 0.18);
}

/* ── MACL ── */
.macl-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
    background: var(--border-subtle);
}

.macl-item {
    background: var(--bg-surface);
    padding: 12px 18px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr auto;
    gap: 12px;
    align-items: center;
    transition: var(--transition);
}

.macl-item:hover {
    background: var(--bg-surface-hover);
}

.macl-item .m-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 14px;
}
.macl-item .m-role {
    color: var(--accent-blue);
    font-size: 13px;
    font-weight: 500;
}
.macl-item .m-dept {
    color: var(--text-secondary);
    font-size: 13px;
}
.macl-item .m-email {
    color: var(--accent-cyan);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}
.macl-item .m-phone {
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

.macl-item .item-actions {
    margin-left: 0;
    justify-content: flex-end;
}

.macl-section-block {
    margin-bottom: 16px;
}

.macl-section-block .section-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-subtle);
    font-weight: 700;
    color: var(--text-primary);
    font-size: 14px;
}

.macl-section-block .section-block-header .section-title-text {
    display: flex;
    align-items: center;
    gap: 10px;
}

.macl-section-block .section-block-header .section-title-text .count-badge-sm {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 0 10px;
}

.macl-section-block .section-block-header .section-actions-small {
    display: flex;
    gap: 4px;
}

/* ── Custom MACL Blocks (now with items) ── */
.macl-block-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    overflow: hidden;
    transition: var(--transition);
}

.macl-block-card:last-child {
    margin-bottom: 0;
}

.macl-block-card:hover {
    border-color: var(--border-strong);
}

.macl-block-card .block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-subtle);
    font-weight: 700;
    color: var(--text-primary);
    font-size: 15px;
}

.macl-block-card .block-header .block-title-text {
    display: flex;
    align-items: center;
    gap: 10px;
}

.macl-block-card .block-header .block-title-text .count-badge-sm {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 0 10px;
}

.macl-block-card .block-header .block-actions {
    display: flex;
    gap: 4px;
}

.macl-block-card .block-items {
    list-style: none;
}

.macl-block-card .block-item {
    display: flex;
    gap: 16px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-subtle);
    align-items: flex-start;
}

.macl-block-card .block-item:last-child {
    border-bottom: none;
}

.macl-block-card .block-item .item-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-blue);
    background: var(--accent-blue-glow);
    border: 1px solid rgba(79, 140, 255, 0.12);
    border-radius: 4px;
    padding: 2px 10px;
    flex-shrink: 0;
    margin-top: 1px;
}

.macl-block-card .block-item .item-body {
    flex: 1;
}

.macl-block-card .block-item .item-body .item-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.macl-block-card .block-item .item-body .item-desc {
    color: var(--text-secondary);
    font-size: 13px;
}

.macl-block-card .block-item .item-body .item-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--accent-cyan);
    background: rgba(77, 208, 225, 0.06);
    border: 1px solid rgba(77, 208, 225, 0.1);
    border-radius: 4px;
    padding: 2px 12px;
    display: inline-block;
    margin-top: 4px;
}

/* ── Abbreviations ── */
.abbr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1px;
    background: var(--border-subtle);
}

.abbr-item {
    background: var(--bg-surface);
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
}

.abbr-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-purple);
    margin-bottom: 2px;
}

.abbr-meaning {
    font-size: 12px;
    color: var(--text-secondary);
}

.abbr-item .item-actions {
    margin-top: 6px;
    justify-content: flex-end;
}

/* ── Servers ── */
.server-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.server-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 18px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
}

.server-item:last-child {
    border-bottom: none;
}

.server-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 16px var(--accent-green-glow);
    flex-shrink: 0;
    animation: pulse-dot 2.4s ease-in-out infinite;
}

.server-path {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--accent-blue);
    flex: 1;
}

.server-item .copy-btn {
    font-size: 10px;
}

/* ── BHS ── */
.bhs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 1px;
    background: var(--border-subtle);
}

.bhs-item {
    background: var(--bg-surface);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.bhs-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.bhs-status {
    font-weight: 600;
    font-size: 13px;
}

.bhs-meaning {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 1px;
}

.bhs-item .item-actions {
    margin-left: auto;
}

/* ── Journey ── */
.journey-stage {
    display: flex;
    gap: 18px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    align-items: flex-start;
}

.journey-stage:last-child {
    border-bottom: none;
}

.stage-icon {
    font-size: 24px;
    flex-shrink: 0;
    width: 44px;
    text-align: center;
    margin-top: 2px;
}

.stage-body {
    flex: 1;
}

.stage-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.stage-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: 3px;
    padding: 1px 10px;
}

.stage-desc {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 6px;
}

.belt-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.belt-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    padding: 2px 12px;
    border-radius: 4px;
    background: var(--accent-blue-glow);
    border: 1px solid rgba(79, 140, 255, 0.1);
    color: var(--accent-blue);
}

.belt-tag.alt {
    background: rgba(77, 208, 225, 0.06);
    border-color: rgba(77, 208, 225, 0.1);
    color: var(--accent-cyan);
}

/* ── Duty Free ── */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 600px) {
    .two-col {
        grid-template-columns: 1fr;
    }
}

.info-block {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    transition: var(--transition);
}

.info-block:hover {
    border-color: var(--border-strong);
}

.info-block .label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.info-block .value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--accent-cyan);
}

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--modal-bg);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
    padding: 20px;
}

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

.modal {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    max-width: 560px;
    width: 100%;
    padding: 32px 36px 28px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform 0.25s;
    box-shadow: var(--shadow-dropdown);
}

.modal-overlay.open .modal {
    transform: scale(1);
}

.modal h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.modal label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 16px;
    margin-bottom: 4px;
    letter-spacing: 0.02em;
}

.modal input,
.modal textarea,
.modal select {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    padding: 9px 14px;
    outline: none;
    transition: var(--transition);
}

.modal input:focus,
.modal textarea:focus,
.modal select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

.modal textarea {
    resize: vertical;
    min-height: 60px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

.modal .modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    justify-content: flex-end;
}

.modal .modal-actions button {
    border: none;
    border-radius: var(--radius-sm);
    padding: 9px 26px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.modal .modal-actions .btn-cancel {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
}

.modal .modal-actions .btn-cancel:hover {
    background: rgba(255, 255, 255, 0.08);
}

.modal .modal-actions .btn-save {
    background: var(--accent-blue);
    color: #fff;
}

.modal .modal-actions .btn-save:hover {
    background: #3d7ae6;
    transform: scale(1.02);
}

.modal .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 480px) {
    .modal .form-row {
        grid-template-columns: 1fr;
    }
    .modal {
        padding: 20px 16px 18px;
    }
}

.modal .hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Loading ── */
#loading {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(7, 11, 18, 0.92);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-family: 'Inter', sans-serif;
    backdrop-filter: blur(8px);
    flex-direction: column;
}

#loading.show {
    display: flex;
}

#loading .spinner {
    border: 3px solid rgba(255, 255, 255, 0.04);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    animation: spin 0.8s linear infinite;
    margin-bottom: 18px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Toast ── */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--toast-bg);
    border: 1px solid var(--accent-green);
    border-radius: var(--radius-sm);
    padding: 12px 24px;
    color: var(--accent-green);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    opacity: 0;
    transform: translateY(12px);
    transition: var(--transition);
    pointer-events: none;
    z-index: 999;
    box-shadow: var(--shadow-dropdown);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ── Responsive ── */
@media (max-width: 640px) {
    header {
        padding: 10px 16px;
        flex-wrap: wrap;
        gap: 10px;
    }
    header .brand h1 {
        font-size: 14px;
    }
    nav {
        padding: 0 12px;
    }
    nav button {
        font-size: 12px;
        padding: 11px 12px;
    }
    main {
        padding: 16px 12px 40px;
    }
    .cred-table th,
    .cred-table td {
        padding: 8px 10px;
        font-size: 12px;
    }
    .cred-table .resource {
        width: auto;
    }
    .cred-table .pwd {
        font-size: 11px;
    }
    .macl-item {
        grid-template-columns: 1fr;
        gap: 3px;
        padding: 10px 14px;
    }
    .abbr-grid {
        grid-template-columns: 1fr;
    }
    .bhs-grid {
        grid-template-columns: 1fr;
    }
    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .section-actions {
        justify-content: flex-start;
    }
    .two-col {
        grid-template-columns: 1fr;
    }
    .modal {
        padding: 20px 16px 18px;
    }
}