/* ÖIS Faktura - Light Admin Theme */
:root {
    --bg: #f8f9fa; --surface: #ffffff; --border: #dee2e6; --border-light: #e9ecef;
    --text: #212529; --text-muted: #6c757d; --primary: #0d6efd; --primary-hover: #0b5ed7;
    --success: #198754; --danger: #dc3545; --warning: #ffc107; --radius: 4px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05); --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 13px; background: var(--bg); color: var(--text); min-height: 100vh; display: flex; flex-direction: column; line-height: 1.5; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.header { background: #01144b; border-bottom: none; padding: 0.5rem 1rem; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 4px rgba(0,0,0,0.15); }
.header-content { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 15px; font-weight: 700; color: #ffffff; text-decoration: none; display: flex; align-items: center; gap: 0.5rem; }
.logo img { height: 38px; width: auto; }
.nav { display: flex; align-items: center; gap: 1.2rem; }
.nav-link { color: #a0c4ff; font-size: 15px; text-decoration: none; padding: 0.3rem 0; border-bottom: 2px solid transparent; }
.nav-link:hover { color: #ffffff; text-decoration: none; border-bottom-color: #ffffff; }
.nav-active { color: #ffffff !important; font-weight: 600; border-bottom-color: #ffc107 !important; }
.nav-user { color: #a0c4ff; font-size: 12px; }
.logout-link:hover { color: #ff9999; border-bottom-color: #ff9999; }

.main { flex: 1; max-width: 1200px; margin: 0 auto; padding: 1rem; width: 100%; }
.page { display: flex; flex-direction: column; gap: 0.75rem; }
.page h1 { font-size: 16px; font-weight: 600; }
.page h2 { font-size: 14px; font-weight: 600; margin-bottom: 0.3rem; }
.section { margin-top: 0.5rem; }
.text-muted { color: var(--text-muted); }

.auth-container { display: flex; justify-content: center; align-items: center; min-height: 50vh; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; width: 100%; max-width: 360px; box-shadow: var(--shadow-sm); }
.auth-card h2 { font-size: 16px; margin-bottom: 0.75rem; text-align: center; }
.auth-footer { margin-top: 1rem; text-align: center; font-size: 12px; color: var(--text-muted); }

.form { display: flex; flex-direction: column; gap: 0.6rem; }
.form-group { display: flex; flex-direction: column; gap: 0.15rem; }
.form-group label { font-size: 11px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.form-group input, .form-group select, .form-group textarea { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.4rem 0.6rem; font-size: 13px; color: var(--text); background: var(--surface); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(13,110,253,0.15); }
.form-row { display: flex; gap: 0.75rem; align-items: flex-end; flex-wrap: wrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.35rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 12px; font-weight: 400; cursor: pointer; background: var(--surface); color: var(--text); text-decoration: none; transition: background 0.15s; }
.btn:hover { background: var(--bg); text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-save { background: var(--success); color: #fff; border-color: var(--success); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-full { width: 100%; padding: 0.75rem 1rem; font-size: 14px; }
.btn-sm { padding: 0.25rem 0.6rem; font-size: 11px; }
.btn-xs { padding: 0.2rem 0.5rem; font-size: 11px; }
.btn-back { border-color: #6c757d; color: #6c757d; }
.btn-back:hover { background: #6c757d; color: #fff; }

.alert { padding: 0.5rem 0.75rem; border-radius: var(--radius); font-size: 12px; margin-bottom: 0.5rem; }
.alert-error { background: #f8d7da; border: 1px solid #f5c2c7; color: #842029; }
.alert-success { background: #d1e7dd; border: 1px solid #badbcc; color: #0f5132; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem; box-shadow: var(--shadow-sm); }

.table { width: 100%; border-collapse: collapse; font-size: 12px; }
.table th, .table td { padding: 0.35rem 0.6rem; text-align: left; border-bottom: 1px solid var(--border-light); }
.table th { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); font-weight: 600; background: var(--bg); }
.table tr:hover td { background: #f1f3f5; }
.table-compact th, .table-compact td { padding: 0.25rem 0.5rem; }

.input-compact { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.25rem 0.4rem; font-size: 12px; color: var(--text); }
.input-full { width: 100%; border: 1px solid var(--border); border-radius: var(--radius); padding: 0.3rem 0.5rem; font-size: 12px; }
.input-full:focus { outline: none; border-color: var(--primary); }

/* Status badges */
.status-badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 3px; font-size: 10px; font-weight: 600; }
.status-draft { background: #e9ecef; color: #6c757d; }
.status-sent { background: #fff3cd; color: #856404; }
.status-paid { background: #d1e7dd; color: #0f5132; }
.status-overdue { background: #f8d7da; color: #842029; }

/* Summary cards */
.summary-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.summary-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.5rem 1rem; display: flex; flex-direction: column; min-width: 140px; }
.summary-label { font-size: 10px; text-transform: uppercase; color: var(--text-muted); }
.summary-value { font-size: 16px; font-weight: 600; }
.summary-success .summary-value { color: var(--success); }
.summary-warning .summary-value { color: #856404; }

.actions { white-space: nowrap; }

.footer { text-align: center; padding: 0.75rem 1rem; color: var(--text-muted); font-size: 11px; border-top: 1px solid var(--border); }

@media (max-width: 768px) {
    .header-content { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
    .form-row { flex-direction: column; }
    .summary-row { flex-direction: column; }
}


/* Sortable table headers */
.sortable { cursor: pointer; user-select: none; }
.sortable:hover { color: var(--primary); }
.sortable[data-dir="asc"]::after { content: ' \25B2'; font-size: 8px; }
.sortable[data-dir="desc"]::after { content: ' \25BC'; font-size: 8px; }
