/* ========================
   GLOBAL STYLES
   ======================== */
body { font-family: Arial, sans-serif; background: #f4f4f9; margin: 0; }

/* Stran za prijavo / registracijo */
body.auth-body { display: flex; justify-content: center; padding-top: 50px; }
body.app-body { padding: 20px; }

.container { background: #fff; padding: 30px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.auth-body .container { width: 300px; margin: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.app-body .container { max-width: 800px; margin: auto; }
.app-body .container.large-container { max-width: 1000px; }

.header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; padding-bottom: 10px; margin-bottom: 20px; }
.nav-links a { margin-left: 15px; font-weight: bold; color: #0056b3; text-decoration: none; }
.logout { color: #dc3545 !important; text-decoration: none; font-weight: bold; }

.msg { padding: 10px; background: #d4edda; color: #155724; border-radius: 4px; margin-bottom: 20px; }
.auth-body .msg { color: green; background: none; padding: 0; margin-bottom: 10px; font-size: 0.9em; }
.err { color: red; font-size: 0.9em; }

.company-badge { display: inline-block; background: #e9ecef; color: #495057; font-size: 0.6em; padding: 4px 8px; border-radius: 12px; vertical-align: middle; margin-left: 10px; font-weight: normal; }

/* ========================
   TABELE
   ======================== */
table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 0.9em; }
th, td { border: 1px solid #ddd; padding: 8px; text-align: left; }
th { background-color: #f2f2f2; }

/* Odzivne tabele za mobilne naprave */
.table-responsive { width: 100%; margin-bottom: 15px; overflow: visible; }

/* Stili za račune (Plačano / Zamujeno / Vrsta) */
tr.type-izdani td.type-indicator { border-left: 4px solid #007bff; color: #007bff; font-weight: bold; }
tr.type-prejeti td.type-indicator { border-left: 4px solid #fd7e14; color: #fd7e14; font-weight: bold; }

tr.row-overdue { background-color: #f8d7da !important; }
tr.row-overdue td { border-color: #f5c6cb; color: #721c24; }

/* Tabela za postavke računa */
.items-table { width: 100%; border-collapse: collapse; margin-top: 10px; margin-bottom: 15px; font-size: 0.85em; }
.items-table th, .items-table td { padding: 5px; border: 1px solid #ccc; text-align: left; }
.items-table input, .items-table select { width: 100%; padding: 6px; box-sizing: border-box; border: 1px solid #ccc; border-radius: 3px; font-size: 0.9em; }

/* ========================
   FORME IN VNOSI
   ======================== */
.auth-body input { width: 100%; padding: 10px; margin: 10px 0; box-sizing: border-box; border: 1px solid #ccc; border-radius: 4px; }
.auth-body button { width: 100%; padding: 10px; background: #0056b3; color: white; border: none; border-radius: 4px; cursor: pointer; }

.app-body input[type="text"], .app-body input[type="number"], .app-body input[type="date"], .app-body select { 
    width: 100%; padding: 8px; box-sizing: border-box; border: 1px solid #ccc; border-radius: 4px; 
}
input[readonly] { background: #e9ecef; cursor: not-allowed; }

.app-body button { padding: 10px 20px; background: #28a745; color: white; border: none; border-radius: 4px; cursor: pointer; }

.form-group { margin-bottom: 15px; flex: 1; min-width: 200px; }
.form-row { display: flex; flex-wrap: wrap; gap: 15px; }
label { display: block; font-weight: bold; margin-bottom: 5px; font-size: 0.9em; }

.checkbox-group { display: flex; align-items: center; margin-bottom: 10px; }
.checkbox-group input { margin-right: 10px; width: auto; }

/* ========================
   KOMPONENTE
   ======================== */
/* Preverjanje gesla */
#password-requirements { font-size: 0.8em; color: #666; margin-top: 5px; margin-bottom: 10px; }
#password-requirements ul { list-style-type: none; padding: 0; margin: 0; }
#password-requirements li { transition: color 0.3s; }
#password-requirements li.valid { color: #28a745; }
#password-requirements li.valid::before { content: '✓ '; font-weight: bold; }
#password-requirements li.invalid::before { content: '✗ '; font-weight: bold; }

/* Zavihki (Tabs) */
.tabs { border-bottom: 1px solid #ccc; margin-bottom: 20px; }
.tab-link { background: none; border: none; padding: 10px 15px; cursor: pointer; font-size: 16px; border-bottom: 3px solid transparent; color: #333; }
.tab-link.active { border-bottom: 3px solid #0056b3; font-weight: bold; }
.tab-content { display: none; }

/* Gumbi (Gumbni slogi) */
.actions button { padding: 5px 10px; border: none; border-radius: 4px; cursor: pointer; color: white; margin-top: 0 !important; }
.approve-btn { background-color: #28a745 !important; }
.reject-btn { background-color: #dc3545 !important; }

.btn-danger { background: #dc3545 !important; padding: 5px 10px !important; font-size: 0.9em; margin-top: 0 !important; }
.btn-edit { background: #ffc107 !important; color: #000 !important; padding: 5px 10px !important; font-size: 0.9em; text-decoration: none; border-radius: 4px; border: none; cursor: pointer; margin-top: 0 !important; }
.btn-add { background: #007bff !important; color: white; padding: 10px 20px !important; border: none; border-radius: 4px; cursor: pointer; font-size: 15px; margin: 0 !important; font-weight: bold; transition: background 0.2s;}
.btn-add:hover { background: #0056b3 !important; }
.btn-export { background: #28a745 !important; color: white; padding: 10px 20px !important; border: none; border-radius: 4px; cursor: pointer; font-size: 15px; margin: 0 !important; font-weight: bold; transition: background 0.2s; }
.btn-export:hover { background: #218838 !important; }
.btn-filter { background: #6c757d !important; color: white; border: none; padding: 8px 15px !important; border-radius: 4px; cursor: pointer; margin: 0 !important; transition: background 0.2s; }
.btn-filter:hover { background: #5a6268 !important; }

/* Orodjna vrstica in Filtri */
.actions-header { display: flex; justify-content: flex-end; gap: 10px; margin-bottom: 15px; }
.filter-card { background: #f8f9fa; padding: 20px; border-radius: 8px; border: 1px solid #e9ecef; margin-bottom: 20px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 15px; align-items: end; margin: 0; }
.filter-grid div { display: flex; flex-direction: column; }
.filter-grid label { font-size: 0.85em; color: #495057; margin-bottom: 6px; font-weight: bold; }
.filter-grid input, .filter-grid select { width: 100% !important; padding: 8px 10px; border: 1px solid #ced4da; border-radius: 4px; box-sizing: border-box; font-size: 0.9em; transition: border-color 0.2s; height: 35px; }
.filter-grid input:focus, .filter-grid select:focus { border-color: #80bdff; outline: none; }
.filter-grid .btn-filter { width: 100%; height: 35px; margin: 0; display: flex; align-items: center; justify-content: center; padding: 0 !important; }

/* Statistika v glavi */
.stats-banner { display: flex; flex-wrap: wrap; gap: 15px; background: #fff; padding: 15px 20px; border-radius: 6px; border: 1px solid #eaeaea; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.stats-box { flex: 1; min-width: 150px; }
.stats-box:not(:first-child) { border-left: 1px solid #eee; padding-left: 15px; }
.stats-label { display: block; font-size: 0.85em; color: #6c757d; text-transform: uppercase; font-weight: bold; margin-bottom: 5px; }
.stats-value { font-size: 1.4em; }

/* Paginacija */
.pagination { display: flex; justify-content: center; gap: 5px; margin-top: 20px; }
.page-link { padding: 8px 12px; border: 1px solid #ccc; border-radius: 4px; text-decoration: none; color: #0056b3; background: #fff; transition: background 0.2s; }
.page-link:hover { background: #e9ecef; }
.page-link.active { background: #0056b3; color: #fff; border-color: #0056b3; }

/* Padajoči meniji (Dropdown) v tabeli */
.dropdown { position: relative; display: inline-block; }
.dropdown-content,
.body-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: #fff;
    width: max-content;
    min-width: 0;
    max-width: 220px;
    box-shadow: 0px 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    border-radius: 4px;
    border: 1px solid #ddd;
    overflow: hidden;
}
.dropdown-content a,
.dropdown-content .dropdown-item-btn,
.body-dropdown a,
.body-dropdown .dropdown-item-btn {
    color: #333;
    padding: 7px 12px;
    text-decoration: none;
    display: block;
    font-size: 0.85em;
    text-align: left;
    background: none;
    border: none;
    width: auto;
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
    margin: 0 !important;
    border-radius: 0;
    box-sizing: border-box;
}
.dropdown-content form,
.body-dropdown form { display: block; margin: 0; width: auto; }
.dropdown-content a:hover,
.dropdown-content .dropdown-item-btn:hover,
.body-dropdown a:hover,
.body-dropdown .dropdown-item-btn:hover { background-color: #f8f9fa; }
.dropdown.show .dropdown-content { display: block; }
.body-dropdown {
    z-index: 9999;
}

/* Pojavno okno (Modal) */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.5); }
.modal-content { background-color: #fff; margin: 5% auto; padding: 30px; border-radius: 8px; width: 90%; max-width: 800px; position: relative; box-shadow: 0 4px 8px rgba(0,0,0,0.2); }
.close-btn { position: absolute; top: 15px; right: 20px; font-size: 28px; font-weight: bold; color: #888; cursor: pointer; }
.close-btn:hover { color: #333; }

/* ========================
   MOBILNE NAPRAVE (RESPONSIVE)
   ======================== */
@media (max-width: 768px) {
    .container { padding: 15px; }
    .header { flex-direction: column; align-items: flex-start; gap: 15px; }
    .nav-links { margin-left: 0; display: flex; flex-wrap: wrap; gap: 10px; }
    .nav-links a { margin-left: 0; }
    
    .actions-header { flex-direction: column; }
    .actions-header button { width: 100%; margin: 0; text-align: center; }
    .filter-card { padding: 15px; }
    
    .stats-box:not(:first-child) { border-left: none; padding-left: 0; border-top: 1px solid #eee; padding-top: 10px; }
    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    .modal-content { padding: 15px; margin: 10% auto; width: 95%; }
    .close-btn { top: 10px; right: 15px; }
    .tabs { display: flex; flex-wrap: wrap; gap: 5px; }
    .tab-link { padding: 8px 10px; font-size: 14px; flex: 1; text-align: center; }
}