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

:root {
    /* Color Palette */
    --bg-main: #0f172a;       /* Deep slate for dark mode */
    --bg-card: #1e293b;       /* Slightly lighter for cards */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --accent-primary: #3b82f6; /* Vibrant Blue */
    --accent-hover: #2563eb;
    --accent-gradient: linear-gradient(135deg, #3b82f6, #8b5cf6);
    
    --border-color: rgba(255, 255, 255, 0.1);
    
    /* Typography */
    --font-family: 'Inter', sans-serif;
    
    /* Spacing */
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    
    /* Shadows */
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-glow: 0 0 15px rgba(59, 130, 246, 0.5);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

/* Typography */
h1, h2, h3, h4 {
    font-weight: 700;
    margin-bottom: var(--space-md);
    color: var(--text-main);
}

h1 {
    font-size: 2.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
    flex: 1;
}

.main-content {
    padding: var(--space-xl) 0;
}

/* Header & Navigation */
.main-header {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    max-width: 1200px;
    margin: 0 auto;
}

.brand h1 {
    font-size: 1.5rem;
    margin: 0;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--space-lg);
}

.nav-item {
    position: relative;
}

.nav-link {
    color: var(--text-main);
    font-weight: 500;
    padding: var(--space-sm) 0;
    display: block;
}

.nav-link:hover {
    color: var(--accent-primary);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-card);
    min-width: 200px;
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    overflow: hidden;
    list-style: none;
    padding: 0;
}

.nav-item:hover .dropdown-menu {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}

.dropdown-item a {
    display: block;
    padding: var(--space-md);
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.dropdown-item a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: var(--space-xl);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* Forms */
.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 500;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    font-family: var(--font-family);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    text-align: center;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
    color: white;
}

/* Footer */
.main-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: var(--space-lg) 0;
    text-align: center;
    margin-top: auto;
}

.main-footer p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: var(--space-sm);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--space-lg);
}

.table th, .table td {
    padding: var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: rgba(255, 255, 255, 0.02);
    font-weight: 600;
    color: var(--text-muted);
}

.table tr:hover td {
    background: rgba(255, 255, 255, 0.05);
}

/* Utilities */
.text-center { text-align: center; }
.mb-4 { margin-bottom: var(--space-lg); }
.mt-4 { margin-top: var(--space-lg); }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 768px) {
    .nav-menu {
        flex-direction: column;
        display: none; /* Hide by default on mobile */
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-card);
        padding: var(--space-md);
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        background: rgba(255,255,255,0.02);
    }
    
    .mobile-menu-btn {
        display: block;
        background: none;
        border: none;
        color: var(--text-main);
        font-size: 1.5rem;
        cursor: pointer;
    }
}

@media (min-width: 769px) {
    .mobile-menu-btn {
        display: none;
    }
}

/* Legacy Form Table Support */
.legacy-form-table {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}
.legacy-form-table td {
    padding: var(--space-sm);
    vertical-align: middle;
}
.legacy-form-table input[type='text'], 
.legacy-form-table input[type='password'], 
.legacy-form-table select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    font-family: var(--font-family);
}
.legacy-form-table input[type='text']:focus,
.legacy-form-table select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}
.legacy-form-table input[type='submit'] {
    background: var(--accent-gradient);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
}
.legacy-form-table span.style1 {
    font-size: 0.85rem;
    color: var(--accent-primary);
}