/* KeyVault Pro — Modern Dark Dashboard UI */
:root {
    --bg: #090e1a;
    --bg-elevated: #111827;
    --bg-card: #131c2e;
    --bg-input: #0b1220;
    --border: #1e293b;
    --border-focus: #38bdf8;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: var(--font-sans);
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 42%),
                radial-gradient(circle at bottom left, rgba(6, 182, 212, 0.08), transparent 45%),
                var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: #60a5fa;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

.auth-card {
    width: 100%;
    max-width: 430px;
    background: rgba(19, 28, 46, 0.92);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 34px 30px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

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

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35);
    flex-shrink: 0;
}

.brand-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand-subtitle {
    margin: 2px 0 0;
    font-size: 12.5px;
    color: var(--text-muted);
}

/* Navigation Bar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(9, 14, 26, 0.85);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    max-width: 1380px;
    margin: 0 auto;
    padding: 12px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.nav-link {
    padding: 7px 14px;
    border-radius: 9px;
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 600;
    transition: all 0.15s ease;
}

.nav-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    text-decoration: none;
}

.nav-link.active {
    color: #fff;
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(59, 130, 246, 0.35);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.db-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.db-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 11px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 13px;
}

/* Main Layout */
.container {
    max-width: 1380px;
    margin: 0 auto;
    padding: 24px 22px 48px;
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.page-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.page-desc {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--text-muted);
}

/* Alerts & Banners */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    margin-bottom: 18px;
    border: 1px solid transparent;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.alert-error {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.32);
    color: #fca5a5;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.32);
    color: #fcd34d;
}

.alert-info {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.32);
    color: #93c5fd;
}

/* Metrics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
}

.stat-label {
    font-size: 12.5px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    margin-top: 6px;
    letter-spacing: -0.02em;
}

.stat-sub {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 2px;
}

.stat-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.stat-card-link:hover {
    text-decoration: none;
    border-color: #38bdf8;
    background: #172338;
    transform: translateY(-1px);
}

.stat-card-link.active {
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.16);
}

/* Usage View Tabs (All / Used / Unused) */
.view-tabs {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.view-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.15s ease;
}

.view-tab:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    text-decoration: none;
}

.view-tab.active {
    color: #fff;
    background: rgba(59, 130, 246, 0.24);
    border: 1px solid rgba(56, 189, 248, 0.45);
}

.nav-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(56, 189, 248, 0.18);
    color: #7dd3fc;
}

/* Main Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 380px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.users-grid {
    display: grid;
    grid-template-columns: 380px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.card-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
}

.card-subtitle {
    margin: 3px 0 0;
    font-size: 12.5px;
    color: var(--text-muted);
}

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

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
select {
    width: 100%;
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 13.5px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.password-wrap {
    position: relative;
}

.password-wrap input {
    padding-right: 64px;
}

.toggle-pass-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}

.toggle-pass-btn:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}

.key-preview-box {
    background: var(--bg-input);
    border: 1px dashed #334155;
    border-radius: var(--radius-sm);
    padding: 11px 13px;
    margin-bottom: 16px;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.key-preview-box.has-generated {
    border-style: solid;
    border-color: rgba(16, 185, 129, 0.45);
    background: rgba(11, 18, 32, 0.96);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.08);
}

.key-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.key-preview-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.key-preview-header .key-preview-label {
    margin-bottom: 0;
}

.key-preview-box.has-generated .key-preview-label {
    color: #6ee7b7;
    font-weight: 700;
}

.key-preview-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.key-preview-value {
    font-family: var(--font-mono);
    font-size: 13.5px;
    color: #38bdf8;
    word-break: break-all;
}

.preview-generated-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 210px;
    overflow-y: auto;
    margin-top: 6px;
    padding-right: 2px;
}

.preview-generated-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 7px;
    padding: 6px 9px;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.preview-generated-item:hover {
    border-color: rgba(56, 189, 248, 0.5);
    background: rgba(30, 41, 59, 0.65);
}

.preview-generated-code {
    font-family: var(--font-mono);
    font-size: 12.5px;
    font-weight: 600;
    color: #38bdf8;
    cursor: pointer;
    user-select: all;
    word-break: break-all;
}

.preview-copy-btn {
    padding: 3px 9px;
    font-size: 11.5px;
    border-radius: 6px;
    flex-shrink: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 9px 15px;
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    text-decoration: none;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 7px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #2563eb);
    color: #fff;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28);
}

.btn-primary:hover {
    filter: brightness(1.08);
}

.btn-secondary {
    background: #1e293b;
    color: var(--text);
    border-color: #334155;
}

.btn-secondary:hover {
    background: #283548;
}

.btn-success {
    background: rgba(16, 185, 129, 0.16);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.35);
}

.btn-success:hover {
    background: rgba(16, 185, 129, 0.25);
}

.btn-warning {
    background: rgba(245, 158, 11, 0.16);
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.35);
}

.btn-warning:hover {
    background: rgba(245, 158, 11, 0.25);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.32);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

.btn-info {
    background: rgba(6, 182, 212, 0.16);
    color: #67e8f9;
    border-color: rgba(6, 182, 212, 0.36);
}

.btn-info:hover {
    background: rgba(6, 182, 212, 0.26);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.badge-active {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-revoked,
.badge-banned {
    background: rgba(239, 68, 68, 0.16);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.36);
}

.badge-stopped {
    background: rgba(245, 158, 11, 0.16);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.36);
}

.badge-all-stopped {
    background: rgba(249, 115, 22, 0.2);
    color: #fdba74;
    border: 1px solid rgba(249, 115, 22, 0.45);
}

.badge-unused {
    background: rgba(139, 92, 246, 0.16);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.35);
}

.badge-expired {
    background: rgba(148, 163, 184, 0.16);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.badge-exhausted {
    background: rgba(168, 85, 247, 0.15);
    color: #d8b4fe;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge-admin {
    background: rgba(59, 130, 246, 0.18);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.35);
}

.badge-staff {
    background: rgba(148, 163, 184, 0.15);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.28);
}

.badge-hwid-locked {
    background: rgba(56, 189, 248, 0.14);
    color: #7dd3fc;
    border: 1px solid rgba(56, 189, 248, 0.34);
}

.badge-hwid-unlocked {
    background: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.24);
}

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

.hwid-code {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: #bae6fd;
    background: #0b1220;
    border: 1px solid #1e293b;
    padding: 2px 7px;
    border-radius: 5px;
    cursor: pointer;
    white-space: nowrap;
}

.hwid-code:hover {
    border-color: #38bdf8;
}

/* Toolbar & Filters */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.filter-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}

.filter-form input[type="text"] {
    max-width: 260px;
    min-width: 170px;
}

.filter-form select {
    width: auto;
    min-width: 140px;
}

.bulk-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.bulk-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Newly Generated Keys Highlight */
.generated-box {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 20px;
}

.generated-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 8px;
    margin-top: 12px;
    max-height: 220px;
    overflow-y: auto;
}

.generated-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 8px;
    padding: 7px 10px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: #a7f3d0;
}

/* Table */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead th {
    text-align: left;
    padding: 11px 12px;
    background: #0f172a;
    color: var(--text-muted);
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody td {
    padding: 11px 12px;
    border-bottom: 1px solid rgba(30, 41, 59, 0.65);
    vertical-align: middle;
}

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

tbody tr:hover {
    background: rgba(255, 255, 255, 0.025);
}

.key-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.key-code {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: #e2e8f0;
    background: #0b1220;
    border: 1px solid #1e293b;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

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

.empty-state {
    text-align: center;
    padding: 40px 18px;
    color: var(--text-muted);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    font-size: 13px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.page-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 60;
}

.modal-backdrop.open {
    display: flex;
}

.modal {
    width: 100%;
    max-width: 470px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

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

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

/* API Info Box */
.code-block {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: #93c5fd;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Toast Notification */
.toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    background: #0f172a;
    color: #f8fafc;
    border: 1px solid #334155;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 80;
}

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

.hint-box {
    margin-top: 16px;
    padding: 11px 13px;
    border-radius: var(--radius-sm);
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.25);
    font-size: 12.5px;
    color: #bfdbfe;
}

.muted {
    color: var(--text-muted);
    font-size: 12.5px;
}

/* Quantity Quick-Pick Pills */
.qty-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 9px;
}

.qty-pill {
    flex: 1 1 48px;
    background: var(--bg-input);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 12.5px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
}

.qty-pill:hover {
    color: var(--text);
    border-color: #334155;
    background: #162033;
}

.qty-pill.active {
    color: #fff;
    background: rgba(59, 130, 246, 0.22);
    border-color: rgba(56, 189, 248, 0.65);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.12);
}

/* Duration Selector Grid */
.duration-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.duration-option {
    margin: 0;
    cursor: pointer;
    position: relative;
}

.duration-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.duration-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    transition: all 0.15s ease;
}

.duration-option:hover .duration-pill {
    color: var(--text);
    border-color: #334155;
    background: #162033;
}

.duration-option input[type="radio"]:checked + .duration-pill {
    color: #fff;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.28), rgba(6, 182, 212, 0.22));
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15);
}

.duration-option input[type="radio"]:focus-visible + .duration-pill {
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
}

/* Duration Badge & Generated Item Meta */
.badge-duration {
    background: rgba(6, 182, 212, 0.14);
    color: #67e8f9;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.generated-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-wrap: wrap;
}

.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

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

.generated-box {
    animation: fadeSlideIn 0.2s ease-out;
}

/* Global All-Key Stop / Resume Banner */
.global-control-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.global-control-bar.is-running {
    border-color: rgba(16, 185, 129, 0.28);
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.08), var(--bg-card) 55%);
}

.global-control-bar.is-stopped {
    border-color: rgba(249, 115, 22, 0.55);
    background: linear-gradient(90deg, rgba(249, 115, 22, 0.16), var(--bg-card) 65%);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}

.global-control-info {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

@media (max-width: 1060px) {
    .dashboard-grid,
    .users-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .topbar-inner {
        padding: 10px 14px;
        gap: 10px;
    }
    .topbar-left {
        width: 100%;
        gap: 10px;
    }
    .nav-links {
        width: 100%;
        gap: 5px;
    }
    .nav-link {
        padding: 6px 10px;
        font-size: 12.5px;
    }
    .topbar-right {
        width: 100%;
        justify-content: space-between;
        gap: 8px;
    }
    .container {
        padding: 14px 12px 36px;
    }
    .page-title {
        font-size: 20px;
    }
    .card {
        padding: 16px 14px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .stat-card {
        padding: 14px 13px;
    }
    .stat-value {
        font-size: 22px;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .duration-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .filter-form {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    .filter-form input[type="text"] {
        grid-column: 1 / -1;
        max-width: none;
        min-width: 0;
        width: 100%;
    }
    .filter-form select {
        width: 100%;
        min-width: 0;
    }
    .bulk-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }
    .bulk-actions .btn {
        width: 100%;
    }
    .view-tabs {
        width: 100%;
    }
    .view-tab {
        flex: 1 1 auto;
        justify-content: center;
        font-size: 12px;
        padding: 6px 8px;
    }
    thead th,
    tbody td {
        padding: 9px 8px;
        font-size: 12px;
    }
    .actions-cell {
        flex-wrap: wrap;
        min-width: 145px;
    }
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="datetime-local"],
    select {
        font-size: 16px;
    }
    .modal-backdrop {
        padding: 12px;
    }
    .modal {
        padding: 18px 14px;
    }
    .toast {
        left: 12px;
        right: 12px;
        bottom: 14px;
        text-align: center;
    }
}

