:root {
    --bg-dark: #121212;
    --bg-card: #1e1e24;
    --primary: #4CAF50;
    --primary-hover: #45a049;
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --border: #333333;
    --danger: #f44336;
    --success: #2ecc71;
    --warning: #f1c40f;
    --surface: rgba(255, 255, 255, 0.05);
    --shadow: rgba(0, 0, 0, 0.3);
}

body.light-theme {
    --bg-dark: #f0f4f0;
    --bg-card: #ffffff;
    --primary: #2e7d32;
    --primary-hover: #1b5e20;
    --text-main: #2c3e50;
    --text-muted: #5f6368;
    --border: #dadce0;
    --danger: #d32f2f;
    --success: #27ae60;
    --warning: #f39c12;
    --surface: #f1f3f4;
    --shadow: rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#app {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Glassmorphism containers */
.glass-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px var(--shadow);
    backdrop-filter: blur(10px);
}

/* Utilities */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

.text-center { text-align: center; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.wrap { flex-wrap: wrap; }

/* Typography */
h1, h2, h3 { font-weight: 700; color: var(--text-main); }
h1 { font-size: 2rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.5rem; margin-bottom: 0.75rem; }
p { color: var(--text-muted); line-height: 1.5; }

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

label {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

input, select {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

/* Buttons */
.btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.btn-secondary {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(128, 128, 128, 0.1);
}

.btn-danger {
    background: var(--danger);
}

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

.btn-warning {
    background: var(--warning);
    color: black;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8125rem;
}

/* Navigation */
.nav-bar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

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

#online-status {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#online-status.online {
    background: rgba(46, 204, 113, 0.1);
    color: var(--success);
}

#online-status.offline {
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger);
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% { transform: scale(0.95); opacity: 0.7; }
    50% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.7; }
}

/* Dashboard Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.stat-card {
    background: var(--surface);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    text-align: center;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 4px;
}

/* Tables */
.table-container {
    overflow-x: auto;
    margin-top: 20px;
}

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

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

th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--surface);
}

tr:hover td {
    background: var(--surface);
}

.footer-row {
    font-weight: 700;
    background: var(--surface);
}

/* Abstracts */
.abstract-panel {
    margin-top: 30px;
    padding: 20px;
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.abstract-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.abstract-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
}

.abstract-item:last-child {
    border-bottom: none;
    font-weight: 700;
    color: var(--primary);
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.hidden {
    display: none !important;
}

/* Login specific */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    padding: 20px;
    background-image: linear-gradient(to bottom right, rgba(0,0,0,0.8), rgba(0,0,0,0.8)), url('/assets/gass.png');
    background-size: cover;
    background-position: center;
}

.login-card {
    width: 100%;
    max-width: 400px;
}

.total-fee-display {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    padding: 16px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 8px;
    margin: 20px 0;
}

@media print {
    body { background: white !important; color: black !important; }
    .nav-bar, .btn, .nav-actions, #theme-toggle { display: none !important; }
    .glass-panel { border: none; box-shadow: none; background: transparent; padding: 0; }
    th, td { border-bottom: 1px solid #333; color: black !important; font-size: 10pt; }
    h1, h2, h3, p, label, .stat-value { color: black !important; }
    .table-container { overflow: visible; }
    .abstract-panel { border: 1px solid #333; page-break-inside: avoid; }
}

@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; }
    .abstract-grid { grid-template-columns: 1fr; }
}
