/* ========================================
   ZInfV-2 Skladnost - Profesionalna spletna aplikacija
   Tablično-optimiziran dizajn
   ======================================== */

:root {
    /* Barvna shema - profesionalna, vladna */
    --color-primary: #1e3a8a;
    --color-primary-dark: #1e2a5e;
    --color-primary-light: #3b5bb5;
    --color-primary-50: #eff3fb;
    --color-primary-100: #d8e2f4;

    --color-accent: #0d9488;
    --color-accent-dark: #0a7568;

    --color-success: #16a34a;
    --color-warning: #ea580c;
    --color-danger: #dc2626;
    --color-info: #2563eb;

    --color-gray-50: #f8fafc;
    --color-gray-100: #f1f5f9;
    --color-gray-200: #e2e8f0;
    --color-gray-300: #cbd5e1;
    --color-gray-400: #94a3b8;
    --color-gray-500: #64748b;
    --color-gray-600: #475569;
    --color-gray-700: #334155;
    --color-gray-800: #1e293b;
    --color-gray-900: #0f172a;

    --color-bg: #f4f6fb;
    --color-card: #ffffff;
    --color-text: #0f172a;
    --color-text-muted: #64748b;
    --color-border: #e2e8f0;

    /* Velikosti - tablično optimizirane */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
    --shadow-xl: 0 24px 64px rgba(15, 23, 42, 0.18);

    --sidebar-width: 320px;
    --sidebar-collapsed-width: 80px;
    --topbar-height: 72px;
    --progress-height: 56px;

    /* Tipografija */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;

    /* Sidebar transition */
    --sidebar-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ========================================
   App Layout
   ======================================== */
.app {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* ========================================
   Sidebar
   ======================================== */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    transition: width var(--sidebar-transition), transform var(--sidebar-transition);
    position: relative;
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 80px;
    flex-shrink: 0;
}

.logo {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo svg {
    width: 26px;
    height: 26px;
    color: white;
}

.app-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    transition: opacity 0.2s, max-width var(--sidebar-transition);
    max-width: 200px;
}

.app-title h1 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-title span {
    font-size: 0.85rem;
    opacity: 0.75;
    font-weight: 500;
    white-space: nowrap;
}

.sidebar-collapse {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: white;
    border-radius: var(--radius-md);
    transition: background 0.2s, transform var(--sidebar-transition);
    flex-shrink: 0;
}

.sidebar-collapse:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-collapse svg {
    width: 18px;
    height: 18px;
    transition: transform var(--sidebar-transition);
}

.sidebar.collapsed .sidebar-collapse svg {
    transform: rotate(180deg);
}

.sidebar-close {
    display: none;
    width: 40px;
    height: 40px;
    color: white;
    border-radius: var(--radius-md);
    transition: background 0.2s;
}

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

/* When collapsed, hide text and show only icons */
/* Uporabimo display:none za zanesljivo skrivanje v vseh brskalnikih (tudi Brave) */
.sidebar.collapsed .app-title,
.sidebar.collapsed .org-selector-info,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .sidebar-footer .version-info > span:last-child,
.sidebar.collapsed .org-selector-arrow {
    display: none !important;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 14px;
    gap: 0;
    text-align: center;
}

.sidebar.collapsed .nav-item .badge {
    display: none;
}

.sidebar.collapsed .nav-item .nav-icon {
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar.collapsed .org-selector {
    padding: 10px;
}

.sidebar.collapsed .org-selector-btn {
    justify-content: center;
    align-items: center;
    padding: 12px;
    width: 60px;
    height: 60px;
    margin: 0 auto;
    min-height: 60px;
}

.sidebar.collapsed .org-selector-icon {
    margin: 0;
    width: 40px;
    height: 40px;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 22px 18px;
}

.sidebar.collapsed .sidebar-collapse {
    position: absolute;
    right: 8px;
    top: 28px;
}

/* Poseben poudarek za gumb "Dodaj novo organizacijo" v collapsed načinu */
.sidebar.collapsed .nav-item-org-new {
    background: var(--color-primary);
    color: white;
    margin: 6px auto;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    padding: 0;
    box-shadow: var(--shadow-md);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar.collapsed .nav-item-org-new:hover {
    background: var(--color-primary-dark);
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.sidebar.collapsed .nav-item-org-new .nav-icon {
    width: 24px;
    height: 24px;
    margin: 0;
}

.sidebar.collapsed .nav-item-org-new .nav-icon svg {
    width: 24px;
    height: 24px;
}

/* Tooltip za collapsed ikone - prikaže ime ob hoverju */
.sidebar.collapsed .nav-item[title]:hover::after,
.sidebar.collapsed .org-selector-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--color-gray-900);
    color: white;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    pointer-events: none;
}

/* ========================================
   Organization Selector
   ======================================== */
.org-selector {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

/* Gumb "Dodaj novo organizacijo" - moder gradient, enaka poravnava kot ostali items */
.nav-item-org-new {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    margin: 6px 0 8px;
    border-radius: var(--radius-md);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.nav-item-org-new:hover {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-darker, #1e3a8a) 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.nav-item-org-new .nav-icon {
    color: white;
}

.org-selector-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    color: white;
    transition: all 0.2s;
    min-height: 56px;
    text-align: left;
    overflow: hidden;
}

.org-selector-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.25);
}

.org-selector-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.org-selector-icon svg {
    width: 20px;
    height: 20px;
}

.org-selector-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    transition: opacity 0.2s;
}

.org-selector-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.7;
    font-weight: 600;
    margin-bottom: 2px;
}

.org-selector-name {
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.org-selector-arrow {
    flex-shrink: 0;
    opacity: 0.7;
    transition: transform 0.2s, opacity 0.2s;
}

.org-selector-arrow svg {
    width: 16px;
    height: 16px;
}

/* Org dropdown */
.org-dropdown {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 420px;
    height: 100vh;
    background: var(--color-card);
    box-shadow: var(--shadow-xl);
    z-index: 1500;
    transform: translateX(-100%);
    transition: transform var(--sidebar-transition);
    display: flex;
    flex-direction: column;
}

.org-dropdown.open {
    transform: translateX(0);
}

.org-dropdown-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(2px);
    z-index: 1499;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.org-dropdown-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.org-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    flex-shrink: 0;
}

.org-dropdown-header span {
    font-size: 1.1rem;
    font-weight: 700;
}

.btn-icon-sm {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

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

.btn-icon-sm svg {
    width: 18px;
    height: 18px;
}

.org-dropdown-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.org-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 6px;
    border: 1.5px solid transparent;
}

.org-dropdown-item:hover {
    background: var(--color-gray-100);
    border-color: var(--color-border);
}

.org-dropdown-item.active {
    background: var(--color-primary-50);
    border-color: var(--color-primary-light);
}

.org-dropdown-item-icon {
    width: 40px;
    height: 40px;
    background: var(--color-gray-100);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-gray-600);
    flex-shrink: 0;
}

.org-dropdown-item.active .org-dropdown-item-icon {
    background: var(--color-primary);
    color: white;
}

.org-dropdown-item-icon svg {
    width: 22px;
    height: 22px;
}

.org-dropdown-item-info {
    flex: 1;
    min-width: 0;
}

.org-dropdown-item-name {
    font-weight: 600;
    color: var(--color-gray-900);
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.org-dropdown-item-meta {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.org-dropdown-item-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.org-dropdown-empty {
    text-align: center;
    padding: 60px 24px;
    color: var(--color-text-muted);
}

.org-dropdown-empty::before {
    content: '📋';
    display: block;
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.4;
}

.org-dropdown-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--color-border);
    background: var(--color-gray-50);
    flex-shrink: 0;
}

.btn-block {
    width: 100%;
}

/* ========================================
   Sidebar nav
   ======================================== */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
    overflow-x: hidden;
}

.nav-section {
    margin-bottom: 20px;
}

.nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    padding: 8px 12px;
    margin-bottom: 4px;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 4px;
    min-height: 52px;
    position: relative;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.18);
    color: white;
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: white;
    border-radius: 2px;
}

.nav-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon svg {
    width: 22px;
    height: 22px;
}

.nav-text {
    flex: 1;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.2s;
}

.nav-item.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.nav-item .badge {
    background: rgba(255, 255, 255, 0.15);
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    flex-shrink: 0;
    transition: opacity 0.2s;
}

.nav-item.danger:hover {
    background: rgba(220, 38, 38, 0.25);
    color: #fecaca;
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    flex-shrink: 0;
}

.version-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.version-info > span:first-child {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
}

#autoSaveStatus {
    display: flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.2s;
}

#autoSaveStatus::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--color-success);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px var(--color-success);
    flex-shrink: 0;
}

#autoSaveStatus.saving::before {
    background: var(--color-warning);
    box-shadow: 0 0 8px var(--color-warning);
    animation: pulse 1s infinite;
}

#autoSaveStatus.cloud::before {
    background: var(--color-info);
    box-shadow: 0 0 8px var(--color-info);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 99;
}

.sidebar-expand {
    position: absolute;
    top: 22px;
    right: -16px;
    width: 32px;
    height: 32px;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    z-index: 101;
    transition: background 0.2s;
}

.sidebar-expand:hover {
    background: var(--color-primary-dark);
}

.sidebar-expand svg {
    width: 16px;
    height: 16px;
}

.sidebar.collapsed .sidebar-expand {
    display: flex;
}

.sidebar.collapsed .sidebar-collapse {
    display: none;
}

/* ========================================
   Main
   ======================================== */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--color-bg);
    min-width: 0;
}

/* ========================================
   Topbar
   ======================================== */
.topbar {
    height: var(--topbar-height);
    background: var(--color-card);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
    z-index: 50;
}

.menu-btn {
    display: none;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    color: var(--color-gray-700);
    transition: background 0.2s;
    align-items: center;
    justify-content: center;
}

.menu-btn:hover {
    background: var(--color-gray-100);
}

.menu-btn svg {
    width: 26px;
    height: 26px;
}

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

.topbar-title h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-gray-900);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-title span {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

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

.btn-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    color: var(--color-gray-700);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--color-gray-100);
    color: var(--color-primary);
}

.btn-icon svg {
    width: 22px;
    height: 22px;
}

/* ========================================
   Progress
   ======================================== */
.progress-container {
    height: var(--progress-height);
    padding: 10px 32px;
    background: var(--color-card);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    flex-shrink: 0;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.progress-bar {
    height: 6px;
    background: var(--color-gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-accent) 100%);
    width: 0;
    transition: width 0.4s ease;
    border-radius: 3px;
}

/* ========================================
   Form Container
   ======================================== */
.form-container {
    flex: 1;
    overflow-y: auto;
    padding: 32px 32px 100px;
    scroll-behavior: smooth;
}

.section-card {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    scroll-margin-top: 16px;
    transition: box-shadow 0.2s;
}

.section-card:hover {
    box-shadow: var(--shadow-lg);
}

.section-header {
    padding: 24px 32px;
    background: linear-gradient(135deg, var(--color-primary-50) 0%, var(--color-card) 100%);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 16px;
}

.section-number {
    width: 48px;
    height: 48px;
    background: var(--color-primary);
    color: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

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

.section-title h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-gray-900);
    line-height: 1.3;
    margin-bottom: 2px;
}

.section-title p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    line-height: 1.4;
}

.section-body {
    padding: 28px 32px;
}

/* ========================================
   Form Elements
   ======================================== */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-gray-800);
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-label .required {
    color: var(--color-danger);
    font-size: 1rem;
    line-height: 1;
}

.form-label .helper {
    color: var(--color-text-muted);
    font-weight: 400;
    font-size: 0.8rem;
    margin-left: 4px;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    line-height: 1.4;
    margin-top: 2px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-card);
    color: var(--color-text);
    font-size: 1rem;
    line-height: 1.4;
    transition: all 0.2s;
    min-height: 50px;
    font-weight: 500;
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
    line-height: 1.5;
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
    border-color: var(--color-gray-400);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
    background: var(--color-card);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--color-gray-400);
    font-weight: 400;
}

.form-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 44px;
    cursor: pointer;
}

.form-checkbox,
.form-radio {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    background: var(--color-card);
    min-height: 50px;
}

.form-checkbox:hover,
.form-radio:hover {
    border-color: var(--color-primary-light);
    background: var(--color-primary-50);
}

.form-checkbox input,
.form-radio input {
    width: 22px;
    height: 22px;
    accent-color: var(--color-primary);
    cursor: pointer;
    flex-shrink: 0;
}

.form-checkbox span,
.form-radio span {
    font-size: 0.95rem;
    color: var(--color-gray-800);
    line-height: 1.3;
}

.checkbox-group,
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.input-with-icon {
    position: relative;
}

.input-with-icon .form-input {
    padding-left: 44px;
}

.input-with-icon .icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--color-gray-400);
    pointer-events: none;
}

/* ========================================
   Subsection
   ======================================== */
.subsection {
    background: var(--color-gray-50);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin-bottom: 16px;
    border-left: 3px solid var(--color-primary);
}

.subsection:last-child {
    margin-bottom: 0;
}

.subsection-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-gray-800);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.subsection-title::before {
    content: '▸';
    color: var(--color-primary);
    font-size: 0.9rem;
}

/* ========================================
   Dynamic List
   ======================================== */
.dynamic-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.dynamic-item {
    background: var(--color-card);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 20px;
    position: relative;
    transition: all 0.2s;
}

.dynamic-item:hover {
    border-color: var(--color-primary-light);
    box-shadow: var(--shadow-sm);
}

.dynamic-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
}

.dynamic-item-title {
    font-weight: 700;
    color: var(--color-gray-800);
    font-size: 0.95rem;
}

.dynamic-item-remove {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    color: var(--color-danger);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.dynamic-item-remove:hover {
    background: #fef2f2;
}

.dynamic-item-remove svg {
    width: 20px;
    height: 20px;
}

.btn-add {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--color-primary-50);
    color: var(--color-primary);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
    margin-top: 12px;
    min-height: 48px;
    border: 1.5px dashed var(--color-primary-light);
}

.btn-add:hover {
    background: var(--color-primary);
    color: white;
    border-style: solid;
    transform: translateY(-1px);
}

.btn-add svg {
    width: 18px;
    height: 18px;
}

.empty-list {
    text-align: center;
    padding: 32px 16px;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    background: var(--color-gray-50);
    border: 1.5px dashed var(--color-border);
    border-radius: var(--radius-md);
}

.empty-list::before {
    content: '📋';
    display: block;
    font-size: 1.8rem;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* ========================================
   ZCRA table (info display)
   ======================================== */
.zcra-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--color-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--color-border);
    margin: 12px 0;
}

.zcra-table thead {
    background: var(--color-primary-50);
}

.zcra-table th {
    padding: 12px 14px;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-gray-800);
    border-bottom: 1px solid var(--color-border);
}

.zcra-table td {
    padding: 12px 14px;
    font-size: 0.9rem;
    color: var(--color-gray-700);
    border-bottom: 1px solid var(--color-border);
}

.zcra-table tbody tr:last-child td {
    border-bottom: none;
}

.zcra-table tbody tr:hover {
    background: var(--color-gray-50);
}

.zcra-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--color-primary);
    color: white;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.85rem;
    margin-right: 8px;
    min-width: 28px;
    text-align: center;
}

/* Display / calculated field */
.display-field {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: var(--color-primary-50);
    border: 1.5px solid var(--color-primary-light);
    border-radius: var(--radius-md);
    min-height: 50px;
    font-size: 1rem;
}

.display-value {
    font-weight: 500;
    color: var(--color-gray-800);
}

.display-value strong {
    color: var(--color-primary-dark);
    font-size: 1.2rem;
    font-weight: 700;
}

.risk-acceptable {
    color: var(--color-success) !important;
}

.risk-unacceptable {
    color: var(--color-danger) !important;
}

.risk-badge-high {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: var(--color-danger);
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.risk-badge-ok {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: var(--color-success);
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Risk level coloring for display field container */
.display-field[data-value="1"],
.display-field[data-value="2"],
.display-field[data-value="3"],
.display-field[data-value="4"],
.display-field[data-value="5"] {
    /* These are max/vpliv values, leave as is */
}

.display-field[data-value="1"],
.display-field[data-value="2"],
.display-field[data-value="3"],
.display-field[data-value="4"],
.display-field[data-value="5"],
.display-field[data-value="6"],
.display-field[data-value="7"],
.display-field[data-value="8"],
.display-field[data-value="9"],
.display-field[data-value="10"],
.display-field[data-value="11"],
.display-field[data-value="12"],
.display-field[data-value="13"],
.display-field[data-value="14"],
.display-field[data-value="15"],
.display-field[data-value="16"],
.display-field[data-value="17"],
.display-field[data-value="18"],
.display-field[data-value="19"],
.display-field[data-value="20"],
.display-field[data-value="21"],
.display-field[data-value="22"],
.display-field[data-value="23"],
.display-field[data-value="24"],
.display-field[data-value="25"] {
    /* Risk factor values - apply coloring based on acceptable threshold */
}

.info-box {
    background: var(--color-primary-50);
    border: 1px solid var(--color-primary-light);
    border-left: 4px solid var(--color-primary);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin: 12px 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--color-gray-700);
}

.info-box strong {
    color: var(--color-gray-900);
}

.info-box.warning {
    background: #fff7ed;
    border-color: #fb923c;
    border-left-color: var(--color-warning);
}

.info-box.success {
    background: #f0fdf4;
    border-color: #4ade80;
    border-left-color: var(--color-success);
}

/* ========================================
   Floating Action Buttons
   ======================================== */
.floating-actions {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    gap: 12px;
    z-index: 40;
}

.fab {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transition: all 0.2s;
}

.fab svg {
    width: 24px;
    height: 24px;
}

.fab-primary {
    background: var(--color-primary);
    color: white;
}

.fab-primary:hover {
    background: var(--color-primary-dark);
    transform: scale(1.05);
    box-shadow: var(--shadow-xl);
}

.fab-secondary {
    background: var(--color-card);
    color: var(--color-gray-700);
    border: 1.5px solid var(--color-border);
}

.fab-secondary:hover {
    background: var(--color-gray-100);
    transform: scale(1.05);
}

#prevSectionBtn:disabled,
#nextSectionBtn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* ========================================
   Toast
   ======================================== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
}

.toast {
    background: var(--color-card);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--color-primary);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    animation: slideIn 0.3s ease;
    min-width: 280px;
}

@keyframes slideIn {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left-color: var(--color-success);
}

.toast.error {
    border-left-color: var(--color-danger);
}

.toast.warning {
    border-left-color: var(--color-warning);
}

.toast-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.toast.success .toast-icon { color: var(--color-success); }
.toast.error .toast-icon { color: var(--color-danger); }
.toast.warning .toast-icon { color: var(--color-warning); }
.toast .toast-icon { color: var(--color-primary); }

/* ========================================
   Modal
   ======================================== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.open {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: relative;
    background: var(--color-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: scaleIn 0.2s ease;
}

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

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border);
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-gray-900);
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    color: var(--color-gray-500);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--color-gray-100);
    color: var(--color-gray-900);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    line-height: 1.6;
    color: var(--color-gray-700);
}

.modal-body p {
    margin-bottom: 12px;
}

.modal-body p:last-child {
    margin-bottom: 0;
}

.modal-body code {
    background: var(--color-gray-100);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--color-primary-dark);
}

.modal-body pre {
    background: var(--color-gray-100);
    padding: 16px;
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    overflow-x: auto;
    margin: 12px 0;
    line-height: 1.5;
    color: var(--color-gray-800);
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--color-border);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-footer.space-between {
    justify-content: space-between;
}

/* ========================================
   Form Footer / Navigation
   ======================================== */
.section-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
    background: var(--color-gray-50);
    border-top: 1px solid var(--color-border);
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
    min-height: 48px;
    min-width: 120px;
    border: 1.5px solid transparent;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--color-card);
    color: var(--color-gray-800);
    border-color: var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-gray-100);
    border-color: var(--color-gray-300);
}

.btn-danger {
    background: var(--color-danger);
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: var(--color-success);
    color: white;
}

.btn-success:hover {
    background: #15803d;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.85rem;
    min-height: 38px;
    min-width: auto;
}

/* ========================================
   Responsive - Tablet (medium)
   ======================================== */
@media (max-width: 1100px) {
    :root {
        --sidebar-width: 280px;
    }
}

/* ========================================
   Supabase Wizard
   ======================================== */
.wizard-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.wizard {
    background: var(--color-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 720px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: scaleIn 0.3s ease;
    overflow: hidden;
}

.wizard-header {
    padding: 32px 40px 24px;
    text-align: center;
    background: linear-gradient(135deg, var(--color-primary-50) 0%, var(--color-card) 100%);
    border-bottom: 1px solid var(--color-border);
}

.wizard-logo {
    width: 72px;
    height: 72px;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
}

.wizard-logo svg {
    width: 36px;
    height: 36px;
}

.wizard-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-gray-900);
    margin-bottom: 6px;
}

.wizard-header p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.wizard-body {
    padding: 32px 40px;
    overflow-y: auto;
    flex: 1;
}

.wizard-step-indicator {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.wizard-step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-gray-300);
    transition: all 0.2s;
}

.wizard-step-dot.active {
    background: var(--color-primary);
    width: 28px;
    border-radius: 5px;
}

.wizard-step-dot.done {
    background: var(--color-success);
}

.wizard-step h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-gray-900);
    margin-bottom: 12px;
}

.wizard-step p {
    color: var(--color-gray-700);
    line-height: 1.6;
    margin-bottom: 12px;
}

.wizard-step ol, .wizard-step ul {
    padding-left: 22px;
    color: var(--color-gray-700);
    line-height: 1.7;
    margin-bottom: 12px;
}

.wizard-step ol li, .wizard-step ul li {
    margin-bottom: 4px;
}

.wizard-step code {
    background: var(--color-gray-100);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--color-primary-dark);
}

.wizard-step pre {
    background: var(--color-gray-900);
    color: #e2e8f0;
    padding: 16px;
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 1.5;
    overflow-x: auto;
    margin: 12px 0;
}

.wizard-step pre .comment {
    color: #94a3b8;
}

.wizard-step pre .keyword {
    color: #c084fc;
}

.wizard-step pre .string {
    color: #86efac;
}

.wizard-success {
    background: #f0fdf4;
    border: 1px solid #4ade80;
    border-left: 4px solid var(--color-success);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-top: 12px;
    color: #166534;
    font-size: 0.9rem;
    line-height: 1.5;
}

.wizard-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-left: 4px solid var(--color-danger);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-top: 12px;
    color: #991b1b;
    font-size: 0.9rem;
    line-height: 1.5;
}

.wizard-footer {
    padding: 16px 40px;
    background: var(--color-gray-50);
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.wizard-footer-right {
    display: flex;
    gap: 10px;
}

.wizard-storage-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--color-gray-50);
    border-radius: var(--radius-md);
    margin: 16px 0;
    font-size: 0.88rem;
    color: var(--color-gray-700);
    border: 1px solid var(--color-border);
}

.wizard-storage-info svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.wizard-storage-info.success {
    background: #f0fdf4;
    border-color: #4ade80;
    color: #166534;
}

.wizard-storage-info.error {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}

/* ========================================
   Responsive - Tablet (small) & Portrait
   ======================================== */
@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar.collapsed {
        width: var(--sidebar-width);
    }

    .sidebar-close {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar-overlay.open {
        display: block;
    }

    .menu-btn {
        display: flex;
    }

    .form-container {
        padding: 20px 20px 100px;
    }

    .section-header {
        padding: 18px 20px;
    }

    .section-body {
        padding: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .topbar {
        padding: 0 16px;
    }
}

/* ========================================
   Responsive - Mobile
   ======================================== */
@media (max-width: 600px) {
    :root {
        --topbar-height: 64px;
    }

    .topbar-title h2 {
        font-size: 1.05rem;
    }

    .topbar-title span {
        display: none;
    }

    .floating-actions {
        bottom: 16px;
        right: 16px;
    }

    .fab {
        width: 52px;
        height: 52px;
    }

    .form-container {
        padding: 16px 16px 90px;
    }

    .section-header {
        padding: 16px;
        gap: 12px;
    }

    .section-body {
        padding: 16px;
    }

    .section-number {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .section-title h3 {
        font-size: 1.05rem;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .org-dropdown {
        max-width: 100%;
    }
}

/* Portrait orientation: sidebar postane overlay (kot na mobilnem) - uporabnik ga odpre s hamburgerjem */
/* Tablica portrait (601-1100px): sidebar fiksen, omogoča skrivanje */
/* Na tablici je sidebar fiksen na levi (260px), z možnostjo skrivanja s collapse ikono */
/* Ko je collapsed, se skrije in hamburger gumb v topbarju ga znova odpre */
@media (orientation: portrait) and (min-width: 601px) and (max-width: 1100px) {
    .sidebar {
        position: relative;
        left: 0;
        top: 0;
        bottom: 0;
        width: 260px;
        flex-shrink: 0;
        transform: none;
        transition: transform 0.3s ease, width 0.3s ease, margin-left 0.3s ease;
        z-index: 1;
    }

    /* Ko je sidebar collapsed na tablici, se popolnoma skrije in glavna vsebina se razširi */
    .sidebar.collapsed {
        width: 0;
        min-width: 0;
        margin-left: 0;
        padding: 0;
        border: none;
        overflow: hidden;
        flex-shrink: 1;
    }

    .sidebar.collapsed > * {
        display: none;
    }

    /* V tabličnem načinu vedno pokaži vse elemente (besedila, naslove) - ko je sidebar viden */
    .sidebar:not(.collapsed) .app-title,
    .sidebar:not(.collapsed) .org-selector-info,
    .sidebar:not(.collapsed) .nav-text,
    .sidebar:not(.collapsed) .nav-section-title,
    .sidebar:not(.collapsed) .org-selector-arrow,
    .sidebar:not(.collapsed) .sidebar-footer #autoSaveStatus {
        display: block !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        max-width: none !important;
    }

    /* Gumbi v nav-items: levo poravnano, enotna oblika */
    .sidebar:not(.collapsed) .nav-item {
        justify-content: flex-start;
        padding: 12px 14px;
        gap: 12px;
        text-align: left;
        margin: 2px 8px;
    }

    .sidebar:not(.collapsed) .nav-item .badge {
        display: inline-flex;
    }

    .sidebar:not(.collapsed) .nav-item .nav-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        flex-shrink: 0;
    }

    .sidebar:not(.collapsed) .org-selector {
        padding: 14px 16px;
    }

    .sidebar:not(.collapsed) .org-selector-btn {
        justify-content: flex-start;
        padding: 12px 14px;
        gap: 12px;
    }

    .sidebar:not(.collapsed) .sidebar-header {
        justify-content: space-between;
        padding: 18px 16px;
    }

    /* Gumb za dodajanje organizacije - normalen, enako poravnan kot ostali */
    .sidebar:not(.collapsed) .nav-item-org-new {
        width: auto;
        height: auto;
        border-radius: var(--radius-md);
        padding: 12px 14px;
        margin: 4px 8px 8px;
    }

    .sidebar:not(.collapsed) .nav-item-org-new .nav-icon {
        width: 24px;
        height: 24px;
    }

    /* Hamburger gumb: viden ko je sidebar collapsed (da ga uporabnik znova odpre) */
    .menu-btn {
        display: flex;
    }

    .sidebar-close {
        display: none;
    }

    .sidebar-expand {
        display: none;
    }

    /* Collapse ikona: vidna ko je sidebar viden (da ga uporabnik lahko skrije) */
    .sidebar-collapse {
        display: flex;
    }

    .sidebar-overlay {
        display: none !important;
    }

    /* Glavna vsebina: ko je sidebar collapsed, se razširi čez celoten zaslon */
    .main {
        flex: 1;
        min-width: 0;
    }
}

/* ========================================
   Print
   ======================================== */
@media print {
    .sidebar,
    .topbar,
    .floating-actions,
    .progress-container,
    .btn-add,
    .dynamic-item-remove,
    .section-footer,
    .org-dropdown,
    .sidebar-overlay {
        display: none !important;
    }

    .form-container {
        padding: 0;
        overflow: visible;
    }

    .section-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
        margin-bottom: 16px;
    }

    body {
        background: white;
        overflow: visible;
    }

    .app {
        display: block;
        height: auto;
    }

    .main {
        overflow: visible;
    }
}

/* ========================================
   Tablet Optimizations (601px - 1100px)
   Veliki touch targeti, večji razmaki, boljše obvladovanje orientacije
   ======================================== */
@media (min-width: 601px) and (max-width: 1100px) {
    /* Topbar */
    .topbar {
        height: 72px;
        padding: 0 24px;
        gap: 20px;
    }

    .menu-btn {
        width: 56px;
        height: 56px;
    }

    .menu-btn svg {
        width: 30px;
        height: 30px;
    }

    .topbar-title h2 {
        font-size: 1.3rem;
    }

    .topbar-title span {
        font-size: 0.95rem;
    }

    .topbar-actions {
        gap: 12px;
    }

    .btn-topbar {
        height: 56px;
        min-width: 56px;
        padding: 0 18px;
        font-size: 1rem;
    }

    .btn-topbar span {
        display: inline;
    }

    /* Form container */
    .form-container {
        padding: 28px 28px 120px;
    }

    .section-card {
        border-radius: var(--radius-lg);
        margin-bottom: 24px;
    }

    .section-header {
        padding: 24px 28px;
        gap: 20px;
    }

    .section-number {
        width: 56px;
        height: 56px;
        font-size: 1.3rem;
    }

    .section-title h3 {
        font-size: 1.3rem;
    }

    .section-title p {
        font-size: 0.95rem;
    }

    .section-body {
        padding: 28px;
    }

    .form-row {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .form-row.row-3 {
        grid-template-columns: 1fr 1fr 1fr;
    }

    /* Polja - večji touch target */
    .form-input,
    .form-textarea,
    .form-select,
    select.form-input {
        min-height: 56px;
        padding: 14px 18px;
        font-size: 1.05rem;
    }

    .form-textarea {
        min-height: 120px;
        padding: 14px 18px;
        line-height: 1.6;
    }

    .form-label {
        font-size: 1rem;
        margin-bottom: 10px;
    }

    .form-hint {
        font-size: 0.9rem;
    }

    /* Checkboxi in radio - večji */
    .form-checkbox,
    .form-radio {
        min-height: 52px;
        padding: 12px 16px;
        font-size: 1rem;
    }

    .form-checkbox input[type="checkbox"],
    .form-radio input[type="radio"] {
        width: 24px;
        height: 24px;
    }

    .checkbox-group .form-checkbox {
        margin-bottom: 8px;
    }

    .checkbox-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    /* Gumbi */
    .btn {
        min-height: 52px;
        padding: 14px 24px;
        font-size: 1rem;
    }

    .btn-sm {
        min-height: 44px;
        padding: 10px 18px;
    }

    .btn-icon-sm {
        width: 44px;
        height: 44px;
    }

    .btn-add {
        min-height: 60px;
        font-size: 1.05rem;
    }

    .btn-block {
        width: 100%;
    }

    .section-footer {
        padding: 18px 28px;
        gap: 14px;
    }

    /* Dynamic items */
    .dynamic-item {
        margin-bottom: 20px;
        border-radius: var(--radius-md);
    }

    .dynamic-item-header {
        padding: 16px 20px;
    }

    .dynamic-item-body {
        padding: 20px;
    }

    .dynamic-item-actions button {
        min-width: 44px;
        min-height: 44px;
    }

    /* Progress bar */
    .progress-bar-container {
        padding: 20px 28px;
    }

    .progress-text {
        font-size: 0.95rem;
    }

    /* Floating action button */
    .floating-actions {
        bottom: 24px;
        right: 24px;
    }

    .fab {
        width: 64px;
        height: 64px;
    }

    .fab svg {
        width: 30px;
        height: 30px;
    }

    .fab-menu {
        bottom: 80px;
    }

    .fab-menu button {
        min-height: 56px;
        padding: 14px 20px;
        font-size: 1rem;
    }

    /* Modal-i za tablico - večji, vidni */
    .modal {
        padding: 28px;
        align-items: center;
    }

    .modal-content {
        max-width: 640px;
        max-height: 85vh;
        border-radius: var(--radius-xl);
    }

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

    .modal-header {
        padding: 24px 28px;
    }

    .modal-header h3 {
        font-size: 1.4rem;
    }

    .modal-close {
        width: 56px;
        height: 56px;
        font-size: 1.8rem;
    }

    .modal-body {
        padding: 28px;
        font-size: 1rem;
    }

    .modal-footer {
        padding: 20px 28px;
        gap: 16px;
    }

    .modal-footer .btn {
        flex: 1;
        min-height: 56px;
    }

    /* Wizard */
    .wizard-overlay {
        padding: 28px;
    }

    .wizard {
        max-width: 800px;
        max-height: 85vh;
    }

    .wizard-header {
        padding: 36px 40px 28px;
    }

    .wizard-header h2 {
        font-size: 1.7rem;
    }

    .wizard-header p {
        font-size: 1.05rem;
    }

    .wizard-body {
        padding: 36px 40px;
    }

    .wizard-step h3 {
        font-size: 1.35rem;
    }

    .wizard-step p,
    .wizard-step li {
        font-size: 1rem;
    }

    .wizard-footer {
        padding: 20px 28px;
    }

    .wizard-footer .btn {
        min-height: 56px;
        padding: 14px 28px;
    }

    /* Org dropdown - sidebar overlay na tablici */
    .org-dropdown {
        max-width: 380px;
    }

    .org-dropdown-header {
        padding: 24px 28px;
    }

    .org-dropdown-header span {
        font-size: 1.2rem;
    }

    .org-dropdown-item {
        padding: 18px 24px;
        min-height: 70px;
    }

    .org-dropdown-item-name {
        font-size: 1.1rem;
    }

    .org-dropdown-item-meta {
        font-size: 0.9rem;
    }

    .org-dropdown-empty {
        padding: 32px 24px;
        font-size: 1rem;
    }

    .org-dropdown-footer {
        padding: 20px 24px;
    }

    .org-dropdown-footer .btn {
        min-height: 56px;
    }

    /* Toast */
    .toast {
        min-width: 320px;
        max-width: 480px;
        padding: 18px 24px;
        font-size: 1rem;
    }

    /* Risk badges večje na tablici */
    .risk-badge {
        font-size: 0.95rem;
        padding: 6px 12px;
    }

    /* Help text in opombe večje */
    .form-help {
        font-size: 0.9rem;
        margin-top: 8px;
    }
}

/* ========================================
   Landscape tablet (1100x768, 1366x768) - landscape posebnosti
   ======================================== */
@media (orientation: landscape) and (min-width: 1024px) and (max-height: 900px) {
    .form-container {
        padding: 24px 32px 100px;
    }

    .section-card {
        margin-bottom: 20px;
    }

    .section-header {
        padding: 20px 28px;
    }

    .section-body {
        padding: 24px 28px;
    }

    .form-row {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 18px;
    }
}

/* ========================================
   Utilities
   ======================================== */
.hidden { display: none !important; }
.text-muted { color: var(--color-text-muted); }
.mt-2 { margin-top: 12px; }
.mb-2 { margin-bottom: 12px; }

/* Custom scrollbar */
.form-container::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.org-dropdown-list::-webkit-scrollbar {
    width: 10px;
}

.form-container::-webkit-scrollbar-track,
.sidebar-nav::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track,
.org-dropdown-list::-webkit-scrollbar-track {
    background: transparent;
}

.form-container::-webkit-scrollbar-thumb,
.sidebar-nav::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.org-dropdown-list::-webkit-scrollbar-thumb {
    background: var(--color-gray-300);
    border-radius: 5px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.form-container::-webkit-scrollbar-thumb:hover,
.sidebar-nav::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover,
.org-dropdown-list::-webkit-scrollbar-thumb:hover {
    background: var(--color-gray-400);
    background-clip: padding-box;
    border: 2px solid transparent;
}
