:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --error: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

/* Glassmorphism Effect */
.glass-card {
    background: #172036;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
}

/* Layout */
#app-container {
    display: flex;
}

.sidebar {
    width: 250px;
    height: 100vh;
    background: rgba(15, 23, 42, 0.9);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    position: fixed;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-links {
    list-style: none;
    margin-top: 2rem;
    flex-grow: 1;
}

.nav-links li {
    padding: 0.75rem 2rem;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-muted);
}

.nav-links li.active,
.nav-links li:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
    border-left: 4px solid var(--primary);
}

.nav-links a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.sidebar-footer {
    padding: 2rem;
}

.content {
    margin-left: 250px;
    flex-grow: 1;
    padding: 1.25rem;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* Forms & Buttons */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

input,
select,
textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #0f172a;
    color: white;
    font-size: 0.9rem;
    color-scheme: dark;
    /* Popravlja boju kalendar ikone na tamnoj pozadini */
}

.btn-primary {
    background: #2563eb;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.3s;
    font-weight: 600;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: #172036;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-muted);
    padding: 0.6rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: 0.2s;
}

.btn-secondary:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

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

/* Dashboard Specific Layout Requirements */
.dashboard-controls-wrapper {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: stretch;
}

.dashboard-filters {
    flex: 1.4;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem 1rem;
    align-items: end;
}

.dashboard-stats {
    flex: 1.1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.dashboard-stats .stat-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 0.75rem 1rem;
}

.dashboard-stats .stat-card h4 {
    color: var(--primary);
    font-size: 0.8rem;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    text-transform: uppercase;
    font-weight: 700;
}

.dashboard-stats .stat-gradilista {
    align-items: center;
    justify-content: center;
}

.dashboard-stats .stat-gradilista h4 {
    margin-bottom: 0.5rem;
}

.dashboard-stats .stat-number {
    font-size: 2.2rem;
    font-weight: 400;
    line-height: 1;
    color: var(--primary);
}

.dashboard-stats .stat-split .stat-row {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.dashboard-stats .stat-split .stat-row:last-child {
    margin-bottom: 0;
}

.dashboard-stats .stat-split .stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dashboard-stats .stat-split .val {
    font-weight: 700;
    font-size: 1.25rem;
    color: white;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th,
td {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    position: relative;
    user-select: none;
}

/* Table Column Resizer */
.resizer {
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    cursor: col-resize;
    user-select: none;
    z-index: 1;
}

.resizer:hover,
.resizing {
    background: #2563eb;
    opacity: 0.5;
}

/* Table Column Drag and Drop */
th[draggable="true"] {
    cursor: grab;
}

th.dragging {
    opacity: 0.5;
    background: #2563eb;
    color: white;
}

th.drag-over {
    border-left: 2px solid #2563eb;
}

th {
    position: relative;
}

.resizer {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 6px;
    background: transparent;
    cursor: col-resize;
    z-index: 10;
}

.resizer:hover, th.resizing .resizer {
    background: rgba(37, 99, 235, 0.5);
}

th.resizing {
    border-right: 2px solid #2563eb;
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-ok {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.status-late {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.status-early {
    background: rgba(37, 99, 235, 0.2);
    color: var(--primary);
}

.overdue td:first-child {
    border-left: 4px solid var(--error);
}

.overdue .overdue-text {
    color: var(--error);
    font-weight: bold;
}

/* Login Page Only Styles */
#auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

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

.login-form h1 {
    margin-bottom: 2rem;
    text-align: center;
}

.error-text {
    color: var(--error);
    font-size: 0.85rem;
    margin-top: 1rem;
    text-align: center;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    width: 100%;
    max-width: 500px;
}

/* Compact Alerts Redesign */
.alert-list-compact {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.alert-item-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(30, 41, 59, 0.4);
    border-radius: 6px;
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
}

.alert-item-compact:hover {
    background: rgba(30, 41, 59, 0.7);
    transform: translateX(4px);
}

.alert-item-compact.expired {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.alert-item-compact.warning {
    border-left-color: #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}

.alert-info {
    display: flex;
    flex-direction: column;
}

.alert-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.alert-vehicle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.alert-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.alert-date strong {
    margin-left: 5px;
    color: var(--text-main);
}

.alert-item-compact.expired .alert-date strong {
    color: #ef4444;
}

.alert-item-compact.warning .alert-date strong {
    color: #f59e0b;
}