@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@600;700&display=swap');

:root {
    --primary: #0a51c2;
    --primary-light: #3b7de6;
    --primary-dark: #083d94;
    --secondary: #2bc56b;
    --secondary-light: #4ed88a;
    --secondary-dark: #22a057;
    --accent: #18a099;
    --accent-light: #1fc2b9;

    --bg-primary: #1A1A1E;
    --bg-paper: #16181D;
    --bg-secondary: #25262B;
    --bg-tertiary: #2C2E33;
    --surface: #1F2937;

    --text-primary: #E5E7EB;
    --text-secondary: #9CA3AF;

    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #06B6D4;
    --border: #374151;

    --radius: 8px;
    --radius-card: 12px;
    --radius-chip: 16px;

    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.15);
    --shadow-card-hover: 0 8px 30px rgba(16, 185, 129, 0.2);
    --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.4);
}

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

body {
    font-family: 'Inter', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--text-primary);
    min-height: 100vh;

    /* NLC Signature Background */
    background-color: #1A1A1E;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        radial-gradient(ellipse 1000px 600px at 15% 0%, rgba(10, 81, 194, 0.12), transparent),
        radial-gradient(ellipse 800px 500px at 85% 0%, rgba(43, 197, 107, 0.08), transparent),
        radial-gradient(ellipse 600px 400px at 50% 100%, rgba(24, 160, 153, 0.06), transparent);
    background-size: 60px 60px, 60px 60px, 100% 100%, 100% 100%, 100% 100%;
    background-attachment: fixed;
}

a { color: var(--primary-light); text-decoration: none; transition: color 0.2s ease-in-out; }
a:hover { color: var(--secondary); text-decoration: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-paper); }
::-webkit-scrollbar-thumb { background-color: var(--primary); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background-color: var(--success); }

/* Layout */
.shell { display: flex; min-height: 100vh; }

nav {
    width: 220px;
    background: var(--bg-paper);
    padding: 20px 0;
    border-right: 1px solid var(--border);
    flex-shrink: 0;
}

nav .brand {
    padding: 0 20px 20px;
    font-family: 'Poppins', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}

nav a {
    display: block;
    padding: 8px 20px;
    color: var(--text-secondary);
    font-size: 14px;
    transition: all 0.2s ease-in-out;
}

nav a:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    text-decoration: none;
}

nav a.active {
    background: var(--bg-tertiary);
    color: var(--primary-light);
    border-left: 3px solid var(--primary);
    text-decoration: none;
}

main {
    flex: 1;
    padding: 32px;
    max-width: 1200px;
    animation: fadeIn 0.3s ease-in-out;
}

h1 {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    font-weight: 600;
    margin-bottom: 24px;
    letter-spacing: -0.01em;
}

h2 {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

h3 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 32px; }

.card {
    background: var(--bg-paper);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 20px;
    box-shadow: var(--shadow-card);
    transition: all 0.2s ease-in-out;
}

.card:hover {
    border-color: var(--success);
    box-shadow: var(--shadow-card-hover);
}

.card .label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.card .value { font-size: 28px; font-weight: 700; }
.card .value.success { color: var(--success); }
.card .value.warning { color: var(--warning); }
.card .value.danger { color: var(--danger); }

/* Tables */
table { width: 100%; border-collapse: collapse; margin-bottom: 24px; }

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

th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--bg-paper);
}

tr { transition: background 0.2s ease-in-out; }
tr:hover td { background: var(--bg-tertiary); }

/* Status badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-chip);
    font-size: 12px;
    font-weight: 600;
}

.badge.active {
    background: rgba(4, 120, 87, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge.inactive {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge.stale {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Forms & Buttons */
input[type="text"], input[type="password"], select {
    background: var(--bg-paper);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s ease-in-out;
}

input[type="text"]:hover, input[type="password"]:hover {
    border-color: var(--primary);
}

input[type="text"]:focus, input[type="password"]:focus {
    border-color: var(--success);
}

.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: var(--radius);
    border: none;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    color: #fff;
    transition: all 0.2s ease-in-out;
    letter-spacing: 0.01em;
}

.btn:hover { transform: scale(1.02); }

.btn-primary { background: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-glow); }
.btn-success { background: var(--secondary-dark); }
.btn-success:hover { background: var(--secondary); box-shadow: 0 0 20px rgba(43, 197, 107, 0.3); }
.btn-danger { background: #991b1b; }
.btn-danger:hover { background: var(--danger); box-shadow: 0 0 20px rgba(239, 68, 68, 0.3); }
.btn-warning { background: #92400e; }
.btn-warning:hover { background: var(--warning); color: #000; box-shadow: 0 0 20px rgba(245, 158, 11, 0.3); }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* Flash messages */
.flash {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
    animation: slideUp 0.4s ease-out;
}

.flash.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
}

.flash.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

/* Login page */
.login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    animation: fadeIn 0.3s ease-in-out;
}

.login-box {
    background: var(--bg-paper);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 40px;
    width: 360px;
    text-align: center;
    box-shadow: var(--shadow-card);
}

.login-box h1 {
    font-family: 'Poppins', 'Inter', sans-serif;
    margin-bottom: 8px;
}

.login-box p { color: var(--text-secondary); margin-bottom: 24px; font-size: 14px; }
.login-box input { width: 100%; margin-bottom: 16px; }
.login-box .btn { width: 100%; }

/* Search bar */
.search-bar { display: flex; gap: 8px; margin-bottom: 24px; }
.search-bar input { flex: 1; }

/* Sections */
.section {
    background: var(--bg-paper);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-card);
}

.section h2 { margin-bottom: 16px; font-size: 16px; color: var(--text-primary); }

/* Logs */
.log-entry {
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.log-entry .time { color: var(--text-secondary); }
.log-entry .level-INFO { color: var(--info); }
.log-entry .level-WARN { color: var(--warning); }
.log-entry .level-ERROR { color: var(--danger); }

/* Utilities */
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.text-muted { color: var(--text-secondary); }
.text-sm { font-size: 13px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.inline-form { display: inline; }

/* Pagination */
.pagination { display: flex; gap: 8px; margin-top: 16px; }

.pagination a, .pagination span {
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: 13px;
    background: var(--bg-paper);
    border: 1px solid var(--border);
    transition: all 0.2s ease-in-out;
}

.pagination a:hover {
    border-color: var(--primary);
    background: var(--bg-tertiary);
}

.pagination span { color: var(--text-secondary); }

/* Code */
code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--accent-light);
}

/* Animations */
@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes slideUp {
    0% { transform: translateY(20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}
