/* ============================================
   Tradesteady Algo Portal - Professional Trading UI
   Inspired by TradeSteady.in
   ============================================ */

:root {
    --primary-dark: #1a2940;
    --primary-navy: #243b55;
    --primary-blue: #2563eb;
    --accent-gold: #d4a84b;
    --accent-gold-light: #e6c370;
    --accent-gold-dark: #b8923d;
    --success-green: #10b981;
    --danger-red: #ef4444;
    --error-red: #ef4444;
    --warning-yellow: #f59e0b;
    --text-dark: #1a2940;
    --text-light: #6b7280;
    --text-white: #ffffff;
    --bg-white: #ffffff;
    --bg-light: #f8f9fa;
    --bg-dark: #1a2940;
    --border-light: #e5e7eb;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 15px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-dark);
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.6;
}

/* ============================================
   Global link + focus normalization
   Prevent "stuck blue" visited/focus states across browsers.
   ============================================ */
a {
    color: var(--primary-dark);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

a:visited {
    color: var(--primary-dark);
}

a:hover {
    color: var(--accent-gold);
}

a:focus {
    outline: none;
}

a:focus-visible {
    box-shadow: 0 0 0 3px rgba(212, 168, 75, 0.20);
    border-radius: 10px;
}

button,
.btn,
.tab-btn,
.nav-links a,
.nav-dropdown-menu a {
    -webkit-tap-highlight-color: transparent;
}

button:focus {
    outline: none;
}

button:focus-visible {
    box-shadow: 0 0 0 3px rgba(212, 168, 75, 0.20);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px;
}

/* Used by `admin-tv-access.html` */
.dashboard-main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px;
}

.dashboard-header {
    background: var(--bg-white);
    padding: 28px;
    border-radius: var(--radius-lg);
    margin: 24px 0;
    box-shadow: var(--shadow-sm);
}

.dashboard-header h1 {
    color: var(--primary-dark);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.dashboard-header p {
    color: var(--text-light);
    font-size: 15px;
}

/* ============================================
   Navbar
   ============================================ */
.navbar {
    background: var(--bg-white);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 15px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.nav-brand:visited {
    color: inherit;
}

.nav-brand:focus {
    outline: none;
}

.nav-brand:focus-visible {
    outline: 3px solid rgba(212, 168, 75, 0.35);
    outline-offset: 4px;
    border-radius: 12px;
}

.nav-brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-navy));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-gold);
    font-weight: 700;
    font-size: 18px;
}

.nav-brand-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-dark);
}

.nav-brand-text span {
    color: var(--accent-gold);
}

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

.nav-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nav-dropdown-trigger {
    user-select: none;
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 220px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 120;
}

.nav-dropdown-menu a {
    display: block;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-dark);
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
}

.nav-dropdown-menu a:visited {
    color: var(--text-dark);
}

.nav-dropdown-menu a:hover {
    background: var(--bg-light);
}

.nav-dropdown-menu a:focus {
    outline: none;
}

.nav-dropdown-menu a:focus-visible {
    background: var(--bg-light);
    box-shadow: 0 0 0 3px rgba(212, 168, 75, 0.18);
}

/* ============================================
   Promo Banner
   ============================================ */
.promo-banner {
    position: relative;
    isolation: isolate;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid rgba(212, 168, 75, 0.35);
    box-shadow: 0 12px 40px rgba(0,0,0,0.22);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.promo-banner:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.28);
}

.promo-banner::before {
    content: "";
    position: absolute;
    inset: -6px;
    background:
        conic-gradient(
            from 180deg,
            rgba(212, 168, 75, 0.0),
            rgba(212, 168, 75, 0.9),
            rgba(59, 130, 246, 0.75),
            rgba(16, 185, 129, 0.75),
            rgba(239, 68, 68, 0.75),
            rgba(212, 168, 75, 0.9),
            rgba(212, 168, 75, 0.0)
        );
    filter: blur(16px);
    opacity: 0.55;
    z-index: 0;
    animation: promoGlowSpin 5.5s linear infinite;
    pointer-events: none;
}

.promo-banner-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
    color: var(--text-white);
    background: radial-gradient(1200px circle at 20% 30%, rgba(212, 168, 75, 0.35), rgba(26, 41, 64, 0.9)),
                linear-gradient(135deg, var(--primary-dark), var(--primary-navy));
    z-index: 1;
}

.promo-banner-inner::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.22) 18%, transparent 36%);
    transform: translateX(-120%);
    animation: promoShimmer 3.0s infinite;
    pointer-events: none;
}

@keyframes promoGlowSpin {
    0% { transform: rotate(0turn); }
    100% { transform: rotate(1turn); }
}

@keyframes promoShimmer {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(120%); }
}

.promo-badge {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.96), rgba(239, 68, 68, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: rgba(17, 24, 39, 0.96);
    font-weight: 800;
    font-size: 11px;
    padding: 6px 10px;
    border-radius: 999px;
    letter-spacing: 0.9px;
    box-shadow: 0 10px 22px rgba(245, 158, 11, 0.25);
    animation: promoBadgePulse 1.8s ease-in-out infinite;
}

@keyframes promoBadgePulse {
    0%, 100% { transform: translateY(0); box-shadow: 0 10px 22px rgba(245, 158, 11, 0.25); }
    50% { transform: translateY(-1px); box-shadow: 0 14px 32px rgba(245, 158, 11, 0.35); }
}

.promo-title {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0,0,0,0.25);
}

.promo-title strong {
    color: var(--accent-gold-light);
    text-shadow: 0 0 22px rgba(212, 168, 75, 0.55), 0 2px 10px rgba(0,0,0,0.25);
}

.promo-subtitle {
    margin-top: 4px;
    font-size: 13px;
    opacity: 0.95;
    color: rgba(255,255,255,0.9);
}

.promo-ticker {
    margin-top: 10px;
    overflow: hidden;
    border-top: 1px solid rgba(255,255,255,0.22);
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(0,0,0,0.18);
    backdrop-filter: blur(6px);
}

.promo-ticker-track {
    display: flex;
    gap: 28px;
    white-space: nowrap;
    font-size: 12px;
    opacity: 0.95;
    color: rgba(255,255,255,0.95);
    text-shadow: 0 1px 8px rgba(0,0,0,0.35);
    animation: promoMarquee 10s linear infinite;
}

@keyframes promoMarquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Promo banner CTA + outline button contrast */
.promo-banner .btn {
    width: auto;
    padding: 12px 18px;
    border-radius: 12px;
    font-weight: 800;
    letter-spacing: 0.2px;
}

.promo-banner .btn.btn-primary {
    width: auto;
    box-shadow: 0 10px 28px rgba(212, 168, 75, 0.28);
    animation: promoCtaPulse 2.2s ease-in-out infinite;
}

.promo-banner .btn.btn-primary:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 14px 38px rgba(212, 168, 75, 0.42);
}

@keyframes promoCtaPulse {
    0%, 100% { box-shadow: 0 10px 28px rgba(212, 168, 75, 0.28), 0 0 0 0 rgba(212, 168, 75, 0.30); }
    50% { box-shadow: 0 14px 36px rgba(212, 168, 75, 0.38), 0 0 0 10px rgba(212, 168, 75, 0.0); }
}

.promo-banner .btn.btn-outline {
    color: rgba(255,255,255,0.95);
    border-color: rgba(255,255,255,0.55);
    background: rgba(255,255,255,0.08);
}

.promo-banner .btn.btn-outline:hover {
    background: rgba(255,255,255,0.92);
    color: var(--primary-dark);
    border-color: rgba(255,255,255,0.92);
}

@media (max-width: 640px) {
    .promo-title { font-size: 18px; }
    .promo-banner-inner { padding: 16px 16px; }
    .promo-banner .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .promo-banner::before,
    .promo-banner-inner::before,
    .promo-badge,
    .promo-ticker-track,
    .promo-banner .btn.btn-primary {
        animation: none !important;
    }
    .promo-banner:hover {
        transform: none;
    }
}

.nav-links a {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: 14px;
}

.nav-links a:visited {
    color: var(--text-light);
}

.nav-links a:hover {
    color: var(--primary-dark);
    background: var(--bg-light);
}

.nav-links a:active {
    color: var(--primary-dark);
}

.nav-links a:focus {
    outline: none;
}

.nav-links a:focus-visible {
    color: var(--primary-dark);
    background: var(--bg-light);
    box-shadow: 0 0 0 3px rgba(212, 168, 75, 0.18);
}

/* Only highlight top-level nav items (avoid dropdown menu items sticking active) */
.nav-links > a.active,
.nav-links .nav-dropdown-trigger.active {
    color: var(--text-white);
    background: var(--primary-dark);
}

.nav-links > a.active:visited,
.nav-links .nav-dropdown-trigger.active:visited {
    color: var(--text-white);
}

.nav-links > a.active:focus-visible,
.nav-links .nav-dropdown-trigger.active:focus-visible {
    background: var(--primary-dark);
    box-shadow: 0 0 0 3px rgba(212, 168, 75, 0.22);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Landing page navbar: prevent visited turning blue/purple */
.navbar-landing .nav-links a:visited {
    color: rgba(255, 255, 255, 0.85);
}

.navbar-landing .nav-links a:focus {
    outline: none;
}

.navbar-landing .nav-links a:focus-visible {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(212, 168, 75, 0.22);
}

/* Admin TV access links: prevent visited turning blue/purple */
.tv-link:visited {
    color: var(--primary-dark);
}

.nav-user-info {
    text-align: right;
}

.nav-user-name {
    font-weight: 600;
    color: var(--primary-dark);
    font-size: 14px;
}

.nav-user-email {
    font-size: 12px;
    color: var(--text-light);
}

/* ============================================
   Login Card
   ============================================ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-navy) 100%);
}

.login-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    max-width: 440px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-navy));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.login-logo svg {
    width: 32px;
    height: 32px;
    color: var(--accent-gold);
}

.login-card h1 {
    color: var(--primary-dark);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-light);
    font-size: 15px;
}

/* ============================================
   Tabs
   ============================================ */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 28px;
    background: var(--bg-light);
    padding: 6px;
    border-radius: var(--radius-md);
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-light);
    transition: var(--transition);
}

.tab-btn:focus {
    outline: none;
}

.tab-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(212, 168, 75, 0.18);
}

.tab-btn:hover {
    color: var(--primary-dark);
}

.tab-btn.active {
    background: var(--bg-white);
    color: var(--primary-dark);
    box-shadow: var(--shadow-sm);
}

/* ============================================
   Forms
   ============================================ */
.form-container {
    margin-top: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
    background: var(--bg-white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(212, 168, 75, 0.15);
}

.form-group input::placeholder {
    color: #9ca3af;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 6px;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

/* Prevent anchor-buttons from adopting default visited colors */
a.btn,
a.btn:visited {
    color: inherit;
}

a.btn.btn-primary:visited,
a.btn.btn-secondary:visited,
a.btn.btn-success:visited,
a.btn.btn-danger:visited {
    color: var(--text-white);
}

a.btn.btn-outline:visited {
    color: var(--text-dark);
}

.btn:focus {
    outline: none;
}

.btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(212, 168, 75, 0.20);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dark));
    color: var(--text-white);
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 168, 75, 0.4);
}

.btn-secondary {
    background: var(--primary-dark);
    color: var(--text-white);
}

.btn-secondary:hover {
    background: var(--primary-navy);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-light);
    color: var(--text-dark);
}

.btn-outline:hover {
    border-color: var(--primary-dark);
    background: var(--bg-light);
}

.btn-success {
    background: var(--success-green);
    color: var(--text-white);
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger-red);
    color: var(--text-white);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-icon {
    padding: 10px;
    min-width: auto;
}

/* ============================================
   Page Header
   ============================================ */
.page-header {
    background: var(--bg-white);
    padding: 32px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.page-header h1 {
    color: var(--primary-dark);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-header p {
    color: var(--text-light);
    font-size: 15px;
}

/* ============================================
   Stats Grid
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-white);
    padding: 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border-left: 4px solid transparent;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-card.gold {
    border-left-color: var(--accent-gold);
}

.stat-card.green {
    border-left-color: var(--success-green);
}

.stat-card.red {
    border-left-color: var(--danger-red);
}

.stat-card.blue {
    border-left-color: var(--primary-dark);
}

.stat-card h3 {
    color: var(--text-light);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 600;
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary-dark);
    line-height: 1.2;
}

.stat-label {
    font-size: 14px;
    color: var(--text-light);
    margin-top: 4px;
}

/* ============================================
   Sections
   ============================================ */
.section {
    background: var(--bg-white);
    padding: 28px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.section h2 {
    color: var(--primary-dark);
    font-size: 20px;
    font-weight: 700;
}

.action-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ============================================
   Tables
   ============================================ */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

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

table th,
table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}

table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text-dark);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

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

table tr:hover td {
    background: var(--bg-light);
}

/* ============================================
   Badges
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-green);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-red);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-yellow);
}

.badge-info {
    background: rgba(26, 41, 64, 0.1);
    color: var(--primary-dark);
}

/* ============================================
   Messages
   ============================================ */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-red);
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    border-left: 4px solid var(--danger-red);
    font-size: 14px;
}

.success-message {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-green);
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    border-left: 4px solid var(--success-green);
    font-size: 14px;
}

.info-message {
    background: rgba(212, 168, 75, 0.1);
    color: var(--accent-gold-dark);
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    border-left: 4px solid var(--accent-gold);
    font-size: 14px;
}

/* ============================================
   Disclaimer / Legal
   ============================================ */
.site-disclaimer {
    background: rgba(26, 41, 64, 0.04);
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--primary-dark);
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-light);
    font-size: 12px;
    line-height: 1.6;
}

.site-disclaimer strong {
    color: var(--text-dark);
}

.site-disclaimer a {
    color: var(--primary-dark);
    font-weight: 600;
    text-decoration: none;
}

.site-disclaimer a:hover {
    text-decoration: underline;
}

/* ============================================
   Modal
   ============================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(26, 41, 64, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--bg-white);
    margin: 5% auto;
    padding: 32px;
    border-radius: var(--radius-lg);
    max-width: 560px;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

/* Create Webhook modal: same width on admin and user dashboard */
.modal-content.create-webhook-modal-content {
    max-width: 560px;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.modal-header h2 {
    color: var(--primary-dark);
    font-size: 22px;
    font-weight: 700;
}

.close {
    color: var(--text-light);
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition);
}

.close:hover {
    color: var(--danger-red);
}

/* ============================================
   Cards Grid
   ============================================ */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border-light);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-gold);
}

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

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-dark);
}

.card-subtitle {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 4px;
}

.card-body {
    color: var(--text-light);
    font-size: 14px;
}

.card-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 12px;
}

/* ============================================
   Credentials Grid
   ============================================ */
.credentials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.credential-card {
    background: var(--bg-white);
    padding: 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-align: center;
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.credential-card:hover {
    border-color: var(--accent-gold);
}

.credential-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-navy));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: var(--accent-gold);
    font-size: 24px;
}

.credential-card h3 {
    color: var(--primary-dark);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}

.credential-status {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
    display: inline-block;
}

.credential-status.configured {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-green);
}

.credential-status.not-configured {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-red);
}

/* ============================================
   Route Config Fields
   ============================================ */
.route-config-field {
    margin-bottom: 16px;
}

.route-config-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-dark);
}

.route-config-field input[type="password"] {
    font-family: monospace;
}

/* ============================================
   Copy Button
   ============================================ */
.copy-field {
    display: flex;
    gap: 8px;
}

.copy-field input {
    flex: 1;
    font-family: monospace;
    font-size: 13px;
    background: var(--bg-light);
}

.copy-btn {
    padding: 10px 16px;
    background: var(--primary-dark);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
    font-weight: 600;
}

.copy-btn:hover {
    background: var(--primary-navy);
}

/* ============================================
   Loading
   ============================================ */
.loading {
    text-align: center;
    padding: 60px 40px;
    color: var(--text-light);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 40px;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-dark);
    margin-bottom: 8px;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-links a {
        padding: 8px 14px;
        font-size: 13px;
    }

    .nav-dropdown-menu {
        width: min(92vw, 360px);
        max-height: 60vh;
        overflow: auto;
    }

    /* Tabs: allow horizontal scroll on mobile (many tabs in admin pages) */
    .tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tabs::-webkit-scrollbar {
        height: 0;
    }

    .tab-btn {
        flex: 0 0 auto;
        white-space: nowrap;
    }
    
    .login-card {
        padding: 32px 24px;
        margin: 20px;
    }
    
    .page-header {
        padding: 24px;
    }
    
    .page-header h1 {
        font-size: 24px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .section {
        padding: 20px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
    
    .credentials-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 24px;
        max-width: 95%;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    table th,
    table td {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* ============================================
   Utility Classes
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-gold { color: var(--accent-gold); }
.text-success { color: var(--success-green); }
.text-danger { color: var(--danger-red); }
.text-muted { color: var(--text-light); }
.font-mono { font-family: monospace; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
