/* ═══════════════════════════════════════════════════════════════════════════
   PBX Directory Portal — Stylesheet
   Matches the Node Systems IAX Portal dark-purple aesthetic
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    /* ── Core Palette ────────────────────────────────────────────────────── */
    --bg-base: #090610;
    --bg-card: rgba(18, 14, 28, 0.85);
    --bg-card-solid: #120e1c;
    --bg-card-hover: rgba(28, 22, 42, 0.95);
    --bg-input: rgba(15, 11, 24, 0.9);
    --bg-modal: rgba(6, 3, 12, 0.85);

    --border-color: rgba(147, 51, 234, 0.2);
    --border-hover: rgba(147, 51, 234, 0.45);
    --border-subtle: rgba(255, 255, 255, 0.06);

    /* ── Purple System ───────────────────────────────────────────────────── */
    --purple-primary: #9333ea;
    --purple-hover: #7e22ce;
    --purple-light: #c084fc;
    --purple-glow: rgba(147, 51, 234, 0.35);
    --purple-bg: rgba(147, 51, 234, 0.1);

    /* ── Semantic Colors ─────────────────────────────────────────────────── */
    --green-main: #10b981;
    --green-bg: rgba(16, 185, 129, 0.12);
    --green-border: rgba(16, 185, 129, 0.3);

    --blue-main: #3b82f6;
    --blue-bg: rgba(59, 130, 246, 0.12);
    --blue-border: rgba(59, 130, 246, 0.3);

    --amber-main: #f59e0b;
    --amber-bg: rgba(245, 158, 11, 0.12);
    --amber-border: rgba(245, 158, 11, 0.3);

    --red-main: #ef4444;
    --red-bg: rgba(239, 68, 68, 0.12);
    --red-border: rgba(239, 68, 68, 0.3);

    --cyan-main: #06b6d4;
    --cyan-bg: rgba(6, 182, 212, 0.12);

    --fuchsia-main: #c026d3;
    --fuchsia-bg: rgba(192, 38, 211, 0.12);

    /* ── Text ────────────────────────────────────────────────────────────── */
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;

    /* ── Spacing & Shape ─────────────────────────────────────────────────── */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 9999px;

    /* ── Transitions ─────────────────────────────────────────────────────── */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-med: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ────────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-base);
    background-image:
        radial-gradient(circle at 15% 15%, rgba(147, 51, 234, 0.15) 0%, transparent 45%),
        radial-gradient(circle at 85% 85%, rgba(79, 70, 229, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(147, 51, 234, 0.05) 0%, transparent 70%);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(147, 51, 234, 0.3);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(147, 51, 234, 0.5); }

/* ═══════════════════════════════════════════════════════════════════════════
   LOGIN SCREEN
   ═══════════════════════════════════════════════════════════════════════════ */

.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

/* Floating ambient orbs */
.login-ambient-orb,
.ambient-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}

.login-ambient-orb--1 {
    width: 500px; height: 500px;
    top: -150px; left: -100px;
    background: rgba(147, 51, 234, 0.2);
    animation: floatOrb 20s ease-in-out infinite;
}
.login-ambient-orb--2 {
    width: 400px; height: 400px;
    bottom: -100px; right: -80px;
    background: rgba(79, 70, 229, 0.18);
    animation: floatOrb 25s ease-in-out infinite reverse;
}
.login-ambient-orb--3 {
    width: 300px; height: 300px;
    top: 50%; left: 60%;
    background: rgba(192, 38, 211, 0.12);
    animation: floatOrb 18s ease-in-out infinite 5s;
}

.ambient-orb--1 {
    width: 600px; height: 600px;
    top: -200px; right: -150px;
    background: rgba(147, 51, 234, 0.12);
    animation: floatOrb 30s ease-in-out infinite;
}
.ambient-orb--2 {
    width: 500px; height: 500px;
    bottom: -200px; left: -150px;
    background: rgba(79, 70, 229, 0.1);
    animation: floatOrb 25s ease-in-out infinite reverse;
}

@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -20px) scale(1.05); }
    50% { transform: translate(-20px, 30px) scale(0.95); }
    75% { transform: translate(20px, 20px) scale(1.02); }
}

.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    text-align: center;
    box-shadow:
        0 0 40px rgba(147, 51, 234, 0.08),
        0 25px 50px rgba(0, 0, 0, 0.4);
    animation: cardEntry 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardEntry {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

/* ── Brand Icon & Title ──────────────────────────────────────────────────── */

.brand-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--purple-primary), #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 0 20px var(--purple-glow);
    flex-shrink: 0;
}

.brand-icon--sm {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
}

.brand-title {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, #ffffff 40%, var(--purple-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-title--sm {
    font-size: 1.15rem;
}

/* ── Badges ──────────────────────────────────────────────────────────────── */

.badge-secure {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.8rem;
    background: var(--green-bg);
    border: 1px solid var(--green-border);
    border-radius: var(--radius-pill);
    color: #6ee7b7;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1.5rem;
}

.badge-live {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    background: var(--green-bg);
    border: 1px solid var(--green-border);
    border-radius: var(--radius-pill);
    color: #6ee7b7;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
}

.pulse-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--green-main);
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

/* ── Login Form ──────────────────────────────────────────────────────────── */

.login-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.35rem;
}

.login-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.75rem;
}

.alert-error {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    background: var(--red-bg);
    border: 1px solid var(--red-border);
    border-radius: var(--radius-sm);
    color: #fca5a5;
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
    animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 50%, 90% { transform: translateX(-4px); }
    30%, 70% { transform: translateX(4px); }
}

.login-form {
    text-align: left;
}

.form-group {
    margin-bottom: 1.15rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.45rem;
}

.label-optional {
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    color: var(--text-dim);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-dim);
    pointer-events: none;
    transition: color var(--transition-fast);
}

.input-wrapper input:focus ~ .input-icon,
.input-wrapper input:focus + .input-icon {
    color: var(--purple-light);
}

.form-input,
.form-select,
.input-wrapper input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    outline: none;
}

.input-wrapper input {
    padding-left: 2.75rem;
}

.form-input--mono {
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.02em;
}

.form-input:focus,
.form-select:focus,
.input-wrapper input:focus {
    border-color: var(--purple-primary);
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.15);
}

.form-input::placeholder,
.input-wrapper input::placeholder {
    color: var(--text-dim);
}

.form-select {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 2.5rem;
}

.form-select option {
    background: var(--bg-card-solid);
    color: var(--text-main);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.toggle-password {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px;
    display: flex;
    transition: color var(--transition-fast);
}

.toggle-password:hover {
    color: var(--purple-light);
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn-login {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.85rem;
    background: linear-gradient(135deg, var(--purple-primary), #6366f1);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 15px rgba(147, 51, 234, 0.3);
    margin-top: 0.5rem;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(147, 51, 234, 0.45);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.15rem;
    background: linear-gradient(135deg, var(--purple-primary), #6366f1);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 10px rgba(147, 51, 234, 0.25);
    white-space: nowrap;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(147, 51, 234, 0.4);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.15rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    border-color: var(--border-hover);
    color: var(--text-main);
    background: rgba(147, 51, 234, 0.08);
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.15rem;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    border-color: var(--border-hover);
    color: var(--purple-light);
    background: var(--purple-bg);
}

.btn-icon--danger:hover {
    border-color: var(--red-border);
    color: #fca5a5;
    background: var(--red-bg);
}

.btn-icon--ghost {
    background: transparent;
    border-color: transparent;
}

.btn-icon--ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: transparent;
}

.btn-icon--sm {
    width: 32px; height: 32px;
}

.btn-icon--inline {
    width: 30px; height: 30px;
    border-radius: 6px;
}

/* ── Login Footer ────────────────────────────────────────────────────────── */

.login-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.75rem;
    font-size: 0.7rem;
    color: var(--text-dim);
}

/* ═══════════════════════════════════════════════════════════════════════════
   PORTAL (Management Dashboard)
   ═══════════════════════════════════════════════════════════════════════════ */

.portal-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* ── Header ──────────────────────────────────────────────────────────────── */

.portal-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(9, 6, 16, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ── Main Content ────────────────────────────────────────────────────────── */

.portal-main {
    flex: 1;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

/* ── Hero Section ────────────────────────────────────────────────────────── */

.hero-section {
    text-align: center;
    margin-bottom: 2rem;
}

.hero-title {
    font-size: 2.25rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: #fff;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    max-width: 580px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ── Stats Bar ───────────────────────────────────────────────────────────── */

.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-med);
}

.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.stat-icon {
    width: 42px; height: 42px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon--purple {
    background: var(--purple-bg);
    color: var(--purple-light);
    border: 1px solid rgba(147, 51, 234, 0.2);
}

.stat-icon--blue {
    background: var(--blue-bg);
    color: var(--blue-main);
    border: 1px solid var(--blue-border);
}

.stat-icon--green {
    background: var(--green-bg);
    color: var(--green-main);
    border: 1px solid var(--green-border);
}

.stat-icon--amber {
    background: var(--amber-bg);
    color: var(--amber-main);
    border: 1px solid var(--amber-border);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    font-feature-settings: 'tnum';
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

/* ── Toolbar ─────────────────────────────────────────────────────────────── */

.toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-wrapper {
    position: relative;
    flex: 1;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 2.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: all var(--transition-fast);
}

.search-input:focus {
    border-color: var(--purple-primary);
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.12);
}

.search-input::placeholder {
    color: var(--text-dim);
}

/* ── Directory Content ───────────────────────────────────────────────────── */

.directory-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Branch Card */
.branch-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-med);
    animation: fadeSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.branch-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 4px 20px rgba(147, 51, 234, 0.08);
}

.branch-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: rgba(147, 51, 234, 0.04);
    border-bottom: 1px solid var(--border-subtle);
}

.branch-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.branch-icon {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--purple-primary), #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.branch-name {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.branch-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.branch-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Entry Table */
.entry-table-wrapper {
    overflow-x: auto;
}

.entry-table {
    width: 100%;
    border-collapse: collapse;
}

.entry-table thead th {
    padding: 0.65rem 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(147, 51, 234, 0.02);
}

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

.entry-table tbody tr:hover {
    background: rgba(147, 51, 234, 0.04);
}

.entry-table tbody td {
    padding: 0.7rem 1rem;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

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

.ext-badge {
    display: inline-flex;
    padding: 0.25rem 0.65rem;
    background: var(--purple-bg);
    border: 1px solid rgba(147, 51, 234, 0.2);
    border-radius: var(--radius-pill);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--purple-light);
    letter-spacing: 0.02em;
}

.type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.type-badge--user { background: var(--blue-bg); color: var(--blue-main); border: 1px solid var(--blue-border); }
.type-badge--ivr { background: var(--fuchsia-bg); color: var(--fuchsia-main); border: 1px solid rgba(192, 38, 211, 0.3); }
.type-badge--queue { background: var(--amber-bg); color: var(--amber-main); border: 1px solid var(--amber-border); }
.type-badge--ringgroup { background: var(--cyan-bg); color: var(--cyan-main); border: 1px solid rgba(6, 182, 212, 0.3); }
.type-badge--conference { background: var(--green-bg); color: var(--green-main); border: 1px solid var(--green-border); }
.type-badge--voicemail { background: rgba(168, 85, 247, 0.12); color: #a855f7; border: 1px solid rgba(168, 85, 247, 0.3); }
.type-badge--parking { background: rgba(236, 72, 153, 0.12); color: #ec4899; border: 1px solid rgba(236, 72, 153, 0.3); }
.type-badge--misc { background: rgba(107, 114, 128, 0.12); color: #9ca3af; border: 1px solid rgba(107, 114, 128, 0.3); }

.status-dot {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
}

.status-dot::before {
    content: '';
    width: 7px; height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot--active::before { background: var(--green-main); box-shadow: 0 0 6px rgba(16, 185, 129, 0.4); }
.status-dot--inactive::before { background: var(--red-main); box-shadow: 0 0 6px rgba(239, 68, 68, 0.4); }
.status-dot--reserved::before { background: var(--amber-main); box-shadow: 0 0 6px rgba(245, 158, 11, 0.4); }

.entry-actions {
    display: flex;
    gap: 0.3rem;
}

.entry-notes {
    color: var(--text-dim);
    font-size: 0.82rem;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Add Entry Row */
.add-entry-row {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-subtle);
    background: rgba(147, 51, 234, 0.02);
}

.btn-add-entry {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.85rem;
    background: transparent;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-add-entry:hover {
    border-color: var(--purple-primary);
    color: var(--purple-light);
    background: var(--purple-bg);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    width: 64px; height: 64px;
    border-radius: var(--radius-lg);
    background: var(--purple-bg);
    border: 1px solid rgba(147, 51, 234, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--purple-light);
    margin-bottom: 1.25rem;
}

.empty-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.45rem;
}

.empty-subtitle {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

/* ── Modals ──────────────────────────────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-modal);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: modalFadeIn 0.2s ease;
}

.modal-overlay.active {
    display: flex;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-card--wide { max-width: 560px; }
.modal-card--xl { max-width: 750px; }
.modal-card--sm { max-width: 380px; }

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
}

.modal-title--danger {
    color: #fca5a5;
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-subtle);
}

.confirm-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ── XML Preview ─────────────────────────────────────────────────────────── */

.xml-preview-code {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    line-height: 1.7;
    color: var(--purple-light);
    overflow: auto;
    max-height: 60vh;
    white-space: pre;
    tab-size: 2;
}

/* ── Toast Notifications ─────────────────────────────────────────────────── */

.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 1.15rem;
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    font-size: 0.85rem;
    color: var(--text-main);
    animation: toastIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    min-width: 260px;
}

.toast--success { border-color: var(--green-border); }
.toast--error { border-color: var(--red-border); }

.toast-icon--success { color: var(--green-main); }
.toast-icon--error { color: var(--red-main); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(30px); }
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

.portal-footer {
    border-top: 1px solid var(--border-subtle);
    padding: 1.25rem 1.5rem;
    margin-top: auto;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-text {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-title {
        font-size: 1.65rem;
    }

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

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

    .footer-inner {
        flex-direction: column;
        gap: 0.35rem;
        text-align: center;
    }

    .entry-table thead th:nth-child(5),
    .entry-table tbody td:nth-child(5) {
        display: none;
    }
}

@media (max-width: 480px) {
    .stats-bar {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 1.75rem;
    }

    .container {
        padding: 1.25rem 1rem;
    }

    .header-inner {
        padding: 0.6rem 1rem;
    }
}
