* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #17a2b8;
    --dark-color: #34495e;
    --light-color: #ecf0f1;
    --sidebar-width: 250px;
    --header-height: 60px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

body.loading-active {
    cursor: wait;
    user-select: none;
}

/* Login Sayfası */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-box h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.login-box h2 {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 18px;
    font-weight: normal;
}

.login-info {
    text-align: center;
    color: #999;
    font-size: 12px;
    margin-top: 20px;
}

/* Modern Login */
.login-page {
    background:
        radial-gradient(circle at 20% 15%, rgba(59, 130, 246, 0.22), transparent 40%),
        radial-gradient(circle at 80% 85%, rgba(14, 165, 233, 0.16), transparent 36%),
        linear-gradient(140deg, #0b1220 0%, #0f172a 46%, #1e293b 100%);
}

.login-container {
    width: 100%;
    max-width: 520px;
    padding: 24px;
}

.login-box {
    position: relative;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(191, 219, 254, 0.55);
    border-radius: 18px;
    padding: 30px 30px 24px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.32);
    backdrop-filter: blur(3px);
}

.login-top-line {
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, #2563eb 0%, #0ea5e9 100%);
    margin-bottom: 18px;
}

.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}

.login-box h1 {
    margin: 0;
    color: #0f172a;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.4px;
}

.login-brand-badge {
    display: inline-flex;
    align-items: center;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
}

.login-box h2 {
    text-align: center;
    color: #334155;
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
}

.login-subtitle {
    margin: 0 0 18px;
    text-align: center;
    color: #64748b;
    font-size: 13px;
}

.login-page .form-group {
    margin-bottom: 14px;
}

.login-page .form-group label {
    color: #334155;
    font-size: 13px;
    margin-bottom: 6px;
}

.login-page .form-group input {
    border-radius: 11px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    padding: 11px 12px;
}

.login-page .form-group input:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.login-page .btn.btn-primary.btn-block {
    margin-top: 6px;
    border-radius: 11px;
    padding: 12px 14px;
    font-weight: 700;
}

.login-recaptcha-group {
    display: flex;
    justify-content: center;
    margin-top: 2px;
    margin-bottom: 14px;
}

.login-footer-note {
    margin-top: 14px;
    border-top: 1px solid #e2e8f0;
    padding-top: 12px;
    text-align: center;
    color: #64748b;
    font-size: 12px;
}

.two-factor-box {
    max-width: 480px;
}

.two-factor-qr {
    display: flex;
    justify-content: center;
    margin: 14px 0;
}

.two-factor-qr img {
    width: 220px;
    height: 220px;
    border-radius: 12px;
    border: 1px solid #dbe8fb;
    background: #ffffff;
    padding: 10px;
}

.two-factor-app-help {
    margin: 0 0 14px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    text-align: center;
}

.two-factor-app-help p {
    margin: 0 0 10px;
    color: #475569;
    font-size: 13px;
}

.two-factor-store-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.two-factor-store-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 118px;
    border-radius: 9px;
    background: #1e293b;
    color: #ffffff;
    padding: 8px 12px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
}

.two-factor-store-links a:hover {
    background: #2563eb;
    color: #ffffff;
}

.two-factor-secret {
    margin: 0 0 16px;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    background: #eff6ff;
    padding: 12px;
    text-align: center;
}

.two-factor-secret span {
    display: block;
    color: #64748b;
    font-size: 12px;
    margin-bottom: 4px;
}

.two-factor-secret strong {
    display: block;
    color: #0f172a;
    font-size: 16px;
    letter-spacing: 1px;
    word-break: break-all;
}

.two-factor-recovery {
    margin: 0 0 16px;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    background: #f8fbff;
    padding: 12px;
}

.two-factor-recovery-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.two-factor-recovery-head strong {
    color: #1e40af;
    font-size: 13px;
}

.two-factor-recovery-head span {
    color: #64748b;
    font-size: 12px;
}

.two-factor-code-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.two-factor-code-grid code {
    display: block;
    padding: 8px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #dbe8fb;
    color: #0f172a;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
}

.remember-device-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0 14px;
    color: #334155;
    font-size: 13px;
}

.remember-device-check input {
    width: auto;
}

.two-factor-footer-actions {
    margin-top: 14px;
    border-top: 1px solid #e2e8f0;
    padding-top: 12px;
    display: flex;
    justify-content: center;
}

.two-factor-logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.18s ease;
}

.two-factor-logout-btn:hover {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

.two-factor-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
    line-height: 1;
    padding: 5px 8px;
}

.header-right {
    min-width: 0;
}

.header-right > .btn.btn-sm.btn-danger {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.two-factor-warning-bar {
    margin: 14px 18px 0;
    padding: 12px 14px;
    border: 1px solid #fde68a;
    border-radius: 12px;
    background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
    color: #78350f;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 18px rgba(146, 64, 14, 0.08);
}

.two-factor-warning-bar div {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.two-factor-warning-bar strong {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.two-factor-warning-bar span {
    color: #92400e;
    font-size: 13px;
}

/* Wrapper */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: #ffffff;
    color: #1f2937;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s;
    z-index: 1000;
    border-right: 1px solid #e5e7eb;
    box-shadow: 4px 0 25px rgba(15,23,42,0.05);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #edf2f7;
    text-align: center;
}

.sidebar-header h3 {
    font-size: 0;
}

.sidebar-brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar-brand-logo img {
    max-width: 150px;
    height: auto;
}

.sidebar-brand-logo .logo-dark {
    display: none;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    flex: 1;
}

.sidebar-note {
    margin: auto 8px 10px;
    padding: 10px 11px;
    border-radius: 10px;
    border: 1px solid #dbe8fb;
    background: #f8fbff;
    color: #334155;
    font-size: 11px;
    line-height: 1.45;
}

.sidebar-note small {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 10px;
}

.sidebar-menu li {
    border-bottom: 1px solid #f1f5f9;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #4b5563;
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-menu li a:hover,
.sidebar-menu li.active a {
    background: #eff6ff;
    color: #1d4ed8;
}

.sidebar-menu li a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    transition: margin-left 0.3s;
}

/* Top Header */
.top-header {
    background: white;
    padding: 15px 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    min-width: 0;
}

.header-left {
    display: flex;
    align-items: center;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    margin-right: 15px;
    color: var(--dark-color);
    display: none;
}

.top-header h2 {
    font-size: 24px;
    color: var(--dark-color);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    max-width: 360px;
    white-space: nowrap;
}

.user-display-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Content Area */
.content-area {
    padding: 30px;
    padding-bottom: 100px; /* fixed footer buffer */
}

.loading-card {
    min-width: 230px;
    padding: 24px 28px;
}

.loading-spinner {
    width: 42px;
    height: 42px;
}

.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.92);
    color: #4b5563;
    text-align: center;
    padding: 10px 15px;
    font-size: 13px;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -1px 3px rgba(15, 23, 42, 0.08);
}

.site-footer a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

.site-footer a:hover {
    text-decoration: underline;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 24, 40, 0.8);
    z-index: 2000;
    backdrop-filter: blur(2px);
}

.loading-overlay.active {
    display: flex;
}

.loading-card {
    background: #fff;
    padding: 30px 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    min-width: 260px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #e5e7eb;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 15px;
    animation: spin 1s linear infinite;
}

.loading-message {
    font-weight: 600;
    color: #1f2d3d;
    margin-bottom: 6px;
}

.loading-subtext {
    color: #6b7280;
    font-size: 12px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 18px;
    color: var(--dark-color);
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

.dashboard-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.dashboard-card h3 {
    padding: 20px;
    border-bottom: 1px solid #eee;
    font-size: 18px;
    color: var(--dark-color);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.muaf-ip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.muaf-ip-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    color: #374151;
}

.muaf-ip-chip .chip-remove {
    border: none;
    background: transparent;
    color: #ef4444;
    cursor: pointer;
    padding: 0;
    font-size: 12px;
}

.muaf-ip-chip .chip-remove:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.muaf-ip-chip .inline-form {
    display: inline;
    margin: 0;
}

.muaf-ip-add-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
    border-top: 1px solid #f0f0f0;
    padding-top: 15px;
}


/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.stat-icon.blue { background: var(--primary-color); }
.stat-icon.green { background: var(--secondary-color); }
.stat-icon.orange { background: var(--warning-color); }
.stat-icon.red { background: var(--danger-color); }
.stat-icon.purple { background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%); }

.stat-info h3 {
    font-size: 28px;
    color: var(--dark-color);
    margin-bottom: 5px;
}

.stat-info p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

.stat-info small {
    color: #999;
    font-size: 12px;
}

.globe-visual-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.globe-wrapper {
    display: flex;
    justify-content: center;
}

.globe {
    position: relative;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #4fb0ff 0%, #1883d4 55%, #0f4c75 100%);
    box-shadow: inset -15px -15px 30px rgba(0,0,0,0.25), 0 15px 35px rgba(31,73,125,0.35);
    animation: spin-globe 18s linear infinite;
    overflow: hidden;
}

.globe::before {
    content: '';
    position: absolute;
    top: 0;
    left: -20%;
    width: 140%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 200"><path fill="%23ffffff20" d="M0,80 C60,120 80,40 140,60 C200,80 220,140 280,120 C340,100 360,40 400,60 L400,0 L0,0 Z"/><path fill="%23ffffff12" d="M0,140 C80,100 120,160 200,140 C280,120 320,60 400,80 L400,200 L0,200 Z"/></svg>') no-repeat center/cover;
    opacity: 0.6;
}

.globe-ring {
    position: absolute;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    border: 1px dashed rgba(255,255,255,0.3);
    top: -15px;
    left: -15px;
    animation: spin-ring 14s linear infinite;
}

.ring-2 {
    width: 280px;
    height: 280px;
    top: -30px;
    left: -30px;
    animation-duration: 22s;
    border-style: solid;
    border-color: rgba(255,255,255,0.18);
}

.globe-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffbe0b;
    box-shadow: 0 0 15px rgba(255,190,11,0.8);
    animation: pulse-dot 2.2s ease-in-out infinite;
}

.globe-dot.dot-a { top: 35%; left: 30%; }
.globe-dot.dot-b { top: 55%; right: 25%; animation-delay: .4s; }
.globe-dot.dot-c { bottom: 20%; left: 45%; animation-delay: .8s; }

.globe-info h3 {
    margin-bottom: 10px;
}

.globe-info p {
    margin-bottom: 20px;
    color: #666;
}

.attack-feed {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.attack-feed li {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f7faff;
    border: 1px solid #e1ecff;
    padding: 10px 14px;
    border-radius: 8px;
}

.attack-feed strong {
    color: #1b4d89;
}

.attack-feed small {
    display: block;
    color: #6c7a89;
}

.feed-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff4d4d;
    box-shadow: 0 0 10px rgba(255,77,77,0.8);
    animation: pulse-dot 1.4s ease-in-out infinite;
}

@keyframes spin-globe {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes spin-ring {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(0.8); opacity: 0.7; }
    50% { transform: scale(1.3); opacity: 1; }
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-header h2 {
    font-size: 28px;
    color: var(--dark-color);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-success {
    background: var(--secondary-color);
    color: white;
}

.btn-success:hover {
    background: #27ae60;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background: #d68910;
}

.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-info:hover {
    background: #138496;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: #f8f9fa;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    font-weight: 600;
    color: var(--dark-color);
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.text-center {
    text-align: center;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: var(--secondary-color);
    color: white;
}

.badge-danger {
    background: var(--danger-color);
    color: white;
}

.badge-warning {
    background: var(--warning-color);
    color: white;
}

.badge-info {
    background: var(--info-color);
    color: white;
}

.badge-purple {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: white;
}

.badge-admin {
    background: var(--danger-color);
    color: white;
    padding: 2px 6px;
    font-size: 10px;
    margin-left: 5px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--dark-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.filter-form {
    margin-bottom: 0;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    overflow: auto;
}

.modal-content {
    background: white;
    margin: 50px auto;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--dark-color);
}

.close {
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: var(--dark-color);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 20px;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-decoration: none;
    color: var(--dark-color);
}

.pagination a:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination .current {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Code */
code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.dns-content-short {
    display: inline-block;
    max-width: 380px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 20px;
        max-width: calc(100% - 40px);
    }
}

/* =========================
   Modern UI Refresh (Global)
   ========================= */

:root {
    --primary-color: #2563eb;
    --secondary-color: #16a34a;
    --danger-color: #dc2626;
    --warning-color: #d97706;
    --info-color: #0284c7;
    --dark-color: #0f172a;
    --light-color: #f8fafc;
}

body {
    background: #f1f5f9;
    color: #1e293b;
}

.sidebar {
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    box-shadow: 8px 0 24px rgba(15, 23, 42, 0.06);
    padding: 10px 12px;
}

.sidebar-header {
    border-bottom: 1px solid #f1f5f9;
    border-radius: 12px;
    padding: 18px 14px 24px;
    margin-bottom: 10px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    position: relative;
}

.sidebar-menu li {
    border-bottom: none;
    margin-bottom: 4px;
}

.sidebar-menu li a {
    color: #475569;
    font-weight: 500;
    border-radius: 10px;
    padding: 12px 14px;
    gap: 10px;
}

.sidebar-menu li a:hover,
.sidebar-menu li.active a {
    background: #eff6ff;
    color: #1d4ed8;
}

.main-content {
    background: transparent;
}

.top-header {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.top-header h2 {
    font-size: 22px;
    color: #0f172a;
    font-weight: 700;
}

.content-area {
    padding: 24px;
    padding-bottom: 100px;
}

.page-header {
    margin-bottom: 20px;
}

.page-header h2 {
    font-size: 28px;
    color: #0f172a;
    letter-spacing: -0.2px;
}

.card,
.dashboard-card,
.stat-card,
.globe-visual-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.card-header,
.dashboard-card h3 {
    border-bottom: 1px solid #f1f5f9;
}

.card-header h3,
.dashboard-card h3 {
    color: #0f172a;
    font-weight: 700;
}

.table thead {
    background: #f8fafc;
}

.table th,
.table td {
    border-bottom: 1px solid #eef2f7;
    vertical-align: middle;
}

.table th {
    color: #475569;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.table tbody tr:hover {
    background: #f8fafc;
}

.btn {
    border-radius: 10px;
    font-weight: 600;
    border: 1px solid transparent;
    padding: 9px 14px;
}

.btn-sm {
    border-radius: 8px;
    padding: 6px 10px;
}

.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary { background: #64748b; color: #fff; }
.btn-secondary:hover { background: #475569; }
.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-warning { background: #d97706; color: #fff; }
.btn-warning:hover { background: #b45309; }
.btn-info { background: #0284c7; color: #fff; }
.btn-info:hover { background: #0369a1; }

.badge {
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 11px;
    letter-spacing: 0.2px;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #e0f2fe; color: #0c4a6e; }
.badge-secondary { background: #e2e8f0; color: #334155; }
.badge-admin { background: #fef3c7; color: #854d0e; }

.form-group input,
.form-group select,
.form-group textarea {
    border: 1px solid #dbe2ea;
    border-radius: 10px;
    background: #fff;
    color: #0f172a;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.alert {
    border-radius: 12px;
    border-width: 1px;
}

.alert-success {
    background: #ecfdf3;
    color: #166534;
    border-color: #bbf7d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.alert-info {
    background: #eff6ff;
    color: #1e3a8a;
    border-color: #bfdbfe;
}

.modal {
    background: rgba(15, 23, 42, 0.5);
}

.modal-content {
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.22);
}

.modal-header,
.modal-footer {
    border-color: #f1f5f9;
}

.pagination a,
.pagination span {
    border-radius: 9px;
    border-color: #dbe2ea;
    color: #334155;
}

.pagination a:hover,
.pagination .current {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.site-footer {
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid #e2e8f0;
}

.sidebar-version-badge {
    position: absolute;
    right: 8px;
    bottom: 6px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 9px;
    cursor: pointer;
    line-height: 1;
}

.sidebar-version-badge:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

.release-notes-modal {
    max-width: 560px;
}

.release-notes-list {
    margin: 0;
    padding-left: 20px;
    color: #334155;
}

.release-notes-list li {
    margin-bottom: 10px;
    line-height: 1.5;
}

/* Sidebar usability improvements */
:root {
    --sidebar-width: 220px;
    --sidebar-collapsed-width: 78px;
}

.sidebar {
    width: var(--sidebar-width);
    z-index: 1300;
}

.main-content {
    margin-left: var(--sidebar-width);
}

.sidebar-toggle,
.sidebar-collapse-toggle {
    background: #f8fafc;
    border: 1px solid #dbe2ea;
    color: #334155;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle {
    display: none;
}

.sidebar-collapse-toggle {
    margin-right: 12px;
}

.sidebar-collapse-toggle:hover,
.sidebar-toggle:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #1e40af;
}

body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
    padding-left: 8px;
    padding-right: 8px;
}

body.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .sidebar-menu li a {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

body.sidebar-collapsed .sidebar-menu li a i {
    margin-right: 0;
}

body.sidebar-collapsed .sidebar-menu li a span {
    display: none;
}

body.sidebar-collapsed .sidebar-brand-logo {
    display: none;
}

body.sidebar-collapsed .sidebar-version-badge {
    right: 50%;
    transform: translateX(50%);
    font-size: 10px;
    padding: 4px 7px;
}

body.sidebar-collapsed .sidebar-note {
    display: none;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
    z-index: 1200;
    opacity: 0;
    visibility: hidden;
}

@media (max-width: 768px) {
    .sidebar-toggle {
        display: inline-flex;
    }

    .sidebar {
        width: 250px;
        transform: translateX(-110%);
        transition: transform 0.22s ease;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
    }

    .sidebar-collapse-toggle {
        display: none;
    }

    body.sidebar-open .sidebar-overlay {
        opacity: 1;
        visibility: visible;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .top-header {
        height: 52px;
        padding: 8px 12px;
    }

    .top-header h2 {
        font-size: 16px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 46vw;
    }

    .header-right {
        gap: 8px;
    }

    .header-right .user-info {
        display: none;
    }

    .two-factor-warning-bar {
        margin: 10px 12px 0;
        align-items: flex-start;
        flex-direction: column;
    }

    .header-right .btn.btn-sm {
        padding: 6px 8px;
        font-size: 11px;
        min-width: 34px;
    }

    .header-right .btn.btn-sm i {
        margin-right: 0;
    }

    .logout-label {
        display: none;
    }

    .theme-toggle-btn {
        width: 32px;
        height: 32px;
    }

    .sidebar-toggle {
        display: inline-flex !important;
        position: relative;
        z-index: 1401;
    }

    .sidebar {
        z-index: 1400;
    }

    .sidebar-note {
        margin-bottom: 64px;
    }
}

/* Gentle single animation: keep interface readable */
@keyframes softFadeUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-header,
.card,
.dashboard-card,
.stat-card,
.globe-visual-card,
.alert {
    animation: softFadeUp 0.35s ease-out both;
}

/* Keep visual effects subtle and text-focused */
.globe,
.globe-ring,
.globe-dot,
.feed-dot {
    animation-duration: 28s !important;
}

/* Compact cloud-inspired customer/admin panel polish */
:root {
    --sidebar-width: 208px;
    --sidebar-collapsed-width: 72px;
}

.sidebar {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border-right: 1px solid #dbe8fb;
    box-shadow: 8px 0 22px rgba(37, 99, 235, 0.06);
    padding: 8px 10px;
}

.sidebar-header {
    padding: 14px 10px 18px;
    margin-bottom: 8px;
}

.sidebar-brand-logo img {
    max-width: 124px;
}

.sidebar-menu li a {
    border-radius: 12px;
    font-size: 13px;
    padding: 10px 12px;
}

.sidebar-menu li a i {
    width: 18px;
}

.sidebar-version-badge {
    right: 6px;
    bottom: 4px;
    font-size: 10px;
    padding: 4px 8px;
    letter-spacing: 0.2px;
}

.top-header {
    height: 56px;
    padding: 10px 18px;
}

.top-header h2 {
    font-size: 19px;
}

.content-area {
    padding: 18px;
    padding-bottom: 92px;
}

.stats-grid {
    gap: 14px;
    margin-bottom: 18px;
}

.stat-card {
    border-radius: 12px;
    padding: 14px;
    gap: 12px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    font-size: 19px;
}

.stat-info h3 {
    font-size: 21px;
    margin-bottom: 2px;
}

.stat-info p {
    font-size: 12px;
}

.card-header,
.card-body,
.card-footer,
.dashboard-card h3 {
    padding-left: 16px;
    padding-right: 16px;
}

.card-header,
.dashboard-card h3 {
    padding-top: 14px;
    padding-bottom: 14px;
}

.card-body {
    padding-top: 14px;
    padding-bottom: 14px;
}

@media (max-width: 992px) {
    .sidebar {
        width: 236px;
    }

    .content-area {
        padding: 14px;
    }
}

/* Consistent cloud-like customer page style */
.domain-context-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    border-radius: 12px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1e3a8a;
}

.waf-modern-page .card,
.dns-modern-page .card,
.profile-modern-page .dashboard-card,
.domains-modern-page .domains-table-card {
    border: 1px solid #dbe8fb;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
}

.waf-modern-page .card-header,
.dns-modern-page .card-header,
.profile-modern-page .dashboard-card h3 {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.waf-modern-page .table th,
.dns-modern-page .table th,
.profile-modern-page .table th {
    font-size: 11px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: #64748b;
}

.waf-modern-page .table td,
.dns-modern-page .table td,
.profile-modern-page .table td {
    padding-top: 10px;
    padding-bottom: 10px;
}

.waf-modern-page .btn,
.dns-modern-page .btn,
.profile-modern-page .btn,
.domains-modern-page .btn {
    border-radius: 9px;
}

.waf-modern-page .btn-sm,
.dns-modern-page .btn-sm,
.profile-modern-page .btn-sm,
.domains-modern-page .btn-sm {
    padding: 5px 9px;
    font-size: 12px;
}

.disabled-rule-action-wrap {
    display: inline-block;
    cursor: not-allowed;
}

.btn-disabled-rule,
.btn-disabled-rule:hover {
    opacity: 0.55;
    cursor: not-allowed;
    filter: grayscale(0.15);
    box-shadow: none;
}

.waf-modern-page .modal-content,
.dns-modern-page .modal-content,
.domains-modern-page .modal-content {
    border-radius: 14px;
    border: 1px solid #dbe8fb;
}

.waf-modern-page .modal-header,
.dns-modern-page .modal-header,
.domains-modern-page .modal-header {
    border-bottom: 1px solid #e5efff;
}

/* Customer domains page (was inline in domains.php) */
.domains-modern-page .page-header {
    margin-bottom: 22px;
    padding: 18px 22px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #ffffff;
}

.domains-modern-page .domains-modern-title {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.domains-modern-page .domains-modern-title h2 {
    margin: 0;
    font-size: 26px;
    color: #0f172a;
}

.domains-modern-page .domains-modern-title small {
    color: #64748b;
    font-size: 13px;
}

.domains-modern-page .domains-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.domains-modern-page .domains-stat {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    padding: 14px 16px;
}

.domains-modern-page .domains-stat-label {
    display: block;
    color: #64748b;
    font-size: 12px;
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.domains-modern-page .domains-stat-value {
    color: #0f172a;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.domains-modern-page .domains-table-card {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.04);
}

.domains-modern-page .domains-table-card .table thead {
    background: #f8fafc;
}

.domains-modern-page .domains-table-card .table th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #64748b;
    padding: 14px 12px;
}

.domains-modern-page .domains-table-card .table td {
    padding: 14px 12px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.domains-modern-page .domains-table-card .table tbody tr:last-child td {
    border-bottom: none;
}

.domains-modern-page .domain-name {
    color: #0f172a;
    font-weight: 700;
}

.domains-modern-page .domain-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.domains-modern-page .domain-actions .btn {
    border-radius: 8px;
}

.domains-modern-page .domain-actions .btn-sm {
    padding: 6px 10px;
}

.domains-modern-page .domains-table-card .pagination {
    border-top: 1px solid #f1f5f9;
    background: #fff;
}

body.dark-mode .domains-modern-page .domains-stat {
    background: linear-gradient(180deg, #0b1220 0%, #111c31 100%);
    border-color: #334155;
    box-shadow: 0 8px 20px rgba(2, 6, 23, 0.35);
}

body.dark-mode .domains-modern-page .domains-stat-label {
    color: #93c5fd;
}

body.dark-mode .domains-modern-page .domains-stat-value {
    color: #f8fafc;
}

body.dark-mode .domains-modern-page .domains-modern-title h2 {
    color: #f8fafc;
}

body.dark-mode .domains-modern-page .domains-modern-title small {
    color: #94a3b8;
}

body.dark-mode .domains-modern-page .domains-table-card .table thead {
    background: #0f1a2d;
}

body.dark-mode .domains-modern-page .domains-table-card .table th {
    color: #7dd3fc;
}

body.dark-mode .domains-modern-page .domains-table-card .table td {
    border-bottom-color: #1e293b;
    color: #cbd5e1;
}

body.dark-mode .domains-modern-page .domain-name {
    color: #e2e8f0;
}

body.dark-mode .domains-modern-page .domains-table-card .pagination {
    border-top-color: #1e293b;
    background: #0f172a;
}

@media (max-width: 768px) {
    .domain-context-alert {
        padding: 12px;
    }

    .domains-modern-page .page-header {
        padding: 14px 16px;
    }

    .domains-modern-page .domains-modern-title h2 {
        font-size: 22px;
    }
}

/* Premium modern refresh */
body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(circle at 16% 10%, rgba(37, 99, 235, 0.08), transparent 34%),
        radial-gradient(circle at 84% 88%, rgba(14, 165, 233, 0.08), transparent 32%),
        #f1f6ff;
}

.top-header {
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid #dbe8fb;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(7px);
}

.card,
.dashboard-card,
.stat-card,
.globe-visual-card,
.domains-modern-page .domains-table-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border-color: #dbe8fb;
}

.table thead {
    background: #f2f7ff;
}

.table tbody tr {
    transition: background-color 0.18s ease;
}

.table tbody tr:hover {
    background: #f4f8ff;
}

.modern-modal-sm {
    max-width: 520px;
}

.modern-modal-md {
    max-width: 620px;
}

.modal-header-accent,
.modal-header-blue,
.modal-header-danger,
.modal-header-orange {
    color: #ffffff;
}

.modal-header-accent {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.modal-header-blue {
    background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
}

.modal-header-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.modal-header-orange {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

.close-light {
    color: #ffffff;
}

.modal-body-md {
    padding: 24px;
}

.modal-body-lg {
    padding: 30px;
}

.modern-modal-footer {
    padding: 14px 22px;
    border-top: 1px solid #e5efff;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.mb-20 { margin-bottom: 20px; }
.mb-15 { margin-bottom: 15px; }
.mb-10 { margin-bottom: 10px; }
.mb-8 { margin-bottom: 8px; }

.modal-muted-text {
    color: #64748b;
}

.text-strong {
    color: #334155;
}

.text-title-strong {
    color: #0f172a;
}

.text-danger-strong {
    color: #dc2626;
}

.text-orange-strong {
    color: #ea580c;
}

.modal-state-icon {
    font-size: 46px;
    margin-bottom: 15px;
}

.modal-danger-icon {
    font-size: 46px;
    margin-bottom: 15px;
    color: #ef4444;
}

.modal-warning-box {
    background: #fef3c7;
    color: #92400e;
    border-radius: 10px;
    border: 1px solid #fde68a;
    padding: 12px 14px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.modal-icon-circle {
    width: 68px;
    height: 68px;
    margin: 0 auto 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.modal-icon-orange {
    background: rgba(249, 115, 22, 0.14);
    color: #f97316;
}

.hide-by-default {
    display: none;
}

.flex-1 {
    flex: 1;
}

.uam-countdown-wrap {
    margin-top: 8px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.uam-countdown {
    min-width: 220px;
    max-width: 320px;
    flex: 1;
}

.uam-countdown-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 5px;
    color: #64748b;
    font-size: 12px;
}

.uam-countdown-meta strong {
    color: #dc2626;
    white-space: nowrap;
}

.uam-countdown-bar {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #fee2e2;
    border: 1px solid #fecaca;
}

.uam-countdown-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ef4444 0%, #f97316 100%);
    transition: width 0.4s ease;
}

/* Admin panel full modern consistency */
.admin-modern-page .page-header {
    padding: 16px 18px;
    border: 1px solid #dbe8fb;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    margin-bottom: 16px;
}

.admin-modern-page .page-header h2 {
    font-size: 23px;
    letter-spacing: -0.2px;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-modern-page .stats-grid {
    margin-bottom: 16px;
}

.admin-modern-page .card,
.admin-modern-page .dashboard-card {
    border: 1px solid #dbe8fb;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.admin-modern-page .card-header,
.admin-modern-page .dashboard-card h3 {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.admin-modern-page .table th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #64748b;
}

.admin-modern-page .table td {
    padding-top: 10px;
    padding-bottom: 10px;
}

.input-readonly-soft {
    background: #f8fafc !important;
    color: #334155;
}

.theme-toggle-btn {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.theme-toggle-btn:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
}

/* Full dark mode */
body.dark-mode {
    background:
        radial-gradient(circle at 14% 12%, rgba(37, 99, 235, 0.16), transparent 34%),
        radial-gradient(circle at 84% 88%, rgba(14, 165, 233, 0.14), transparent 34%),
        #050a16;
    color: #e2e8f0;
}

body.dark-mode .sidebar {
    background: linear-gradient(180deg, #0b1220 0%, #111b2e 100%);
    border-right-color: #1e293b;
    box-shadow: 8px 0 24px rgba(2, 6, 23, 0.7);
}

body.dark-mode .sidebar-brand-logo .logo-light {
    display: none;
}

body.dark-mode .sidebar-brand-logo .logo-dark {
    display: block;
    filter: brightness(0) invert(1) drop-shadow(0 1px 2px rgba(148, 163, 184, 0.35));
}

body.dark-mode .sidebar-header {
    border-bottom-color: #1e293b;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.6) 100%);
}

body.dark-mode .sidebar-menu li a {
    color: #94a3b8;
}

body.dark-mode .sidebar-note {
    background: rgba(15, 23, 42, 0.72);
    border-color: #334155;
    color: #cbd5e1;
}

body.dark-mode .sidebar-note small {
    color: #94a3b8;
}

body.dark-mode .sidebar-menu li a:hover,
body.dark-mode .sidebar-menu li.active a {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.26), rgba(14, 165, 233, 0.14));
    color: #dbeafe;
    border: 1px solid rgba(59, 130, 246, 0.35);
}

body.dark-mode .main-content {
    color: #e2e8f0;
}

body.dark-mode .top-header {
    background: rgba(11, 18, 32, 0.9);
    border-bottom-color: #1e293b;
    box-shadow: 0 6px 18px rgba(2, 6, 23, 0.5);
}

body.dark-mode .top-header h2,
body.dark-mode .page-header h2,
body.dark-mode .card-header h3,
body.dark-mode .dashboard-card h3 {
    color: #f8fafc;
}

body.dark-mode .user-info {
    color: #cbd5e1;
}

body.dark-mode .theme-toggle-btn,
body.dark-mode .sidebar-toggle,
body.dark-mode .sidebar-collapse-toggle {
    background: #0f172a;
    border-color: #334155;
    color: #cbd5e1;
}

body.dark-mode .theme-toggle-btn:hover,
body.dark-mode .sidebar-toggle:hover,
body.dark-mode .sidebar-collapse-toggle:hover {
    background: #1e293b;
    border-color: #475569;
}

body.dark-mode .card,
body.dark-mode .dashboard-card,
body.dark-mode .stat-card,
body.dark-mode .globe-visual-card,
body.dark-mode .admin-modern-page .page-header,
body.dark-mode .domains-modern-page .page-header,
body.dark-mode .domains-modern-page .domains-table-card {
    background: linear-gradient(180deg, #0b1220 0%, #111c31 100%);
    border-color: #1e293b;
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.45);
}

body.dark-mode .stat-info h3 {
    color: #f8fafc;
}

body.dark-mode .card-header,
body.dark-mode .dashboard-card h3,
body.dark-mode .admin-modern-page .card-header {
    background: linear-gradient(180deg, #111b2d 0%, #0f172a 100%);
    border-bottom-color: #1e293b;
}

body.dark-mode .table thead {
    background: #0f1a2d;
}

body.dark-mode .table th {
    color: #7dd3fc;
    border-bottom-color: #1e293b;
}

body.dark-mode .table td {
    color: #cbd5e1;
    border-bottom-color: #1e293b;
}

body.dark-mode .table tbody tr:hover {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.16), rgba(14, 165, 233, 0.08));
}

body.dark-mode .form-group label,
body.dark-mode .modal-muted-text,
body.dark-mode small,
body.dark-mode .stat-info p,
body.dark-mode .stat-info small {
    color: #94a3b8;
}

body.dark-mode .form-group input,
body.dark-mode .form-group select,
body.dark-mode .form-group textarea,
body.dark-mode .input-readonly-soft {
    background: #0f172a !important;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark-mode .form-group input:focus,
body.dark-mode .form-group select:focus,
body.dark-mode .form-group textarea:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.28);
}

body.dark-mode .btn {
    border-color: rgba(148, 163, 184, 0.12);
    box-shadow: 0 2px 8px rgba(2, 6, 23, 0.3);
}

body.dark-mode .btn-primary { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
body.dark-mode .btn-primary:hover { background: linear-gradient(135deg, #3b82f6, #2563eb); }
body.dark-mode .btn-success { background: linear-gradient(135deg, #16a34a, #15803d); }
body.dark-mode .btn-success:hover { background: linear-gradient(135deg, #22c55e, #16a34a); }
body.dark-mode .btn-danger { background: linear-gradient(135deg, #dc2626, #b91c1c); }
body.dark-mode .btn-danger:hover { background: linear-gradient(135deg, #ef4444, #dc2626); }
body.dark-mode .btn-warning { background: linear-gradient(135deg, #d97706, #b45309); }
body.dark-mode .btn-warning:hover { background: linear-gradient(135deg, #f59e0b, #d97706); }
body.dark-mode .btn-info { background: linear-gradient(135deg, #0284c7, #0369a1); }
body.dark-mode .btn-info:hover { background: linear-gradient(135deg, #0ea5e9, #0284c7); }
body.dark-mode .btn-secondary { background: linear-gradient(135deg, #475569, #334155); }
body.dark-mode .btn-secondary:hover { background: linear-gradient(135deg, #64748b, #475569); }

body.dark-mode .alert-success {
    background: rgba(22, 163, 74, 0.18);
    color: #bbf7d0;
    border-color: rgba(34, 197, 94, 0.35);
}

body.dark-mode .alert-error {
    background: rgba(220, 38, 38, 0.16);
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.3);
}

body.dark-mode .alert-info,
body.dark-mode .domain-context-alert {
    background: rgba(30, 64, 175, 0.2);
    color: #bfdbfe;
    border-color: rgba(59, 130, 246, 0.35);
}

body.dark-mode .badge-success { background: rgba(22, 163, 74, 0.2); color: #bbf7d0; }
body.dark-mode .badge-danger { background: rgba(220, 38, 38, 0.22); color: #fecaca; }
body.dark-mode .badge-warning { background: rgba(217, 119, 6, 0.24); color: #fde68a; }
body.dark-mode .badge-info { background: rgba(2, 132, 199, 0.24); color: #bae6fd; }
body.dark-mode .badge-secondary { background: rgba(51, 65, 85, 0.7); color: #cbd5e1; }
body.dark-mode .badge-admin { background: rgba(245, 158, 11, 0.22); color: #fcd34d; }

body.dark-mode .badge {
    border: 1px solid rgba(148, 163, 184, 0.24);
}

body.dark-mode .modal {
    background: rgba(2, 6, 23, 0.7);
}

body.dark-mode .loading-overlay {
    background: rgba(2, 6, 23, 0.8);
}

body.dark-mode .loading-card {
    background: linear-gradient(180deg, #0b1220 0%, #111b2f 100%);
    border: 1px solid #1e293b;
    box-shadow: 0 20px 45px rgba(2, 6, 23, 0.75);
}

body.dark-mode .loading-spinner {
    border-color: #334155;
    border-top-color: #60a5fa;
}

body.dark-mode .loading-message {
    color: #e2e8f0;
}

body.dark-mode .loading-subtext {
    color: #94a3b8;
}

body.dark-mode .modal-content {
    background: linear-gradient(180deg, #0b1220 0%, #111b2f 100%);
    border-color: #1e293b;
    box-shadow: 0 20px 45px rgba(2, 6, 23, 0.75);
}

body.dark-mode .modal-header,
body.dark-mode .modal-footer {
    border-color: #1e293b;
}

body.dark-mode .modal-header h3 {
    color: #f8fafc;
}

body.dark-mode .close {
    color: #cbd5e1;
}

body.dark-mode .close:hover {
    color: #ffffff;
}

body.dark-mode .release-notes-modal .modal-body {
    color: #e2e8f0;
}

body.dark-mode .release-notes-list {
    color: #cbd5e1;
}

body.dark-mode .release-notes-list li {
    color: #cbd5e1;
}

body.dark-mode .site-footer {
    background: rgba(11, 18, 32, 0.95);
    border-top-color: #1e293b;
    color: #94a3b8;
}

body.dark-mode .site-footer a {
    color: #93c5fd;
}

body.dark-mode code {
    background: #0f172a;
    color: #bfdbfe;
}

body.dark-mode .pagination a,
body.dark-mode .pagination span {
    background: #0f172a;
    border-color: #334155;
    color: #cbd5e1;
}

body.dark-mode .pagination a:hover,
body.dark-mode .pagination .current {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

body.dark-mode .card-footer {
    background: #0f172a;
    border-top-color: #1e293b;
    color: #cbd5e1;
}

body.dark-mode .text-title-strong {
    color: #f8fafc;
}

body.dark-mode .attack-feed li {
    background: rgba(30, 41, 59, 0.8);
    border-color: #334155;
}

body.dark-mode .attack-feed strong {
    color: #bfdbfe;
}

body.dark-mode .attack-feed small {
    color: #94a3b8;
}

body.dark-mode .feed-dot {
    background: #60a5fa;
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.8);
}

@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    .main-content {
        min-width: 0;
    }

    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .users-table th:nth-child(1),
    .users-table td:nth-child(1),
    .users-table th:nth-child(4),
    .users-table td:nth-child(4),
    .users-table th:nth-child(7),
    .users-table td:nth-child(7) {
        display: none;
    }

    .admin-domains-table th:nth-child(1),
    .admin-domains-table td:nth-child(1),
    .admin-domains-table th:nth-child(4),
    .admin-domains-table td:nth-child(4),
    .admin-domains-table th:nth-child(6),
    .admin-domains-table td:nth-child(6) {
        display: none;
    }

    .customer-domains-table th:nth-child(5),
    .customer-domains-table td:nth-child(5) {
        display: none;
    }

    .customer-domains-table .domain-actions {
        gap: 4px;
    }

    .customer-domains-table .domain-actions .btn {
        font-size: 11px;
        padding: 5px 7px;
    }
}

/* Dark mode login compatibility */
body.login-page.dark-mode {
    background:
        radial-gradient(circle at 18% 16%, rgba(59, 130, 246, 0.25), transparent 38%),
        radial-gradient(circle at 80% 84%, rgba(14, 165, 233, 0.2), transparent 36%),
        linear-gradient(140deg, #050a16 0%, #0b1220 52%, #111827 100%);
}

body.login-page.dark-mode .login-box {
    background: linear-gradient(180deg, rgba(11, 18, 32, 0.96) 0%, rgba(15, 23, 42, 0.96) 100%);
    border: 1px solid #334155;
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.65);
}

body.login-page.dark-mode .login-box h2 {
    color: #f8fafc;
}

body.login-page.dark-mode .login-subtitle,
body.login-page.dark-mode .login-footer-note,
body.login-page.dark-mode .login-page .form-group label {
    color: #94a3b8;
}

body.login-page.dark-mode .login-page .form-group input {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

body.login-page.dark-mode .login-page .form-group input::placeholder {
    color: #64748b;
}

body.login-page.dark-mode .login-page .form-group input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.28);
}

body.login-page.dark-mode .login-footer-note {
    border-top-color: #334155;
}

body.login-page.dark-mode .two-factor-app-help,
body.login-page.dark-mode .two-factor-secret,
body.login-page.dark-mode .two-factor-recovery {
    background: rgba(15, 23, 42, 0.86);
    border-color: #334155;
}

body.login-page.dark-mode .two-factor-app-help p,
body.login-page.dark-mode .two-factor-secret span,
body.login-page.dark-mode .two-factor-recovery-head span,
body.login-page.dark-mode .remember-device-check {
    color: #94a3b8;
}

body.login-page.dark-mode .two-factor-secret strong,
body.login-page.dark-mode .two-factor-recovery-head strong {
    color: #bfdbfe;
}

body.login-page.dark-mode .two-factor-code-grid code {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

body.login-page.dark-mode .two-factor-footer-actions {
    border-top-color: #334155;
}

body.login-page.dark-mode .two-factor-logout-btn {
    background: #0f172a;
    border-color: #334155;
    color: #cbd5e1;
}

body.login-page.dark-mode .two-factor-logout-btn:hover {
    background: #1e293b;
    border-color: #60a5fa;
    color: #bfdbfe;
}

body.login-page.dark-mode .alert-error {
    background: rgba(220, 38, 38, 0.2);
    border-color: rgba(248, 113, 113, 0.36);
    color: #fecaca;
}

