/* ----------------------------------------------------
   Antigravity Gaming DNS - Styles & Design System
   Aesthetic: Premium Glassmorphism & Cyber-Dark Mode
---------------------------------------------------- */

:root {
    --bg-dark: #07080d;
    --panel-bg: rgba(13, 16, 27, 0.65);
    --panel-border: rgba(255, 255, 255, 0.06);
    --panel-glow: rgba(124, 58, 237, 0.15);
    
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --primary: #7c3aed;
    --primary-light: #9061f9;
    --primary-glow: rgba(124, 58, 237, 0.4);
    
    --cyan: #06b6d4;
    --cyan-glow: rgba(6, 182, 212, 0.4);
    
    --green: #10b981;
    --red: #f43f5e;
    --blue: #3b82f6;
    --purple: #8b5cf6;
    /* Shared "warning" tier color. Also expose the raw R,G,B triplet: CSS custom
       properties can't decompose a hex value, so anywhere that needs the amber
       tint at partial opacity uses rgba(var(--amber-rgb), X) instead of a new
       hardcoded rgba(...) literal. Previously this same color existed as 3
       separate hardcoded instances (two rgba(245,158,11,...) rules and one
       literal 'orange' string in app.js) with no shared variable. */
    --amber: #f59e0b;
    --amber-rgb: 245, 158, 11;
    --amber-glow: rgba(245, 158, 11, 0.4);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Scrollbar */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Background Glow Effects */
.bg-glow {
    position: fixed;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.15;
    pointer-events: none;
    animation: float 20s infinite alternate ease-in-out;
}
.bg-glow-1 {
    top: -10%;
    left: -10%;
    background: var(--primary);
}
.bg-glow-2 {
    bottom: -10%;
    right: -10%;
    background: var(--cyan);
    animation-delay: -5s;
}
.bg-glow-3 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--purple);
    width: 300px;
    height: 300px;
    opacity: 0.08;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* Glass Panels */
.glass-panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: var(--transition-smooth);
}
.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.45), 0 0 15px var(--panel-glow);
}
.highlight-border {
    border-color: rgba(124, 58, 237, 0.2);
}
.highlight-border:hover {
    border-color: rgba(124, 58, 237, 0.4);
}

/* App Container Layout */
.app-container {
    display: flex;
    width: 96vw;
    height: 92vh;
    max-width: 1400px;
    max-height: 850px;
    background: rgba(10, 11, 18, 0.5);
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    border-right: 1px solid var(--panel-border);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    background: rgba(5, 6, 10, 0.4);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}
.logo-icon {
    font-size: 26px;
    background: linear-gradient(135deg, var(--cyan), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 8px rgba(124, 58, 237, 0.5));
}
.brand-text h1 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.brand-text span {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    border-radius: 12px;
    transition: var(--transition-smooth);
}
.nav-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}
.nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}
.nav-item.active {
    color: var(--text-primary);
    background: linear-gradient(90deg, rgba(124, 58, 237, 0.15) 0%, rgba(6, 182, 212, 0.05) 100%);
    border-left: 3px solid var(--primary);
    box-shadow: inset 0 0 10px rgba(124, 58, 237, 0.1);
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid var(--panel-border);
}
.status-indicator-container {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-secondary);
}
.status-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.pulse-green {
    background-color: var(--green);
    box-shadow: 0 0 8px var(--green);
    animation: pulse 1.5s infinite;
}
.pulse-red {
    background-color: var(--red);
    box-shadow: 0 0 8px var(--red);
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.5; }
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 30px;
    overflow-y: auto;
}

/* Header Area */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}
.header-title-area h2 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
}
.header-title-area p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.api-key-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.api-key-input-wrapper i {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 12px;
}
.api-key-input-wrapper input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    padding: 8px 12px 8px 32px;
    color: var(--text-primary);
    font-size: 12px;
    width: 180px;
    transition: var(--transition-smooth);
}
.api-key-input-wrapper input:focus {
    width: 220px;
    outline: none;
    border-color: var(--cyan);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    padding: 10px 20px;
    box-shadow: 0 4px 15px var(--primary-glow);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--panel-border);
    color: var(--text-primary);
    padding: 10px 20px;
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}
.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
}
.btn-small {
    padding: 6px 12px;
    font-size: 11px;
    border-radius: 6px;
}
.btn-full {
    width: 100%;
    padding: 12px;
}

/* Tabs System */
.tab-pane {
    display: none;
    animation: tabFade 0.4s ease-in-out forwards;
}
.tab-pane.active-pane {
    display: block;
}
@keyframes tabFade {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Overview Dashboard Layout */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.metric-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}
.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.metric-header h3 {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}
.metric-icon {
    font-size: 20px;
    padding: 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
}
.icon-blue { color: var(--blue); }
.icon-purple { color: var(--purple); }
.icon-cyan { color: var(--cyan); }
.icon-amber { color: var(--amber); }

.metric-body {
    margin-top: 15px;
}
.metric-value-wrapper {
    display: flex;
    align-items: baseline;
    gap: 4px;
}
.metric-value {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
}
.metric-unit {
    font-size: 14px;
    color: var(--text-muted);
}
.metric-details {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 12px;
}
.metric-detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.metric-detail-item span { color: var(--text-muted); }
.metric-detail-item strong { color: var(--text-primary); }

.card-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.02);
}
.card-progress-bar .progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--cyan));
    transition: width 1s ease-in-out;
}

/* System health bars */
.system-stats-compact {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.sys-bar-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sys-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-secondary);
}
.sys-bar-outer {
    height: 5px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 3px;
    overflow: hidden;
}
.sys-bar-inner {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}
.bg-cyan { background: var(--cyan); box-shadow: 0 0 6px var(--cyan-glow); }
.bg-purple { background: var(--purple); box-shadow: 0 0 6px var(--primary-glow); }
.bg-blue { background: var(--blue); }

/* Details/Graph Layout */
.details-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}
.span-2 { grid-column: span 1; }

@media (min-width: 900px) {
    .span-2 { grid-column: span 1; }
    .details-layout {
        grid-template-columns: 1.8fr 1.2fr;
    }
}

.detail-card {
    padding: 24px;
}
.card-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.card-title-bar h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
}
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.badge-pulse-blue {
    background: rgba(59, 130, 246, 0.1);
    color: var(--blue);
    border: 1px solid rgba(59, 130, 246, 0.2);
    animation: badgePulse 2s infinite;
}
@keyframes badgePulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.graph-placeholder-container {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.traffic-visualizer {
    display: flex;
    width: 100%;
    height: 100%;
    gap: 30px;
}
.traffic-bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.traffic-dir {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
}
.traffic-wave-container {
    height: 70px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: flex-end;
}
.traffic-wave {
    width: 100%;
    transition: height 0.5s ease;
    border-radius: 8px 8px 0 0;
    opacity: 0.75;
}
.traffic-value-live {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    margin-top: 8px;
}

/* Properties List */
.properties-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.prop-item {
    display: flex;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 13px;
}
.prop-item span { color: var(--text-secondary); }
.prop-item strong { color: var(--text-primary); }

/* Domains Registry Table UI */
.action-bar {
    padding: 16px 20px;
    margin-bottom: 20px;
}
.search-add-form {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}
.input-decor-icon {
    position: absolute;
    left: 15px;
    color: var(--text-muted);
}
.search-add-form input {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--panel-border);
    padding: 12px 12px 12px 45px;
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition-smooth);
}
.search-add-form input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.04);
}

.table-container {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--panel-border);
}
.table-header h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
}
.table-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.table-search-wrapper i {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 13px;
}
.table-search-wrapper input {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--panel-border);
    padding: 8px 12px 8px 35px;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    width: 220px;
    transition: var(--transition-smooth);
}
.table-search-wrapper input:focus {
    width: 260px;
    outline: none;
    border-color: var(--cyan);
}

.table-wrapper {
    overflow-x: auto;
    max-height: 380px;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13px;
}
.data-table th {
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.01);
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 1px solid var(--panel-border);
}
.data-table td {
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
}
.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.01);
}
.table-loading {
    text-align: center;
    color: var(--text-muted);
    padding: 40px !important;
}

.table-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--panel-border);
    font-size: 12px;
    color: var(--text-secondary);
}

/* Badges for status inside table */
.status-badge {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
}
.badge-active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Delete / Remove actions */
.btn-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: var(--transition-smooth);
}
.btn-delete:hover {
    color: var(--red);
    background: rgba(244, 63, 94, 0.1);
}

/* Peers Layout & UI */
.peer-layout {
    display: grid;
    grid-template-columns: 1.1fr 1.9fr;
    gap: 20px;
}
.peer-creator-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: fit-content;
}
.section-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.standard-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}
.form-group input {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--panel-border);
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    transition: var(--transition-smooth);
}
.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Client config file output box */
.config-output-wrapper {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: slideUp 0.3s ease-out;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--cyan);
}
.config-output-wrapper textarea {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--panel-border);
    color: #a78bfa;
    font-family: monospace;
    font-size: 11px;
    padding: 10px;
    border-radius: 8px;
    height: 180px;
    resize: none;
    outline: none;
}

.peers-list-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.peers-list-container h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
}
.peers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 15px;
}
.peer-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.peer-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.peer-name {
    font-weight: 600;
    font-size: 14px;
}
.peer-meta {
    font-size: 11px;
    color: var(--text-muted);
}

/* Settings view styles */
.settings-container {
    padding: 30px;
}
.divider {
    border: 0;
    height: 1px;
    background: var(--panel-border);
    margin: 20px 0;
}
.settings-section {
    margin-bottom: 30px;
}
.settings-section h4 {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
}
.row-group {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    margin-top: 15px;
}
.form-input-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-input-wrapper label {
    font-size: 12px;
    color: var(--text-secondary);
}
.form-input-wrapper input {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--panel-border);
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    width: 100%;
}

.quick-terminal-view {
    margin-top: 15px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--panel-border);
}
.terminal-header {
    background: rgba(255, 255, 255, 0.02);
    padding: 10px 15px;
    font-size: 12px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--panel-border);
}
.terminal-body {
    background: #040509;
    padding: 15px;
    font-family: monospace;
    font-size: 12px;
    color: #a7f3d0;
    max-height: 250px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Toast System */
.toast-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(13, 16, 27, 0.9);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 14px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 10px rgba(16, 185, 129, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    z-index: 999;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}
#toast-icon {
    color: var(--green);
    font-size: 16px;
}
.toast-notification.hidden {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    pointer-events: none;
}

/* Utility Helper classes */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
/* These 4 were referenced by app.js/index.html (tunnel status text, several
   cyan-highlighted values) but never actually defined here, so that text
   silently rendered in the default color with no visual effect at all —
   a pre-existing bug unrelated to this feature, fixed while touching this file. */
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-orange { color: var(--amber); }
.text-cyan { color: var(--cyan); }
.padding-30 { padding: 30px; }
.align-self-end { align-self: flex-end; }

/* Login Overlay Panel */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 5, 9, 0.85);
    backdrop-filter: blur(15px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
}
.login-card {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    border-radius: 20px;
    background: rgba(13, 16, 27, 0.6);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

/* Client User Status Toggle Buttons */
.btn-toggle-client {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-status-active {
    background: rgba(16, 185, 129, 0.1) !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
    color: var(--green) !important;
}
.btn-status-active:hover {
    background: rgba(16, 185, 129, 0.2) !important;
}
.btn-status-inactive {
    background: rgba(244, 63, 94, 0.1) !important;
    border: 1px solid rgba(244, 63, 94, 0.3) !important;
    color: var(--red) !important;
}
.btn-status-inactive:hover {
    background: rgba(244, 63, 94, 0.2) !important;
}

/* ----------------------------------------------------
   Authorized Clients — multi-field add form
---------------------------------------------------- */
.client-add-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    width: 100%;
    flex-wrap: wrap;
}
.caf-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 90px;
}
.caf-field.caf-grow { flex: 1; min-width: 160px; }
.caf-field label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--text-muted);
}
.caf-field input {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--panel-border);
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    transition: var(--transition-smooth);
}
.caf-field input:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px var(--cyan-glow);
}
.caf-submit { height: 38px; white-space: nowrap; }

/* Client cell */
.client-name { font-weight: 600; color: var(--text-primary); }
.client-note {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 3px;
    max-width: 220px;
}
.client-created { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* Devices cell */
.dev-usage {
    display: inline-block;
    font-family: monospace;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    margin-bottom: 6px;
}
.dev-usage.dev-ok { color: var(--cyan); background: rgba(6, 182, 212, 0.1); }
.dev-usage.dev-full { color: var(--amber); background: rgba(var(--amber-rgb), 0.12); }
.ip-chips { display: flex; flex-wrap: wrap; gap: 5px; max-width: 240px; }
.ip-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    padding: 2px 4px 2px 8px;
    font-size: 11px;
}
.ip-chip code { font-family: monospace; color: var(--text-secondary); }
.ip-chip-remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 10px;
    transition: var(--transition-smooth);
}
.ip-chip-remove:hover { color: var(--red); background: rgba(244, 63, 94, 0.12); }

/* Subscription cell */
.sub-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    white-space: nowrap;
}
.sub-badge.sub-ok { color: var(--green); background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.25); }
.sub-badge.sub-soon { color: var(--amber); background: rgba(var(--amber-rgb), 0.1); border: 1px solid rgba(var(--amber-rgb), 0.25); }
.sub-badge.sub-expired { color: var(--red); background: rgba(244, 63, 94, 0.1); border: 1px solid rgba(244, 63, 94, 0.25); }
.sub-badge.sub-unlimited { color: var(--cyan); background: rgba(6, 182, 212, 0.1); border: 1px solid rgba(6, 182, 212, 0.25); }
.sub-date { font-size: 10px; color: var(--text-muted); margin-top: 4px; }

/* Link cell */
.link-cell { display: flex; align-items: center; gap: 8px; }
.link-input {
    font-size: 11px;
    padding: 5px 8px;
    border-radius: 6px;
    border: 1px solid var(--panel-border);
    background: rgba(0, 0, 0, 0.15);
    color: var(--text-secondary);
    width: 190px;
}

/* ----------------------------------------------------
   Modal (Edit Client)
---------------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 4, 8, 0.75);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}
.modal-card {
    width: 100%;
    max-width: 520px;
    padding: 0;
    overflow: hidden;
    animation: modalPop 0.2s ease-out;
}
@keyframes modalPop {
    from { transform: translateY(12px) scale(0.98); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--panel-border);
}
.modal-header h3 { font-family: var(--font-heading); font-size: 16px; font-weight: 700; }
.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.modal-close:hover { color: var(--red); }
.modal-body { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal-check-row { flex-direction: row; align-items: center; }
.switch-label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--text-secondary); }
.switch-label input { width: 16px; height: 16px; accent-color: var(--cyan); }
.modal-ips-section { display: flex; flex-direction: column; gap: 8px; }
.modal-ips-section > label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.modal-ips-list { display: flex; flex-direction: column; gap: 6px; max-height: 180px; overflow-y: auto; }
.modal-ip-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
}
.modal-ip-row code { font-family: monospace; font-size: 12px; color: var(--text-primary); }
.modal-ip-seen { font-size: 10px; color: var(--text-muted); margin-left: 6px; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 22px;
    border-top: 1px solid var(--panel-border);
}

@media (max-width: 640px) {
    .modal-grid { grid-template-columns: 1fr; }
    .link-input { width: 130px; }
}

/* ----------------------------------------------------
   Clients tab — summary cards, search/sort/export, bulk actions
---------------------------------------------------- */
.client-summary-grid { margin-bottom: 20px; }

.table-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
}
.table-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.select-sort {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--panel-border);
    color: var(--text-secondary);
    font-size: 12px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.select-sort:hover, .select-sort:focus {
    outline: none;
    border-color: var(--cyan);
    color: var(--text-primary);
}

#client-select-all, .client-row-check { width: 15px; height: 15px; accent-color: var(--cyan); cursor: pointer; }

.th-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.th-sortable:hover { color: var(--text-primary); }
.th-sortable .sort-icon { margin-left: 5px; font-size: 9px; opacity: 0.35; }
.th-sortable.sort-active .sort-icon { opacity: 1; color: var(--cyan); }

.bulk-action-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 16px;
    margin: 14px 0 0;
    background: rgba(var(--amber-rgb), 0.06);
    border: 1px solid rgba(var(--amber-rgb), 0.2);
    border-radius: 10px;
}
.bulk-action-bar-label { font-size: 12px; color: var(--text-secondary); }
.bulk-action-bar-label strong { color: var(--amber); }

/* ----------------------------------------------------
   Modal: wide variant + tab strip (Settings / Activity / History)
---------------------------------------------------- */
.modal-card-wide { max-width: 680px; }

.modal-tabs {
    display: flex;
    gap: 4px;
    padding: 0 22px;
    border-bottom: 1px solid var(--panel-border);
}
.modal-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    padding: 12px 14px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 6px;
}
.modal-tab:hover { color: var(--text-secondary); }
.modal-tab.active { color: var(--cyan); border-bottom-color: var(--cyan); }
.modal-tab-pane { display: none; }
.modal-tab-pane.active { display: block; }

.modal-subsection-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
    margin: 16px 0 8px;
}
.modal-subsection-label:first-child { margin-top: 0; }

/* Activity pane */
.modal-activity-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}
.activity-stat {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.activity-stat span { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }
.activity-stat strong { font-size: 16px; color: var(--text-primary); font-family: var(--font-heading); }

.modal-activity-top-domains {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: 140px;
    overflow-y: auto;
}
.top-domain-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    font-size: 12px;
}
.top-domain-name { color: var(--text-primary); font-family: monospace; }
.top-domain-count {
    background: rgba(6, 182, 212, 0.1);
    color: var(--cyan);
    font-weight: 700;
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 10px;
}

.modal-activity-recent {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 220px;
    overflow-y: auto;
}
.activity-row {
    display: grid;
    grid-template-columns: 44px 1fr auto auto;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 12px;
}
.query-type-badge {
    background: rgba(139, 92, 246, 0.12);
    color: var(--purple);
    font-size: 9px;
    font-weight: 700;
    text-align: center;
    padding: 2px 4px;
    border-radius: 4px;
}
.query-domain { color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.query-ip { color: var(--text-secondary); font-size: 11px; }
.activity-time { color: var(--text-muted); font-size: 10px; white-space: nowrap; }

/* History pane */
.modal-history-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 320px;
    overflow-y: auto;
}
.history-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.history-icon { color: var(--cyan); font-size: 13px; margin-top: 2px; width: 16px; text-align: center; }
.history-row.history-warn .history-icon { color: var(--amber); }
.history-row.history-danger .history-icon { color: var(--red); }
.history-body { display: flex; flex-direction: column; gap: 2px; }
.history-label { font-size: 12px; color: var(--text-primary); }
.history-event-type { text-transform: capitalize; font-weight: 600; }
.history-time { font-size: 10px; color: var(--text-muted); }

@media (max-width: 720px) {
    .modal-card-wide { max-width: 100%; }
    .activity-row { grid-template-columns: 36px 1fr; grid-template-rows: auto auto; }
}
