:root {
    --fazen-accent: #58a6ff;
    --fazen-accent-hover: #7ab8ff;
    --fazen-accent-dark: #4590e6;
    --fazen-black: #121212;
    --fazen-surface: #181818;
    --fazen-surface-soft: #242424;
    --fazen-border: #343434;
    --fazen-text: #ffffff;
    --fazen-text-muted: #b3b3b3;
}

body {
    min-height: 100vh;
    background: radial-gradient(circle at top, #1a2230 0%, #16181c 45%, #121212 100%);
    color: var(--fazen-text);
    font-family: Inter, "Segoe UI", sans-serif;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: -20%;
    background: radial-gradient(circle, rgba(88, 166, 255, 0.14) 0%, rgba(18, 18, 18, 0) 55%);
    pointer-events: none;
    z-index: -1;
}

.sidebar {
    background: var(--fazen-surface);
    color: var(--fazen-text);
    min-height: 100vh;
    border-right: 1px solid #2a2a2a;
}

.brand-title {
    font-weight: 700;
    font-size: 1.35rem;
}

.brand-subtitle {
    color: var(--fazen-text-muted);
    font-size: 0.85rem;
}

.sidebar .nav-link {
    border-radius: 10px;
    background: transparent;
    border: 1px solid #2f2f2f;
    color: var(--fazen-text-muted);
    padding: 0.7rem 0.9rem;
    transition: all 0.15s ease;
}

.sidebar .nav-link:hover,
.sidebar .nav-link:focus {
    background: #222222;
    border-color: #3b3b3b;
    color: var(--fazen-text);
}

.sidebar .nav-link.active {
    background: linear-gradient(120deg, rgba(88, 166, 255, 0.28) 0%, rgba(88, 166, 255, 0.1) 100%);
    border-color: rgba(88, 166, 255, 0.65);
    color: var(--fazen-text);
    box-shadow: 0 0 0 1px rgba(88, 166, 255, 0.2) inset;
}

.topbar,
.card {
    background: var(--fazen-surface);
    color: var(--fazen-text);
    border: 1px solid #2c2c2c;
    border-radius: 14px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
}

.topbar {
    padding: 1rem 1.25rem;
}

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--fazen-text);
    --bs-table-hover-color: var(--fazen-text);
    --bs-table-hover-bg: #232323;
    margin-bottom: 0;
}

.table thead th {
    color: #d3d3d3;
    border-color: #2f2f2f;
}

.table td {
    border-color: #2f2f2f;
    vertical-align: middle;
}

.form-control,
.form-select,
.btn {
    border-radius: 12px;
}

.form-control,
.form-select {
    background: var(--fazen-surface-soft);
    border: 1px solid var(--fazen-border);
    color: var(--fazen-text);
}

.form-control::placeholder {
    color: #8d8d8d;
}

.form-control:focus,
.form-select:focus {
    background: #2a2a2a;
    border-color: var(--fazen-accent);
    color: var(--fazen-text);
    box-shadow: 0 0 0 0.2rem rgba(88, 166, 255, 0.25);
}

.btn-primary {
    background: linear-gradient(120deg, var(--fazen-accent) 0%, var(--fazen-accent-hover) 100%);
    border-color: var(--fazen-accent);
    color: #0d1117;
    font-weight: 700;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(120deg, var(--fazen-accent-dark) 0%, var(--fazen-accent) 100%);
    border-color: var(--fazen-accent-dark);
    color: #0d1117;
}

.btn-outline-light {
    border-color: #4a4a4a;
    color: #ececec;
}

.btn-outline-light:hover {
    border-color: var(--fazen-accent);
    background: rgba(88, 166, 255, 0.16);
    color: #f0f7ff;
}

.btn-outline-danger {
    border-color: rgba(255, 82, 82, 0.65);
    color: #ffd2d2;
    background: rgba(255, 82, 82, 0.08);
}

.btn-outline-danger:hover {
    border-color: rgba(255, 82, 82, 0.9);
    background: rgba(255, 82, 82, 0.18);
    color: #ffe8e8;
}

.btn-action-badge {
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
    padding: 0.42rem 0.72rem;
    border: 1px solid transparent;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    white-space: nowrap;
}

.btn.btn-sm.btn-action-badge {
    min-height: calc(1.5em + 0.5rem + 2px);
}

.btn-action-badge.form-row-action {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    min-height: calc(1.5em + 0.75rem + 2px);
    min-width: 5.5rem;
}

.form-add-col {
    align-self: flex-start;
}

.btn-action-save,
.btn-action-save:hover,
.btn-action-save:focus,
.btn-action-save:active {
    color: #e3f0ff;
    border-color: rgba(88, 166, 255, 0.65);
    background-color: #181818;
    background-image: linear-gradient(120deg, rgba(88, 166, 255, 0.22) 0%, rgba(24, 24, 24, 0.96) 100%);
}

.btn-action-save:hover,
.btn-action-save:focus {
    color: #f4f9ff;
    border-color: rgba(122, 184, 255, 0.9);
    background-image: linear-gradient(120deg, rgba(122, 184, 255, 0.28) 0%, rgba(24, 24, 24, 0.98) 100%);
    box-shadow: 0 2px 8px rgba(88, 166, 255, 0.2);
}

.btn-action-add,
.btn-action-add:hover,
.btn-action-add:focus,
.btn-action-add:active {
    color: #f4f9ff;
    border-color: rgba(88, 166, 255, 0.8);
    background-color: #181818;
    background-image: linear-gradient(120deg, rgba(88, 166, 255, 0.42) 0%, rgba(88, 166, 255, 0.14) 45%, rgba(24, 24, 24, 0.96) 100%);
}

.btn-action-add:hover,
.btn-action-add:focus {
    color: #ffffff;
    border-color: rgba(122, 184, 255, 0.95);
    background-image: linear-gradient(120deg, rgba(122, 184, 255, 0.52) 0%, rgba(88, 166, 255, 0.2) 45%, rgba(24, 24, 24, 0.98) 100%);
    box-shadow: 0 2px 8px rgba(88, 166, 255, 0.24);
}

.btn-action-delete,
.btn-action-delete:hover,
.btn-action-delete:focus,
.btn-action-delete:active {
    color: #ffe0e0;
    border-color: rgba(255, 82, 82, 0.7);
    background-color: #181818;
    background-image: linear-gradient(120deg, rgba(255, 82, 82, 0.2) 0%, rgba(24, 24, 24, 0.96) 100%);
}

.btn-action-delete:hover,
.btn-action-delete:focus {
    color: #fff0f0;
    border-color: rgba(255, 82, 82, 0.95);
    background-image: linear-gradient(120deg, rgba(255, 82, 82, 0.3) 0%, rgba(24, 24, 24, 0.98) 100%);
}

.stat-card {
    border: 1px solid #373737;
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(39, 39, 39, 0.95) 0%, rgba(27, 27, 27, 0.95) 100%);
}

.stat-label {
    color: var(--fazen-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.78rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #a8ccff;
}

.text-muted {
    color: var(--fazen-text-muted) !important;
}

a {
    color: var(--fazen-accent);
    text-decoration: none;
}

a:hover {
    color: var(--fazen-accent-hover);
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.auth-card {
    width: min(420px, 92vw);
    border-radius: 18px;
    background: var(--fazen-surface);
    color: var(--fazen-text);
    border: 1px solid #2f2f2f;
}

.auth-form {
    max-width: 320px;
}

.auth-form .form-label {
    display: block;
    text-align: center;
}

.status-pill {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.status-pill-success {
    color: #e3f0ff;
    border-color: rgba(88, 166, 255, 0.65);
    background: linear-gradient(120deg, rgba(88, 166, 255, 0.22) 0%, rgba(24, 24, 24, 0.96) 100%);
}

.status-pill-danger {
    color: #ffe0e0;
    border-color: rgba(255, 82, 82, 0.7);
    background: linear-gradient(120deg, rgba(255, 82, 82, 0.2) 0%, rgba(24, 24, 24, 0.96) 100%);
}

.status-editor {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 260px;
}

.status-select {
    max-width: 160px;
}

.expiry-badge {
    display: inline-block;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.expiry-badge-loading {
    color: #ffeec8;
    border-color: rgba(255, 186, 59, 0.7);
    background: linear-gradient(120deg, rgba(255, 186, 59, 0.2) 0%, rgba(24, 24, 24, 0.96) 100%);
}

.expiry-badge-neutral {
    color: #d9d9d9;
    border-color: rgba(180, 180, 180, 0.5);
    background: linear-gradient(120deg, rgba(180, 180, 180, 0.12) 0%, rgba(24, 24, 24, 0.96) 100%);
}

.expiry-badge-success {
    color: #e3f0ff;
    border-color: rgba(88, 166, 255, 0.65);
    background: linear-gradient(120deg, rgba(88, 166, 255, 0.22) 0%, rgba(24, 24, 24, 0.96) 100%);
}

.expiry-badge-warning {
    color: #ffeec8;
    border-color: rgba(255, 186, 59, 0.7);
    background: linear-gradient(120deg, rgba(255, 186, 59, 0.2) 0%, rgba(24, 24, 24, 0.96) 100%);
}

.expiry-badge-danger {
    color: #ffe0e0;
    border-color: rgba(255, 82, 82, 0.7);
    background: linear-gradient(120deg, rgba(255, 82, 82, 0.2) 0%, rgba(24, 24, 24, 0.96) 100%);
}

.expiry-inline-editor {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.expiry-inline-editor .form-control {
    min-width: 135px;
}

.confirm-modal {
    background: var(--fazen-surface);
    border: 1px solid #2f2f2f;
    color: var(--fazen-text);
    border-radius: 14px;
    box-shadow: 0 20px 36px rgba(0, 0, 0, 0.4);
}

.confirm-modal .modal-title {
    color: var(--fazen-text);
}

#confirmActionModal.confirm-variant-success .confirm-modal {
    border-color: rgba(88, 166, 255, 0.65);
    box-shadow: 0 0 0 1px rgba(88, 166, 255, 0.2) inset, 0 20px 36px rgba(0, 0, 0, 0.4);
}

#confirmActionModal.confirm-variant-danger .confirm-modal {
    border-color: rgba(255, 82, 82, 0.7);
    box-shadow: 0 0 0 1px rgba(255, 82, 82, 0.2) inset, 0 20px 36px rgba(0, 0, 0, 0.4);
}

#confirmActionModal.confirm-variant-warning .confirm-modal {
    border-color: rgba(255, 186, 59, 0.75);
    box-shadow: 0 0 0 1px rgba(255, 186, 59, 0.24) inset, 0 20px 36px rgba(0, 0, 0, 0.4);
}

.notification-toggle-panel {
    background: linear-gradient(145deg, rgba(39, 39, 39, 0.95) 0%, rgba(27, 27, 27, 0.95) 100%);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
}

.notification-toggle-panel .form-check {
    margin-bottom: 0;
}

.notification-toggle-panel .form-check-label {
    color: #e6e6e6;
    font-weight: 600;
    user-select: none;
}

.notification-toggle-panel .form-check-input {
    width: 2.65rem;
    height: 1.35rem;
    margin-top: 0.18rem;
    background-color: #3a3a3a;
    border-color: #4a4a4a;
}

.notification-toggle-panel .form-check-input:checked {
    background-color: var(--fazen-accent);
    border-color: var(--fazen-accent);
}

.floating-tools-link {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1040;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(88, 166, 255, 0.75);
    background: linear-gradient(120deg, rgba(88, 166, 255, 0.24) 0%, rgba(24, 24, 24, 0.96) 100%);
    color: #e8f3ff;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.floating-tools-link:hover,
.floating-tools-link:focus {
    color: #f4f9ff;
    border-color: rgba(122, 184, 255, 0.95);
    background: linear-gradient(120deg, rgba(122, 184, 255, 0.28) 0%, rgba(24, 24, 24, 0.98) 100%);
}

.dashboard-refresh-status {
    font-size: 0.82rem;
    color: var(--fazen-text-muted);
}

.dashboard-refresh-status.is-loading {
    color: #a8ccff;
}

.mail-smtp-card {
    border-color: rgba(88, 166, 255, 0.25);
}

.mail-smtp-meta {
    display: grid;
    gap: 0.35rem;
    font-size: 0.9rem;
}

.mail-preview-shell {
    background: #121212;
    border: 1px solid #2c2c2c;
    border-radius: 12px;
    overflow: hidden;
    min-height: 520px;
}

.mail-preview-frame {
    width: 100%;
    height: 100%;
    min-height: 520px;
    border: 0;
    background: #121212;
}

.mail-attachment-list {
    list-style: none;
    padding: 0;
    display: grid;
    gap: 0.45rem;
}

.mail-attachment-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.7rem;
    border-radius: 10px;
    border: 1px solid rgba(88, 166, 255, 0.35);
    background: linear-gradient(120deg, rgba(88, 166, 255, 0.1) 0%, rgba(24, 24, 24, 0.96) 100%);
    color: #e3f0ff;
    font-size: 0.82rem;
}

.mail-attachment-list .attachment-size {
    margin-left: auto;
    color: var(--fazen-text-muted);
    font-size: 0.75rem;
}
