* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Touch-friendly buttons */
button, .btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(102, 126, 234, 0.3);
    min-height: 44px; /* iOS touch target size */
    min-width: 44px;
}

/* Improve scrolling on mobile */
.tabs, .table-container, .modal-content {
    -webkit-overflow-scrolling: touch;
}

/* Prevent text selection on buttons */
.btn, .tab-btn {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.desktop-header {
    display: block;
}

.mobile-header {
    display: none;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.role-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
}

.role-admin {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    border: 2px solid white;
}

.role-urednik {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85em;
    min-height: 36px;
}

.login-content {
    max-width: 400px;
}

.login-info {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.9em;
}

.login-info code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.modal.active {
    display: block;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 600;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

.tabs {
    display: flex;
    background: #f5f5f5;
    border-bottom: 2px solid #e0e0e0;
    overflow-x: auto;
}

.tab-btn {
    flex: 1;
    padding: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    min-width: 150px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-btn:hover {
    background: #e8e8e8;
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
}

.tab-content {
    display: none;
    padding: 30px;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-header h2 {
    font-size: 1.8em;
    color: #333;
}

.table-container {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.2s ease;
}

tbody tr:hover {
    background: #f8f9ff;
}

td {
    padding: 15px;
    color: #555;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
    padding: 6px 12px;
    font-size: 0.85em;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-edit {
    background: #ffc107;
    color: #333;
    padding: 6px 12px;
    font-size: 0.85em;
    margin-right: 5px;
}

.btn-edit:hover {
    background: #e0a800;
}

.action-buttons {
    display: flex;
    gap: 5px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #667eea;
}

.modal-content h2 {
    margin-bottom: 25px;
    color: #333;
    font-size: 1.8em;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
}

/* Responsive Styles - Desktop Header */
@media (max-width: 768px) {
    body {
        padding: 10px;
        padding-bottom: 80px; /* Space for bottom nav */
    }
    
    .container {
        border-radius: 10px;
        margin-bottom: 0;
    }
    
    .desktop-header {
        padding: 20px 15px;
    }
    
    .desktop-header h1 {
        font-size: 1.5em;
        margin-bottom: 5px;
    }
    
    .subtitle {
        font-size: 0.9em;
    }
    
    .header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .user-info {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }
    
    .user-info span {
        font-size: 0.9em;
    }
    
    .user-info button {
        font-size: 0.8em;
        padding: 6px 12px;
    }
    
    .desktop-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    
    .tab-btn {
        padding: 12px 15px;
        font-size: 0.85em;
        min-width: 100px;
        white-space: nowrap;
    }
    
    .tab-content {
        padding: 20px 15px;
        padding-bottom: 20px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .section-header h2 {
        font-size: 1.4em;
    }
    
    .section-header > div {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .section-header button {
        width: 100%;
        margin-left: 0 !important;
    }
    
    .table-container {
        font-size: 0.85em;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
    }
    
    th, td {
        padding: 10px 8px;
        font-size: 0.9em;
    }
    
    th {
        font-size: 0.8em;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 5px;
    }
    
    .action-buttons button {
        width: 100%;
        font-size: 0.8em;
        padding: 8px;
    }
    
    .modal-content {
        width: 95%;
        padding: 20px 15px;
        margin: 10% auto;
        max-height: 85vh;
    }
    
    .modal-content h2 {
        font-size: 1.4em;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group label {
        font-size: 0.9em;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-actions button {
        width: 100%;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 0.9em;
    }
    
    .btn-sm {
        padding: 8px 12px;
        font-size: 0.8em;
    }
    
    .search-box {
        margin-bottom: 15px;
    }
    
    .search-box input {
        padding: 12px 40px 12px 15px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .profile-card {
        padding: 20px 15px;
    }
    
    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        padding: 12px 0;
    }
    
    .info-label {
        min-width: auto;
        font-size: 0.9em;
        margin-bottom: 5px;
    }
    
    .info-value {
        font-size: 0.95em;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-icon {
        font-size: 36px;
    }
    
    .stat-number {
        font-size: 2em;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .chart-card {
        padding: 20px 15px;
    }
    
    .chart-card canvas {
        height: 250px;
    }
    
    .summary-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
        gap: 15px;
    }
    
    .summary-card h3 {
        font-size: 1em;
    }
    
    .summary-card span {
        font-size: 1.3em;
    }
    
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: auto;
        max-width: 100%;
        padding: 12px 15px;
    }
    
    .toast-message {
        font-size: 13px;
    }
    
    .login-content {
        max-width: 100%;
    }
    
    .login-info {
        font-size: 0.85em;
        padding: 12px;
    }
    
    .plata-detalj-header h3 {
        font-size: 1.2em;
    }
    
    .plata-detalj-section h4 {
        font-size: 1em;
        padding: 8px 12px;
    }
    
    .plata-detalj-footer h2 {
        font-size: 1.5em;
    }
}

/* Extra Small Devices (phones, less than 480px) */
@media (max-width: 480px) {
    body {
        padding: 5px;
        padding-bottom: 80px;
    }
    
    .container {
        margin-bottom: 0;
        border-radius: 8px;
    }
    
    .desktop-header {
        padding: 15px 10px;
    }
    
    .desktop-header h1 {
        font-size: 1.3em;
    }
    
    .subtitle {
        font-size: 0.85em;
    }
    
    .mobile-header-top {
        padding: 10px;
    }
    
    .mobile-header-title h1 {
        font-size: 1em;
    }
    
    .tab-btn {
        padding: 10px 12px;
        font-size: 0.8em;
        min-width: 90px;
    }
    
    .tab-content {
        padding: 15px 10px;
        padding-bottom: 20px;
    }
    
    .section-header h2 {
        font-size: 1.2em;
    }
    
    th, td {
        padding: 8px 6px;
        font-size: 0.85em;
    }
    
    th {
        font-size: 0.75em;
    }
    
    .modal-content {
        width: 98%;
        padding: 15px 10px;
        margin: 5% auto;
    }
    
    .modal-content h2 {
        font-size: 1.2em;
        margin-bottom: 15px;
    }
    
    .stat-card {
        padding: 15px;
        flex-direction: column;
        text-align: center;
    }
    
    .stat-icon {
        font-size: 32px;
    }
    
    .stat-number {
        font-size: 1.8em;
    }
    
    .chart-card canvas {
        height: 200px;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 0.85em;
    }
    
    .stats-grid {
        gap: 10px;
    }
    
    .charts-grid {
        gap: 10px;
    }
    
    .user-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .user-info button {
        width: 100%;
    }
    
    table {
        min-width: 500px;
    }
    
    .action-buttons button {
        font-size: 0.75em;
        padding: 6px;
    }
    
    .plata-detalj-table td {
        padding: 8px;
        font-size: 0.9em;
    }
    
    .profile-card {
        padding: 15px 10px;
    }
    
    .info-row {
        padding: 10px 0;
    }
    
    /* Mobilni bottom nav optimizacije */
    .mobile-bottom-nav-item {
        padding: 6px 2px;
        min-height: 55px;
    }
    
    .mobile-bottom-nav-icon {
        font-size: 1.3em;
    }
    
    .mobile-bottom-nav-text {
        font-size: 0.65em;
    }
    
    /* Mobilni sidebar optimizacije */
    .mobile-sidebar {
        width: 240px;
    }
    
    .mobile-nav-item {
        padding: 12px 15px;
        font-size: 0.95em;
    }
}

/* Tablet Portrait (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .section-header {
        flex-wrap: wrap;
    }
    
    .section-header > div {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    header {
        padding: 15px 20px;
    }
    
    header h1 {
        font-size: 1.4em;
    }
    
    .tab-content {
        padding: 15px 20px;
    }
    
    .modal-content {
        max-height: 90vh;
        margin: 2% auto;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .stat-icon {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .container {
        box-shadow: none;
        border-radius: 0;
    }
    
    .btn, .tab-btn, .user-info button {
        display: none;
    }
    
    .tab-content {
        display: block !important;
    }
    
    table {
        page-break-inside: avoid;
    }
}

/* Status badges */
.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
    display: inline-block;
}

.status-planiran {
    background: #fff3cd;
    color: #856404;
}

.status-odobren {
    background: #d1ecf1;
    color: #0c5460;
}

.status-u-toku {
    background: #d4edda;
    color: #155724;
}

.status-zavrsen {
    background: #d1ecf1;
    color: #0c5460;
}

.status-otkazan {
    background: #f8d7da;
    color: #721c24;
}

/* Role badges u tabelama */
.role-badge.role-admin {
    background: #667eea;
    color: white;
}

.role-badge.role-urednik {
    background: #6c757d;
    color: white;
}

.role-badge.role-radnik {
    background: #28a745;
    color: white;
}

.profile-container {
    max-width: 800px;
    margin: 0 auto;
}

.profile-card {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-row {
    display: flex;
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    align-items: center;
}

.info-label {
    font-weight: 600;
    color: #555;
    min-width: 180px;
    font-size: 1em;
}

.info-value {
    color: #333;
    font-size: 1em;
    flex: 1;
}

.modal-large {
    max-width: 800px;
}

.plata-detalj-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.plata-detalj-header h3 {
    font-size: 1.5em;
    color: #333;
    margin-bottom: 10px;
}

.plata-detalj-section {
    margin-bottom: 30px;
}

.plata-detalj-section h4 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 5px;
}

.plata-detalj-table {
    width: 100%;
    border-collapse: collapse;
}

.plata-detalj-table tr {
    border-bottom: 1px solid #e0e0e0;
}

.plata-detalj-table td {
    padding: 12px;
    color: #555;
}

.plata-detalj-table .text-right {
    text-align: right;
    font-weight: 500;
}

.plata-detalj-table .total-row {
    background: #f8f9ff;
    font-weight: 600;
}

.plata-detalj-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 3px solid #667eea;
    text-align: center;
}

.plata-detalj-footer h2 {
    color: #667eea;
    font-size: 1.8em;
}

.odmori-summary {
    margin-bottom: 25px;
}

.summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.summary-card h3 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 500;
}

.summary-card span {
    font-size: 1.5em;
    font-weight: 700;
    display: block;
    margin-top: 5px;
}

.procenat-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    display: inline-block;
}

.procenat-badge.low-usage {
    background: #d4edda;
    color: #155724;
}

.procenat-badge.medium-usage {
    background: #fff3cd;
    color: #856404;
}

.procenat-badge.high-usage {
    background: #f8d7da;
    color: #721c24;
}

.warning {
    color: #dc3545;
    font-weight: 700;
}

/* Toast Notification Styles */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 15px 20px;
    min-width: 300px;
    max-width: 500px;
    display: flex;
    align-items: center;
    gap: 15px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    pointer-events: all;
    border-left: 4px solid #667eea;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    border-left-color: #10b981;
}

.toast-error {
    border-left-color: #ef4444;
}

.toast-warning {
    border-left-color: #f59e0b;
}

.toast-info {
    border-left-color: #3b82f6;
}

.toast-icon {
    font-size: 20px;
    font-weight: bold;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    color: #10b981;
}

.toast-error .toast-icon {
    color: #ef4444;
}

.toast-warning .toast-icon {
    color: #f59e0b;
}

.toast-info .toast-icon {
    color: #3b82f6;
}

.toast-message {
    flex: 1;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
}

.toast-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.2s;
}

.toast-close:hover {
    color: #333;
}

/* Loading Spinner Styles */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay .spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

/* Search Box Styles */
.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-box input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
}

.search-box::after {
    content: '🔍';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* Filter Styles */
.filter-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-item label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.filter-item select,
.filter-item input {
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
}

.filter-item select:focus,
.filter-item input:focus {
    outline: none;
    border-color: #667eea;
}

/* Empty State Styles */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #666;
}

.empty-state-message {
    font-size: 14px;
    line-height: 1.5;
}

/* Dark Mode Styles */
body.dark-mode {
    background: #1a1a1a;
    color: #e5e5e5;
}

body.dark-mode .container {
    background: #2d2d2d;
    color: #e5e5e5;
}

body.dark-mode .toast {
    background: #2d2d2d;
    color: #e5e5e5;
}

body.dark-mode .toast-message {
    color: #e5e5e5;
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background: #1a1a1a;
    color: #e5e5e5;
    border-color: #404040;
}

body.dark-mode .table-container table {
    background: #2d2d2d;
    color: #e5e5e5;
}

body.dark-mode .table-container th {
    background: #1a1a1a;
    color: #e5e5e5;
}

body.dark-mode .table-container tr:hover {
    background: #404040;
}

/* Dashboard Styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 48px;
    opacity: 0.9;
}

.stat-content h3 {
    margin: 0 0 10px 0;
    font-size: 0.9em;
    opacity: 0.9;
    font-weight: 500;
}

.stat-number {
    font-size: 2.5em;
    font-weight: 700;
    margin: 0;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chart-card h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.2em;
}

.chart-card canvas {
    width: 100%;
    height: 300px;
}

.detailed-stats {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.detailed-stats h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.3em;
}

.stats-table-container {
    overflow-x: auto;
}

.stats-table-container table {
    width: 100%;
    border-collapse: collapse;
}

.stats-table-container th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.stats-table-container td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.stats-table-container tr:hover {
    background: #f8f9ff;
}

/* Dark mode za dashboard */
body.dark-mode .chart-card,
body.dark-mode .detailed-stats {
    background: #2d2d2d;
    color: #e5e5e5;
}

body.dark-mode .chart-card h3,
body.dark-mode .detailed-stats h3 {
    color: #e5e5e5;
}

body.dark-mode .stats-table-container th {
    background: #1a1a1a;
}

body.dark-mode .stats-table-container td {
    border-bottom-color: #404040;
}

body.dark-mode .stats-table-container tr:hover {
    background: #404040;
}

/* ============================================
   MOBILNI INTERFEJS STILOVI
   ============================================ */

/* Mobilni Header */
.mobile-header {
    display: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.mobile-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    gap: 10px;
}

.mobile-header-title {
    flex: 1;
    min-width: 0;
}

.mobile-header-title h1 {
    font-size: 1.2em;
    margin: 0;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    transition: background 0.2s ease;
    min-width: 40px;
    min-height: 40px;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
}

.mobile-menu-btn {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    cursor: pointer;
    padding: 8px;
    gap: 5px;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.mobile-menu-btn span {
    width: 24px;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobilni User Menu Dropdown */
.mobile-user-menu {
    display: none;
    background: rgba(0, 0, 0, 0.1);
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-user-menu.active {
    display: block;
}

.mobile-user-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-user-info span {
    font-size: 0.9em;
}

.mobile-menu-item {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    text-align: left;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95em;
    transition: background 0.2s ease;
    min-height: 44px;
}

.mobile-menu-item:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Mobilni Sidebar */
.mobile-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-sidebar-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    max-width: 85%;
    height: 100vh;
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    transition: left 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.mobile-sidebar.active {
    left: 0;
}

.mobile-sidebar-header {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.mobile-sidebar-header h3 {
    margin: 0;
    font-size: 1.2em;
    font-weight: 600;
}

.mobile-sidebar-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 8px;
    transition: background 0.2s ease;
    min-width: 40px;
    min-height: 40px;
}

.mobile-sidebar-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.mobile-nav {
    flex: 1;
    padding: 10px 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-nav-item {
    width: 100%;
    padding: 15px 20px;
    background: transparent;
    border: none;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: background 0.2s ease;
    color: #333;
    font-size: 1em;
    min-height: 50px;
    border-left: 3px solid transparent;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
    background: #f0f0f0;
    color: #667eea;
    border-left-color: #667eea;
}

.mobile-nav-icon {
    font-size: 1.5em;
    width: 30px;
    text-align: center;
    flex-shrink: 0;
}

.mobile-nav-text {
    flex: 1;
    font-weight: 500;
}

.mobile-sidebar-footer {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.mobile-user-info-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.mobile-user-info-footer span {
    font-size: 0.9em;
    color: #333;
}

/* Mobilni Bottom Navigation */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    border-top: 1px solid #e0e0e0;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.mobile-bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #666;
    transition: all 0.2s ease;
    min-height: 60px;
    justify-content: center;
    max-width: 100px;
    border-radius: 8px;
    margin: 0 2px;
}

.mobile-bottom-nav-item:hover {
    background: rgba(102, 126, 234, 0.1);
}

.mobile-bottom-nav-item.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.mobile-bottom-nav-icon {
    font-size: 1.5em;
    transition: transform 0.2s ease;
}

.mobile-bottom-nav-item.active .mobile-bottom-nav-icon {
    transform: scale(1.1);
}

.mobile-bottom-nav-text {
    font-size: 0.7em;
    font-weight: 500;
    white-space: nowrap;
}

/* Desktop Header - sakrij na mobilnim */
@media (max-width: 768px) {
    .desktop-header {
        display: none !important;
    }
    
    .mobile-header {
        display: block !important;
    }
    
    .desktop-nav {
        display: none !important;
    }
    
    .mobile-bottom-nav {
        display: flex !important;
    }
    
    body {
        padding-bottom: 80px; /* Space for bottom nav */
    }
    
    .container {
        margin-bottom: 0;
        padding-bottom: 0;
    }
    
    .tab-content {
        padding-bottom: 20px;
        padding-top: 10px;
    }
    
    /* Optimizacije za mobilni header */
    .mobile-header-top {
        padding: 10px 12px;
    }
    
    .mobile-header-title h1 {
        font-size: 1.1em;
    }
    
    /* Optimizacije za bottom nav */
    .mobile-bottom-nav {
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
    
    /* Optimizacije za sidebar */
    .mobile-sidebar {
        width: 260px;
    }
}

/* Desktop - sakrij mobilni interfejs */
@media (min-width: 769px) {
    .mobile-header {
        display: none !important;
    }
    
    .desktop-header {
        display: block !important;
    }
    
    .mobile-bottom-nav {
        display: none !important;
    }
    
    .desktop-nav {
        display: flex !important;
    }
    
    body {
        padding-bottom: 20px;
    }
}

/* Dark mode za mobilni interfejs */
body.dark-mode .mobile-sidebar {
    background: #2d2d2d;
    color: #e5e5e5;
}

body.dark-mode .mobile-nav-item {
    color: #e5e5e5;
}

body.dark-mode .mobile-nav-item:hover,
body.dark-mode .mobile-nav-item.active {
    background: #404040;
    color: #667eea;
}

body.dark-mode .mobile-sidebar-footer {
    background: #1a1a1a;
    border-top-color: #404040;
}

body.dark-mode .mobile-user-info-footer {
    border-bottom-color: #404040;
}

body.dark-mode .mobile-user-info-footer span {
    color: #e5e5e5;
}

body.dark-mode .mobile-bottom-nav {
    background: #2d2d2d;
    border-top-color: #404040;
}

body.dark-mode .mobile-bottom-nav-item {
    color: #999;
}

body.dark-mode .mobile-bottom-nav-item:hover,
body.dark-mode .mobile-bottom-nav-item.active {
    color: #667eea;
}

body.dark-mode .mobile-menu-item {
    background: rgba(255, 255, 255, 0.05);
    color: #e5e5e5;
}

body.dark-mode .mobile-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Stilovi za klikabilna imena */
.clickable-name {
    color: #667eea !important;
    text-decoration: none !important;
    cursor: pointer !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    border-bottom: 1px solid transparent !important;
}

.clickable-name:hover {
    color: #764ba2 !important;
    border-bottom-color: #764ba2 !important;
    text-decoration: none !important;
}

.clickable-name:active {
    color: #5568d3 !important;
}

/* Dark mode za klikabilna imena */
body.dark-mode .clickable-name {
    color: #8b9aff !important;
}

body.dark-mode .clickable-name:hover {
    color: #a78bfa !important;
    border-bottom-color: #a78bfa !important;
}

body.dark-mode .clickable-name:active {
    color: #7c8aff !important;
}


