/* ─── Variables ───────────────────────────────────────────────────────────── */
:root {
    --bg:           #000000;
    --bg-card:      rgba(255, 255, 255, 0.02);
    --bg-surface:   rgba(9, 9, 11, 0.85);
    --border:       rgba(255, 255, 255, 0.07);
    --border-hover: rgba(99, 102, 241, 0.35);

    --accent:       #6366f1;
    --accent-2:     #8b5cf6;
    --accent-glow:  rgba(99, 102, 241, 0.4);

    --success:      #22c55e;
    --danger:       #ef4444;

    --text:         #f8fafc;
    --text-muted:   #64748b;

    --radius:    16px;
    --radius-sm: 10px;
}

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

/* ─── Body ────────────────────────────────────────────────────────────────── */
body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
    font-size: 14px;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Dot grid overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    z-index: 0;
}

/* ─── Aurora ──────────────────────────────────────────────────────────────── */
.aurora {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.aurora-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    animation: aurora-drift 24s ease-in-out infinite;
}

.aurora-blob-1 {
    width: 700px; height: 700px;
    background: radial-gradient(circle, #4f46e5 0%, transparent 70%);
    top: -250px; left: -150px;
    opacity: 0.18;
    animation-delay: 0s;
}

.aurora-blob-2 {
    width: 550px; height: 550px;
    background: radial-gradient(circle, #7c3aed 0%, transparent 70%);
    top: -150px; right: -100px;
    opacity: 0.13;
    animation-delay: -8s;
}

.aurora-blob-3 {
    width: 450px; height: 450px;
    background: radial-gradient(circle, #0ea5e9 0%, transparent 70%);
    bottom: 5%; left: 35%;
    opacity: 0.07;
    animation-delay: -16s;
}

@keyframes aurora-drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%       { transform: translate(50px, -40px) scale(1.06); }
    66%       { transform: translate(-35px, 25px) scale(0.94); }
}

/* Ensure all page content sits above aurora */
.navbar, .container, .auth-card, .modal {
    position: relative;
    z-index: 1;
}

/* ─── Auth Page ───────────────────────────────────────────────────────────── */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.auth-card {
    background: rgba(5, 5, 7, 0.88);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius);
    padding: 52px 44px;
    width: 100%;
    max-width: 430px;
    position: relative;
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.08),
                0 40px 80px rgba(0, 0, 0, 0.5);
    animation: fade-in-up 0.5s ease both;
}

/* Top glow stripe */
.auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 15%; right: 15%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(99, 102, 241, 0.9),
        rgba(139, 92, 246, 0.9),
        transparent);
}

/* Spotlight above the card */
.auth-card::after {
    content: '';
    position: absolute;
    top: -240px; left: 50%;
    transform: translateX(-50%);
    width: 700px; height: 500px;
    background: radial-gradient(ellipse at center top,
        rgba(99, 102, 241, 0.14) 0%, transparent 65%);
    pointer-events: none;
    z-index: -1;
}

.logo {
    text-align: center;
    margin-bottom: 40px;
}

.logo-icon {
    font-size: 38px;
    display: block;
    margin-bottom: 14px;
    filter: drop-shadow(0 0 16px rgba(99, 102, 241, 0.9));
}

.logo h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, #e0e7ff 0%, #a5b4fc 55%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}

.logo p {
    color: var(--text-muted);
    font-size: 13px;
}

/* ─── Navbar ──────────────────────────────────────────────────────────────── */
.navbar {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0 28px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 15px;
}

.nav-brand .logo-icon {
    font-size: 22px;
    display: inline;
    margin-bottom: 0;
    filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.8));
}

.nav-brand > span:not(.logo-icon):not(.badge) {
    background: linear-gradient(135deg, #e0e7ff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ─── Container ───────────────────────────────────────────────────────────── */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 36px 24px;
}

.container.container-wide {
    max-width: 1440px;
    margin: 0;
    padding: 36px 40px;
}

/* ─── Page Header ─────────────────────────────────────────────────────────── */
.page-header {
    margin-bottom: 32px;
    animation: fade-in-up 0.35s ease both;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.4px;
    background: linear-gradient(135deg, #f8fafc 0%, #c7d2fe 55%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
}

.page-header p {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
}

/* ─── Stats Row ───────────────────────────────────────────────────────────── */
.stats-row {
    display: flex;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
    text-align: left;
    flex: 0 0 200px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s, transform 0.25s;
    animation: fade-in-up 0.4s ease both;
}

.stats-row .stat-card:nth-child(1) { animation-delay: 0.05s; }
.stats-row .stat-card:nth-child(2) { animation-delay: 0.10s; }
.stats-row .stat-card:nth-child(3) { animation-delay: 0.15s; }

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99,102,241,0.6), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
}

.stat-card:hover::before { opacity: 1; }

.stat-number {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -1.5px;
    line-height: 1;
    background: linear-gradient(135deg, #c7d2fe, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-number.online {
    background: linear-gradient(135deg, #86efac, #22c55e);
    -webkit-background-clip: text;
    background-clip: text;
}

.stat-number.offline {
    background: none;
    -webkit-text-fill-color: var(--text-muted);
}

.stat-label {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 8px;
}

/* ─── Card ────────────────────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    transition: border-color 0.3s;
    animation: fade-in-up 0.4s ease 0.2s both;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99,102,241,0.5), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.card:hover { border-color: rgba(99, 102, 241, 0.2); }
.card:hover::before { opacity: 1; }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.container.container-wide .card-header {
    padding: 18px 20px;
}

.card-header h2 {
    font-size: 15px;
    font-weight: 600;
    background: linear-gradient(135deg, #e0e7ff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-subtitle {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 3px;
    -webkit-text-fill-color: var(--text-muted);
}

/* ─── Table ───────────────────────────────────────────────────────────────── */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

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

.table th {
    text-align: left;
    padding: 12px 28px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap;
}

.table td {
    padding: 16px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 13px;
}

.container.container-wide .table th { padding: 12px 20px; }
.container.container-wide .table td { padding: 14px 20px; }

.cell-truncate {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.table tbody tr { transition: background 0.15s; }
.table tbody tr:hover td { background: rgba(99, 102, 241, 0.04); }

.empty {
    text-align: center;
    color: var(--text-muted);
    padding: 56px !important;
    font-size: 13px;
}

/* ─── Status Badge ────────────────────────────────────────────────────────── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.status-badge.online {
    background: rgba(34, 197, 94, 0.08);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.22);
}

.status-badge.offline {
    background: rgba(100, 116, 139, 0.08);
    color: var(--text-muted);
    border: 1px solid rgba(100, 116, 139, 0.18);
}

.status-badge::before { content: '●'; font-size: 7px; }

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

/* Shimmer sweep */
.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.28);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: -60%;
    left: -80%;
    width: 55%;
    height: 220%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.22), transparent);
    transform: skewX(-18deg);
    transition: left 0.55s ease;
}

.btn-primary:hover {
    box-shadow: 0 0 32px rgba(99, 102, 241, 0.5);
    transform: translateY(-1px);
}

.btn-primary:hover::before { left: 130%; }

.btn-primary:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.14);
}

.btn-danger {
    background: transparent;
    color: #f87171;
    border: 1px solid transparent;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-lg {
    padding: 15px 34px;
    font-size: 15px;
    border-radius: 12px;
    letter-spacing: 0.01em;
}

.full-width { width: 100%; justify-content: center; }

/* ─── Badge ───────────────────────────────────────────────────────────────── */
.badge {
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.badge.admin {
    background: rgba(99, 102, 241, 0.12);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.24);
}

/* ─── Forms ───────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

input, select {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 12px 15px;
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    -webkit-appearance: none;
}

input:focus, select:focus {
    border-color: rgba(99, 102, 241, 0.65);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: rgba(99, 102, 241, 0.04);
}

input::placeholder { color: #1e293b; }
select option { background: #0a0a0f; color: var(--text); }

.input-group { display: flex; align-items: center; }
.input-group input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }

.input-suffix {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 12px 14px;
    color: var(--text-muted);
    white-space: nowrap;
    font-size: 13px;
}

.error {
    background: rgba(239, 68, 68, 0.07);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 13px;
}

.hidden { display: none !important; }

/* ─── Modal ───────────────────────────────────────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    backdrop-filter: blur(10px);
    animation: fade-in 0.15s ease;
}

.modal-content {
    background: rgba(5, 5, 8, 0.96);
    backdrop-filter: blur(28px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    padding: 36px;
    width: 100%;
    max-width: 490px;
    position: relative;
    box-shadow: 0 0 0 1px rgba(99,102,241,0.07),
                0 32px 64px rgba(0,0,0,0.55);
    animation: fade-in-up 0.2s ease;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0; left: 12%; right: 12%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99,102,241,0.7), rgba(139,92,246,0.7), transparent);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, #e0e7ff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-close {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(255,255,255,0.09);
    color: var(--text);
}

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

/* ─── Client Hero ─────────────────────────────────────────────────────────── */
.client-hero {
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius);
    padding: 72px 48px;
    text-align: center;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    animation: fade-in-up 0.5s ease 0.05s both;
}

/* Spotlight */
.client-hero::before {
    content: '';
    position: absolute;
    top: -120px; left: 50%;
    transform: translateX(-50%);
    width: 800px; height: 600px;
    background: radial-gradient(ellipse at center top,
        rgba(99, 102, 241, 0.13) 0%, transparent 62%);
    pointer-events: none;
}

/* Top glow line */
.client-hero::after {
    content: '';
    position: absolute;
    top: 0; left: 8%; right: 8%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(99, 102, 241, 0.7),
        rgba(139, 92, 246, 0.7),
        transparent);
}

.client-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 99px;
    padding: 6px 18px;
    margin-bottom: 28px;
    font-size: 12px;
    color: var(--text-muted);
    position: relative;
    z-index: 1;
    letter-spacing: 0.01em;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse-online 2.5s ease-in-out infinite;
}

.status-dot.offline { background: var(--text-muted); }

@keyframes pulse-online {
    0%, 100% { box-shadow: 0 0 4px var(--success); }
    50%       { box-shadow: 0 0 14px var(--success), 0 0 24px rgba(34,197,94,0.35); }
}

.client-hero h2 {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.6px;
    line-height: 1.2;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #f8fafc 0%, #c7d2fe 45%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 1;
}

.client-hero p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 32px;
    position: relative;
    z-index: 1;
}

/* ─── Info Cards ──────────────────────────────────────────────────────────── */
.info-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 24px;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
    animation: fade-in-up 0.4s ease both;
}

.info-cards .info-card:nth-child(1) { animation-delay: 0.1s; }
.info-cards .info-card:nth-child(2) { animation-delay: 0.15s; }
.info-cards .info-card:nth-child(3) { animation-delay: 0.2s; }

.info-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99,102,241,0.45), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.info-card:hover {
    border-color: rgba(99, 102, 241, 0.22);
    background: rgba(99, 102, 241, 0.03);
    transform: translateY(-3px);
}

.info-card:hover::before { opacity: 1; }

.info-icon {
    font-size: 22px;
    margin-bottom: 14px;
    display: block;
}

.info-card h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.info-card p {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.65;
}

.info-card code {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.22);
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 12px;
    color: #a5b4fc;
}

/* ─── Member Role ─────────────────────────────────────────────────────────── */
.member-role {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: 99px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: #c7d2fe;
    font-size: 11px;
    text-transform: capitalize;
    letter-spacing: 0.02em;
}

.text-muted { color: var(--text-muted); }

.table-actions {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    align-items: center;
}

.table-actions .btn {
    padding: 5px 11px;
    font-size: 11px;
    border-radius: 8px;
    white-space: nowrap;
}

/* ─── Animations ──────────────────────────────────────────────────────────── */
@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .container    { padding: 24px 16px; }
    .stats-row    { flex-direction: column; }
    .stat-card    { flex: 1 1 auto; }
    .info-cards   { grid-template-columns: 1fr; }
    .auth-card    { padding: 36px 24px; }
    .client-hero  { padding: 48px 22px; margin-bottom: 20px; }
    .client-hero h2 { font-size: 24px; }
    .client-hero p  { font-size: 13px; margin-bottom: 26px; }
    .client-status  { padding: 6px 14px; font-size: 11px; margin-bottom: 22px; }
    .table th, .table td { padding: 12px 16px; }
    .container.container-wide { padding: 24px 16px; }
    .modal-content { padding: 28px 20px; margin: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }

    /* Navbar tightens on phones */
    .navbar { padding: 0 16px; height: 58px; }
    .nav-brand { font-size: 14px; gap: 8px; }
    .nav-brand .logo-icon { font-size: 20px; }
    .nav-actions { gap: 10px; font-size: 12px; min-width: 0; }
    .nav-actions > span {
        max-width: 110px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Card header stacks title above the action button */
    .card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 18px 20px;
    }
    .card-header > div { min-width: 0; }
    .card-header .btn { align-self: flex-start; }

    /* Modal actions stack and go full width for easy tapping */
    .modal-actions {
        flex-direction: column-reverse;
        gap: 8px;
    }
    .modal-actions .btn { width: 100%; justify-content: center; }

    .btn-lg { padding: 14px 26px; font-size: 14px; }
}

/* Phone-sized: collapse the household members table into stacked cards */
@media (max-width: 640px) {
    .members-table thead { display: none; }
    .members-table,
    .members-table tbody,
    .members-table tr {
        display: block;
        width: 100%;
    }
    .members-table tr {
        padding: 14px 18px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    .members-table tr:last-child { border-bottom: none; }
    .members-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 14px;
        padding: 7px 0;
        border-bottom: none;
        font-size: 13px;
    }
    .members-table td[data-label]::before {
        content: attr(data-label);
        color: var(--text-muted);
        font-size: 10px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        flex-shrink: 0;
    }
    .members-table td.cell-email {
        word-break: break-all;
        text-align: right;
    }
    .members-table td.actions-cell {
        padding-top: 12px;
        margin-top: 6px;
        border-top: 1px dashed rgba(255, 255, 255, 0.06);
        justify-content: flex-end;
    }
    .members-table td.actions-cell .table-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    .members-table td.empty {
        display: block;
        text-align: center;
        padding: 36px 16px !important;
    }
}
