/* SoftSky Klijenti - Clean table-based UI */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    color: #333;
    background: #f5f5f5;
}

/* Navbar */
.navbar {
    background: #2c3e50;
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 48px;
    gap: 20px;
}
.nav-brand { font-weight: bold; font-size: 16px; }
.nav-links { display: flex; gap: 4px; flex: 1; }
.nav-links a {
    color: #bdc3c7;
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 4px 4px 0 0;
    transition: background 0.2s;
}
.nav-links a:hover, .nav-links a.active {
    color: #fff;
    background: #34495e;
}
.nav-user { display: flex; align-items: center; gap: 10px; font-size: 13px; }

/* Container */
.container { max-width: 1400px; margin: 0 auto; padding: 20px; }

/* Page header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.page-header h1 { font-size: 22px; font-weight: 600; }

/* Alerts */
.alert {
    padding: 10px 16px;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 13px;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 7px 16px;
    background: #ecf0f1;
    color: #333;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 13px;
    line-height: 1.4;
}
.btn:hover { background: #dfe6e9; }
.btn-primary { background: #3498db; color: #fff; border-color: #2980b9; }
.btn-primary:hover { background: #2980b9; }
.btn-danger { background: #e74c3c; color: #fff; border-color: #c0392b; }
.btn-danger:hover { background: #c0392b; }
.btn-sm { padding: 3px 8px; font-size: 12px; }
.btn-upload { background: #e67e22; color: #fff; border-color: #d35400; }
.btn-upload:hover { background: #d35400; }
.btn-upload:disabled { background: #bdc3c7; border-color: #95a5a6; cursor: wait; }
.btn-full { width: 100%; text-align: center; }

/* Search bar */
.search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    align-items: center;
}
.search-bar input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 14px;
}

/* Filter bar */
.filter-bar { margin-bottom: 16px; }
.filter-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.filter-row input, .filter-row select {
    padding: 7px 10px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 13px;
}
.filter-row input[type="text"] { min-width: 200px; }
.filter-row label { display: flex; align-items: center; gap: 4px; font-size: 13px; }

/* Data table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.data-table th, .data-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
    font-size: 13px;
}
.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    position: sticky;
    top: 0;
    white-space: nowrap;
}
.data-table th a { color: #333; text-decoration: none; }
.data-table th a:hover { color: #3498db; }
.data-table tbody tr:hover { background: #f0f7ff; }
.data-table .inactive { opacity: 0.5; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.inline { display: inline; }

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    font-size: 13px;
}
.pagination a {
    color: #3498db;
    text-decoration: none;
    padding: 4px 8px;
}

/* Forms */
.edit-form { background: #fff; padding: 24px; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); max-width: 800px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 4px; font-weight: 500; font-size: 13px; color: #555; }
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="password"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 14px;
}
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }
.checkboxes { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; padding: 10px 0; }
.checkboxes label { display: flex; align-items: center; gap: 4px; font-size: 13px; cursor: pointer; }
.form-actions { display: flex; gap: 8px; margin-top: 20px; }
.program-checkboxes { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 6px 0; }
.prog-check { display: flex; align-items: center; gap: 4px; font-size: 12px; cursor: pointer; white-space: nowrap; }

/* Reports */
.report-links { display: flex; gap: 20px; flex-wrap: wrap; }
.report-card {
    background: #fff;
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    min-width: 280px;
}
.report-card h3 { margin-bottom: 8px; }
.report-card p { color: #777; font-size: 13px; margin-bottom: 12px; }
.report-actions { display: flex; gap: 8px; }

/* Login page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #2c3e50;
}
.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    width: 360px;
}
.login-box h1 { text-align: center; margin-bottom: 4px; color: #2c3e50; }
.login-box h2 { text-align: center; margin-bottom: 24px; font-weight: 400; color: #7f8c8d; font-size: 16px; }

/* Sync overlay */
#sync-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(44, 62, 80, 0.88);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.sync-content { text-align: center; color: #fff; }
.sync-spinner {
    font-size: 40px;
    margin-bottom: 12px;
    animation: spin 1.2s linear infinite;
    display: inline-block;
}
@keyframes spin { 100% { transform: rotate(360deg); } }
#sync-message { font-size: 16px; }

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 60px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 14px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    font-size: 13px;
    line-height: 1.5;
    max-width: 400px;
    animation: toast-in 0.3s ease;
    cursor: pointer;
    white-space: pre-line;
}
.toast-success { background: #27ae60; color: #fff; }
.toast-error { background: #e74c3c; color: #fff; }
.toast-info { background: #2c3e50; color: #fff; }
.toast.toast-out { animation: toast-out 0.3s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(40px); } }

/* Modal dialog */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(44, 62, 80, 0.6);
    z-index: 10001;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal-box {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    padding: 28px;
    max-width: 440px;
    width: 90%;
    animation: modal-in 0.2s ease;
}
@keyframes modal-in { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.modal-box h3 { margin-bottom: 12px; font-size: 16px; color: #2c3e50; }
.modal-box p { font-size: 14px; color: #555; margin-bottom: 20px; line-height: 1.5; white-space: pre-line; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* Print styles */
@media print {
    .navbar, .no-print, .search-bar, .filter-bar, .pagination, .btn-danger { display: none !important; }
    .container { max-width: 100%; padding: 0; }
    .data-table { box-shadow: none; font-size: 11px; }
    .data-table th, .data-table td { padding: 4px 6px; }
    .print-header { text-align: center; margin-bottom: 12px; }
}
.print-table { page-break-inside: auto; }
.print-table tr { page-break-inside: avoid; }
