/* Terminia — Brand CSS */

:root {
    --primary: #0F6E56;
    --primary-light: #E1F5EE;
    --primary-dark: #085041;
    --bg: #F1EFE8;
    --text: #2C2C2A;
    --muted: #5F5E5A;
    --border: #D3D1C7;
    --accent: #EF9F27;
    --card-bg: #E8E6DF;
    --danger: #A32D2D;
    --danger-light: #FCEBEB;
    --info: #185FA5;
    --info-light: #E6F1FB;
    --white: #FFFFFF;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
}

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

/* Logo — koristi se svuda */
.terminia-logo .t { color: var(--primary); }
.terminia-logo .nodot { display: inline-block; position: relative; }
.terminia-logo .clock-dot { position: absolute; left: 50%; transform: translateX(-50%); top: 0.28em; width: 0.23em; height: 0.23em; }
.terminia-logo .dot-cover { position: absolute; left: 50%; transform: translateX(-50%); top: 0.12em; width: 0.30em; height: 0.30em; border-radius: 50%; }
/* Ispod 24px sat je premali — sakrij ga, prikaži obično "i" */
.terminia-logo.logo-sm .clock-dot,
.terminia-logo.logo-sm .dot-cover,
.terminia-logo.logo-sm .nodot { display: none; }
.terminia-logo.logo-sm .nodot-fallback { display: inline; }
/* Pozadina dot-cover se podešava po kontekstu */
.login-logo .dot-cover { background: var(--white); }
.sidebar-logo .dot-cover { background: var(--text); }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: var(--text);
    color: var(--white);
    padding: 1.5rem 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-logo {
    padding: 0 1.5rem 1.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: rgba(255,255,255,0.85);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 1rem;
}

.sidebar-nav { flex: 1; overflow-y: auto; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.5rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.15s;
    font-size: 0.875rem;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    color: var(--white);
    background: rgba(255,255,255,0.1);
}

/* Sidebar grupe */
.sidebar-group-label {
    padding: 0.875rem 1.5rem 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.35);
}

.sidebar-group-label:first-child {
    padding-top: 0.5rem;
}

/* Sklopljiva podešavanja */
.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.875rem 1.5rem 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.35);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.sidebar-toggle:hover {
    color: rgba(255,255,255,0.5);
}

.sidebar-toggle-arrow {
    font-size: 0.625rem;
    transition: transform 0.2s;
}

.sidebar-toggle.open .sidebar-toggle-arrow {
    transform: rotate(180deg);
}

.sidebar-collapsible {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}

.sidebar-collapsible.open {
    max-height: 300px;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: var(--bg);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--muted);
}

.content {
    flex: 1;
    padding: 2rem;
}

/* Login */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}

.login-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
}

.login-logo {
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    color: var(--text);
    background: var(--white);
    transition: border-color 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}

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

.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
    background: var(--card-bg);
    color: var(--text);
}

.btn-secondary:hover { background: var(--border); }

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

.btn-danger:hover { background: #8a2424; }

.btn-ghost {
    background: transparent;
    color: var(--muted);
}

.btn-ghost:hover { background: var(--card-bg); }

.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.btn-block { width: 100%; }

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--muted);
}

/* Table */
.table-wrapper {
    overflow-x: auto;
}

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

th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border);
}

td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
}

tr:hover { background: rgba(0,0,0,0.02); }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-active { background: var(--primary-light); color: var(--primary-dark); }
.badge-inactive { background: var(--card-bg); color: var(--muted); }
.badge-suspended { background: var(--danger-light); color: var(--danger); }
.badge-school { background: var(--primary-light); color: var(--primary-dark); }
.badge-gym { background: var(--info-light); color: var(--info); }
.badge-studio { background: #FEF3E2; color: #B8730A; }
.badge-other { background: var(--card-bg); color: var(--muted); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-pending { background: #FEF3E2; color: #B8730A; }

/* Alerts */
.alert {
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
}

.alert-error { background: var(--danger-light); color: var(--danger); }
.alert-danger { background: var(--danger-light); color: var(--danger); }
.alert-success { background: var(--primary-light); color: var(--primary-dark); }
.alert-info { background: var(--info-light); color: var(--info); }

/* Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
    padding: 2rem;
    width: 100%;
    max-width: 500px;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Utility */
.text-muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* Help panel */
.help-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--muted);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    flex-shrink: 0;
}

.help-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.help-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.help-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.help-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    max-width: 90vw;
    height: 100vh;
    background: var(--white);
    z-index: 201;
    box-shadow: -4px 0 24px rgba(0,0,0,0.12);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.help-panel.open {
    transform: translateX(0);
}

.help-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.help-panel-header h3 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.help-panel-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.help-panel-close:hover { color: var(--text); }

.help-panel-body {
    padding: 1.5rem;
    flex: 1;
}

.help-panel-body h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.help-panel-body p {
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.help-panel-body ul {
    list-style: none;
    padding: 0;
    margin-bottom: 1.25rem;
}

.help-panel-body ul li {
    font-size: 0.875rem;
    color: var(--text);
    padding: 0.5rem 0;
    padding-left: 1.25rem;
    position: relative;
    line-height: 1.5;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.help-panel-body ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.875rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
}

.help-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.help-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.help-tip {
    background: var(--primary-light);
    border-radius: var(--radius);
    padding: 0.875rem 1rem;
    font-size: 0.8125rem;
    color: var(--primary-dark);
    line-height: 1.5;
}

.help-tip strong {
    display: block;
    margin-bottom: 0.25rem;
}

/* Feedback bar — vidljiv na dnu svake stranice */
.feedback-bar {
    margin-top: 2.5rem;
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
}

.feedback-bar-prompt {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    background: var(--primary-light);
    border: 1px solid rgba(15, 110, 86, 0.15);
    border-radius: var(--radius);
    color: var(--primary-dark);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s;
}

.feedback-bar-prompt:hover {
    background: #d0ede3;
    border-color: rgba(15, 110, 86, 0.3);
}

.feedback-bar-icon {
    font-size: 1.125rem;
}

.feedback-bar-form {
    padding: 1rem 0;
}

/* Kanban Board */
.kanban-board {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.kanban-column {
    flex-shrink: 0;
    width: 220px;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--white);
    border-top: 4px solid var(--border);
    min-height: 200px;
    transition: box-shadow 0.15s;
}

.kanban-col-OPEN { border-top-color: #9ca3af; }
.kanban-col-IN_REVIEW { border-top-color: #eab308; }
.kanban-col-PLANNED { border-top-color: #6366f1; }
.kanban-col-IN_PROGRESS { border-top-color: #3b82f6; }
.kanban-col-DONE { border-top-color: #22c55e; }
.kanban-col-REJECTED { border-top-color: #ef4444; }
.kanban-col-DEFERRED { border-top-color: #f97316; }

.kanban-column.drag-over {
    box-shadow: 0 0 0 2px var(--primary), 0 4px 12px rgba(15,110,86,0.15);
}

.kanban-column-header {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.kanban-column-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text);
}

.kanban-column-count {
    font-size: 0.6875rem;
    background: var(--card-bg);
    padding: 1px 8px;
    border-radius: 100px;
    color: var(--muted);
    font-weight: 500;
}

.kanban-column-body {
    flex: 1;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    max-height: 60vh;
}

.kanban-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    cursor: grab;
    transition: box-shadow 0.1s;
}

.kanban-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.kanban-card:active {
    cursor: grabbing;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

/* ─── Mobile hamburger ─── */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
    padding: 4px;
    line-height: 1;
}

/* ─── AI Chat ─── */
.ai-chat-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 100;
    transition: transform 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-chat-btn:hover { transform: scale(1.05); }
.ai-chat-btn.open { background: var(--muted); }

.ai-chat-panel {
    position: fixed;
    bottom: 82px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 480px;
    max-height: calc(100vh - 120px);
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    z-index: 101;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
}

.ai-chat-panel.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.ai-chat-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-chat-header h4 {
    margin: 0;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-chat-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--muted);
    padding: 0 4px;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-msg {
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    max-width: 85%;
    word-wrap: break-word;
}

.ai-msg-user {
    background: var(--primary);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.ai-msg-assistant {
    background: var(--card-bg);
    color: var(--text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.ai-chat-typing {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 4px 16px 8px;
    font-size: 12px;
    color: var(--muted);
}

.ai-typing-dots span {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--muted);
    animation: aiDot 1.2s infinite;
}
.ai-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes aiDot { 0%,80%,100%{opacity:0.3} 40%{opacity:1} }

.ai-chat-input-wrap {
    padding: 10px 12px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
}

.ai-chat-input-wrap input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
}

.ai-chat-input-wrap input:focus {
    border-color: var(--primary);
}

.ai-chat-input-wrap button {
    padding: 8px 14px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}

.ai-chat-input-wrap button:disabled {
    opacity: 0.5;
}

/* Sakrij AI chat na mobilnom (trenerski UI) */
@media (max-width: 768px) {
    .ai-chat-btn, .ai-chat-panel { display: none !important; }
}

/* ─── Wizard (multi-step forme) ─── */
.wizard-header {
    margin-bottom: 1.5rem;
}

.wizard-progress {
    background: var(--border);
    border-radius: 4px;
    height: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.wizard-progress-bar {
    background: var(--primary);
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.wizard-steps-indicator {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.wizard-step-dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.wizard-dot-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    background: var(--card-bg);
    color: var(--muted);
    border: 2px solid var(--border);
    transition: all 0.2s;
}

.wizard-step-dot.active .wizard-dot-num {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.wizard-step-dot.done .wizard-dot-num {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.wizard-dot-label {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
}

.wizard-step-dot.active .wizard-dot-label {
    color: var(--primary);
    font-weight: 600;
}

.wizard-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.wizard-step-info {
    flex: 1;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--muted);
}

.input-error {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 2px rgba(163, 45, 45, 0.15);
}

@media (max-width: 768px) {
    .wizard-steps-indicator {
        gap: 0.75rem;
    }
    .wizard-dot-label {
        display: none;
    }
}

/* ─── Kontekstualni hint ─── */
.context-hint {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--primary-light);
    border: 1px solid #b8e0d1;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.8125rem;
}

.context-hint-icon {
    font-size: 1.125rem;
    flex-shrink: 0;
}

.context-hint-text {
    flex: 1;
    color: var(--primary-dark);
}

.context-hint .btn {
    flex-shrink: 0;
    font-size: 0.75rem;
}

/* ─── Empty states ─── */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

.empty-state-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.375rem;
}

.empty-state-desc {
    font-size: 0.8125rem;
    color: var(--muted);
    margin-bottom: 1.25rem;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.empty-state .btn {
    font-size: 0.875rem;
}

/* ─── Responsive — mobilni telefoni ─── */
@media (max-width: 768px) {
    .layout {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        z-index: 300;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

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

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 299;
    }

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

    .mobile-toggle {
        display: block;
    }

    .main-content {
        width: 100%;
    }

    .topbar {
        padding: 0.75rem 1rem;
    }

    .topbar-title {
        font-size: 1rem;
    }

    .content {
        padding: 1rem;
    }

    /* Stat kartice — 2 kolone na mobilnom */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .stat-card {
        padding: 0.875rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    /* Kartice članova — jedna kolona */
    .card {
        padding: 1rem;
    }

    /* Tabele — horizontalni scroll */
    table {
        font-size: 0.8125rem;
    }

    th, td {
        padding: 0.625rem 0.5rem;
    }

    /* Help panel */
    .help-panel {
        width: 100%;
        max-width: 100vw;
    }

    /* Modal */
    .modal {
        max-width: calc(100vw - 2rem);
        margin: 1rem;
    }

    /* Login — full width */
    .login-card {
        max-width: calc(100vw - 2rem);
        padding: 1.5rem;
    }

    /* Kanban na mobilnom */
    .kanban-column {
        width: 180px;
    }

    /* Buttons — veći touch target */
    .btn {
        min-height: 44px;
        padding: 0.75rem 1.25rem;
    }

    .btn-sm {
        min-height: 36px;
    }

    /* Feedback bar */
    .feedback-bar-prompt {
        font-size: 0.8125rem;
        padding: 0.75rem 1rem;
    }
}

    /* Forme na mobilnom */
    .form-group {
        margin-bottom: 1rem;
    }

    .form-control, input, select, textarea {
        font-size: 16px !important; /* Sprečava iOS zoom */
    }

    /* Member detail — stack vertikalno */
    .card > div[style*="display:flex"][style*="gap:1.5rem"] {
        flex-direction: column;
        gap: 1rem !important;
    }

    /* Sidebar linkovi — veći touch */
    .sidebar-nav a {
        padding: 0.875rem 1.5rem;
        font-size: 0.9375rem;
    }

    /* Sidebar grupe na mobilnom */
    .sidebar-group-label {
        padding: 1rem 1.5rem 0.25rem;
        font-size: 0.75rem;
    }

    .sidebar-toggle {
        padding: 1rem 1.5rem 0.25rem;
        font-size: 0.75rem;
    }

    /* Sidebar close na klik bilo gde */
    .sidebar-nav a {
        position: relative;
    }

    /* Impersonate bar */
    div[style*="padding:8px 2rem"] {
        padding: 8px 1rem !important;
        font-size: 12px !important;
    }

    /* Alert */
    .alert {
        font-size: 0.8125rem;
        padding: 0.75rem 1rem;
    }
}

/* Jako mali ekrani (< 400px) */
@media (max-width: 400px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
    }

    .topbar {
        padding: 0.5rem 0.75rem;
    }

    .content {
        padding: 0.75rem;
    }

    .btn {
        font-size: 0.8125rem;
        padding: 0.625rem 1rem;
    }
}
