/* Moj organizator - Main Stylesheet */
@import url('fonts.css');

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #60a5fa 100%);
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

/* Animated background pattern */
.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: backgroundMove 20s ease-in-out infinite;
}

@keyframes backgroundMove {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-20px, -20px); }
}

.login-box {
    background: white;
    padding: 3rem 2.5rem;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    animation: slideIn 0.5s ease-out;
}
@media (min-width: 768px) {
    .login-box {
        max-width: 520px;
    }
}
@media (min-width: 1200px) {
    .login-box {
        max-width: 560px;
    }
}

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

.login-box h1 {
    text-align: center;
    color: #1e40af;
    margin-bottom: 0.5rem;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.login-box .subtitle {
    text-align: center;
    color: #6b7280;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #3b82f6;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: #f9fafb;
}

.form-group input:hover {
    border-color: #2563eb;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: #1d4ed8;
    background: white;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

.form-group input::placeholder {
    color: #9ca3af;
}

.error-message {
    color: #dc2626;
    background: #fef2f2;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid #fecaca;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    animation: shake 0.5s ease-in-out;
}

.error-message::before {
    content: '';
    display: inline-block;
    width: 1.2rem;
    height: 1.2rem;
    flex-shrink: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    margin-right: 0.5rem;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes navbar-overlay-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes navbar-item-in {
    from {
        opacity: 0;
        transform: translateX(-16px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.success-message {
    color: #059669;
    background: #d1fae5;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid #a7f3d0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.success-message::before {
    content: '✓';
    font-size: 1.2rem;
    flex-shrink: 0;
    background: #10b981;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    line-height: 1;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    right: 1.5rem;
    top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 9999;
    max-width: min(420px, calc(100vw - 2rem));
}

.toast {
    background: #0f172a;
    color: #f8fafc;
    padding: 0.9rem 1rem;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.25);
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.75rem;
    border-left: 4px solid #38bdf8;
    animation: toastSlideIn 0.25s ease-out;
}

.toast-message {
    font-size: 0.95rem;
    line-height: 1.4;
}

.toast-close {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
    padding: 0 0.25rem;
}

.toast-close:hover {
    opacity: 1;
}

.toast-success {
    border-left-color: #22c55e;
}

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

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

.toast-info {
    border-left-color: #38bdf8;
}

.toast-hide {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

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

/* Dialog / Modal (zamenjuje alert) */
.dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.dialog-overlay.dialog-visible {
    opacity: 1;
}

.dialog-overlay.dialog-hide {
    opacity: 0;
}

.dialog-box {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.5rem 1.75rem;
    max-width: 420px;
    width: 100%;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.dialog-visible .dialog-box {
    transform: scale(1);
}

.dialog-hide .dialog-box {
    transform: scale(0.95);
}

.dialog-title {
    margin: 0 0 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}

.dialog-message {
    margin: 0 0 1.5rem;
    white-space: pre-wrap;
    font-size: 1rem;
    line-height: 1.6;
    color: #475569;
    white-space: pre-wrap;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.dialog-ok {
    min-width: 100px;
}

.dialog-actions-confirm .dialog-cancel,
.dialog-actions-confirm .dialog-confirm {
    min-width: 100px;
}

.dialog-error .dialog-title {
    color: #dc2626;
}

.dialog-warning .dialog-title {
    color: #d97706;
}

.dialog-success .dialog-title {
    color: #059669;
}

/* Highlight added list rows */
.soft-list-item {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #3b82f6;
    border-radius: 8px;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.soft-list-item:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.hidden {
    display: none;
}

/* Container for dashboard pages */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.25rem;
}

/* Nakon logovanja - širi layout za maksimalno iskorišćenje ekrana */
body:has(.navbar) .container {
    max-width: 94vw;
    width: 100%;
    padding: 1rem 1.25rem;
    box-sizing: border-box;
}

body:has(.navbar) .navbar-container {
    max-width: 94vw;
}

body:has(.navbar) .user-hall-header-content {
    max-width: 94vw;
}

/* Ensure canvas container has full width for user role */
.role-user .page-content,
.role-user .dashboard-content,
.role-user .canvas-container {
    width: 100% !important;
    max-width: 100% !important;
}

/* Dashboard styles */
.page-content,
.dashboard-content {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: 0.75rem;
}

.page-content h2,
.dashboard-content h2 {
    color: #1e40af;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.page-content p,
.dashboard-content p {
    color: #6b7280;
    line-height: 1.6;
}

/* Card actions wrap - dugmad 100% širine */
.card-actions-wrap .card-actions,
.owner-dashboard-cards .owner-dashboard-card-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Breadcrumbs */
.breadcrumbs {
    margin-bottom: 0.5rem;
}
.breadcrumbs-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.9rem;
    color: #64748b;
}
.breadcrumbs-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.breadcrumbs-item:not(.breadcrumbs-item-current)::after {
    content: '›';
    margin-left: 0.35rem;
    color: #94a3b8;
    font-weight: 600;
}
.breadcrumbs-item-current::after {
    display: none;
}
.breadcrumbs-link {
    color: #64748b;
    text-decoration: none;
}
.breadcrumbs-link:hover {
    color: #1e40af;
}
.breadcrumbs-current {
    color: #1e40af;
    font-weight: 600;
}

.page-back-link {
    color: #64748b;
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 0.5rem;
}
.page-back-link:hover {
    color: #1e40af;
}

/* Breadcrumbs */
.breadcrumbs {
    margin-bottom: 0.5rem;
}
.breadcrumbs-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.9rem;
    color: #64748b;
    gap: 0.25rem;
}
.breadcrumbs-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.breadcrumbs-link {
    color: #64748b;
    text-decoration: none;
}
.breadcrumbs-link:hover {
    color: #1e40af;
}
.breadcrumbs-current {
    color: #1e40af;
    font-weight: 600;
}
.breadcrumbs-sep {
    color: #94a3b8;
    user-select: none;
}

.page-header,
.dashboard-header {
    margin-bottom: 0.875rem;
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* page-header sa naslovom + akcije u jednom redu (users, halls, employees) */
.page-header.page-header-flex,
.dashboard-header.dashboard-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Red: podnaslov + dugmad (documents, owners) */
.page-header-flex,
.dashboard-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.page-header-actions,
.dashboard-header-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.page-header .page-header-actions,
.dashboard-header .dashboard-header-actions {
    margin-top: 1rem;
}

.page-header-content,
.dashboard-header-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.page-header h1,
.dashboard-header h1 {
    color: #1e40af;
    margin-bottom: 0.2rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.page-subtitle,
.dashboard-subtitle {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0.35rem 0 0 0;
}

.page-header .btn.btn-auto,
.page-header-flex .btn.btn-auto,
.page-header-actions .btn.btn-auto,
.dashboard-header .btn.btn-auto,
.dashboard-header-flex .btn.btn-auto,
.dashboard-header-actions .btn.btn-auto {
    white-space: nowrap;
}


.page-subtitle strong,
.dashboard-subtitle strong {
    color: #1e40af;
    font-weight: 600;
}

.page-header-instructions,
.dashboard-header-instructions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.instruction-card {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #f0f9ff;
    border-left: 4px solid #3b82f6;
    border-radius: 8px;
    flex: 1;
    min-width: 250px;
}

.instruction-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.instruction-text {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #374151;
}

.instruction-text strong {
    color: #1e40af;
    font-weight: 600;
}

@media (max-width: 828px) {
    .page-header,
    .dashboard-header {
        padding: 0.625rem 0.875rem;
    }
    
    .page-header-instructions,
    .dashboard-header-instructions {
        flex-direction: column;
    }
    
    .instruction-card {
        min-width: 100%;
    }
}

/* Form Styles */
.form-container,
.owner-form {
    width: 100%;
}

#ownerStatus.status-inactive {
    border-color: #dc2626;
    background-color: #fef2f2;
}

#ownerStatus.status-inactive:focus {
    border-color: #b91c1c;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

#userStatus.user-status-inactive {
    border-color: #dc2626;
    background-color: #fef2f2;
}

#userStatus.user-status-inactive:focus {
    border-color: #b91c1c;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
    font-size: 0.95rem;
}

/* Jedinstvene klase za form kontrole - savršeni inputi */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    min-height: 44px;
    border: 2px solid #3b82f6;
    border-radius: 6px;
    font-size: 1rem;
    line-height: 1.5;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #fff;
    font-family: inherit;
    color: #0f172a;
    box-sizing: border-box;
}

.form-input:disabled {
    background: #f8fafc;
    color: #64748b;
    cursor: not-allowed;
    border-color: #e2e8f0;
}

.form-input[readonly] {
    background: #f8fafc;
    color: #64748b;
    cursor: text;
    border-color: #e2e8f0;
}

.date-input[readonly] {
    cursor: pointer;
}

.form-input.is-invalid,
.form-input[aria-invalid="true"] {
    border-color: #dc2626;
    background: #fef2f2;
}

.form-input.is-invalid:focus,
.form-input[aria-invalid="true"]:focus {
    border-color: #b91c1c;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

/* form-select - native dropdown (koristiti uz form-input) */
.form-select {
    min-height: 44px;
    cursor: pointer;
    appearance: auto;
}

/* form-autocomplete - searchable dropdown (data-autocomplete), JS generiše .custom-select */
.form-autocomplete {
    /* Stilovi u filter-inputs.css */
}

.form-input:hover {
    border-color: #2563eb;
}

select.form-input,
.form-group select,
select {
    text-align: left;
}
select option {
    text-align: left;
}

.form-input:focus {
    outline: none;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.form-input::placeholder {
    color: #94a3b8;
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
    padding: 0.75rem 1rem;
}

/* Način plaćanja - radio opcije (single-event, onetime request) */
.payment-method-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.payment-option:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.payment-option:has(input:checked) {
    border-color: #3b82f6;
    background: #eff6ff;
}

.payment-option input[type="radio"] {
    width: 1.1rem;
    height: 1.1rem;
    margin: 0;
    accent-color: #3b82f6;
    flex-shrink: 0;
    outline: none;
    box-shadow: none;
}
.payment-option input[type="radio"]:focus {
    outline: none;
    box-shadow: none;
}

.payment-option span {
    font-size: 0.95rem;
    color: #334155;
    line-height: 1.4;
}

.payment-method-hint {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}

.payment-option-recommended {
    border-color: #3b82f6 !important;
    background: #eff6ff !important;
}

.payment-option-recommended:hover {
    border-color: #2563eb !important;
    background: #dbeafe !important;
}

/* Kompaktni input za tabele (inline edit) */
.form-input-inline {
    width: 100%;
    padding: 0.5rem 0.75rem;
    min-height: 36px;
    border: 2px solid #3b82f6;
    border-radius: 6px;
    font-size: 0.95rem;
    line-height: 1.5;
    background: #fff;
    font-family: inherit;
    color: #0f172a;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input-inline:focus {
    outline: none;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.form-input-inline::placeholder {
    color: #94a3b8;
}

/* Date input component */
.date-input {
    min-height: 44px;
    padding-right: 2.25rem;
    background-color: #ffffff;
    border: 2px solid #3b82f6;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #0f172a;
}

.date-input:focus {
    outline: none;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.date-input::-webkit-calendar-picker-indicator {
    opacity: 0.7;
    cursor: pointer;
    padding-left: 0.35rem;
}

.date-input:disabled {
    background: #f8fafc;
    color: #94a3b8;
    cursor: not-allowed;
}

.form-hint {
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

/* Password validation rules list */
.password-rules {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
}

.password-rules li {
    padding: 0.25rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.password-rules li::before {
    content: '✗';
    position: absolute;
    left: 0;
    color: #dc2626;
    font-weight: 700;
}

.password-rules li.valid {
    color: #16a34a;
}

.password-rules li.valid::before {
    content: '✓';
    color: #16a34a;
}

.password-rules li.invalid {
    color: #dc2626;
    font-weight: 500;
}

/* Password input with show/hide toggle */
.password-input-wrapper {
    position: relative;
    display: block;
    width: 100%;
}

.password-input-wrapper .form-input,
.password-input-wrapper input[type="password"],
.password-input-wrapper input[type="text"] {
    padding-right: 2.75rem;
}

.password-toggle-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.35rem;
    cursor: pointer;
    color: #64748b;
    font-size: 1.1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.2s;
}

.password-toggle-btn:hover {
    color: #1e293b;
}

.password-toggle-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.loading {
    color: #6b7280;
    font-size: 1rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #999;
}

.empty-state h3 {
    margin: 0 0 0.5rem 0;
    color: #666;
    font-size: 1.25rem;
}

.empty-state p {
    margin: 0;
    color: #999;
    font-size: 0.95rem;
}

/* Owner Meni page - refined layout */
.owner-menus-page .page-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e40af;
}
.owner-menus-page .page-subtitle {
    color: #64748b;
    font-size: 0.95rem;
    margin-top: 0.35rem;
}
.owner-menus-page .filter-sort-section {
    margin-bottom: 1.25rem;
}
.owner-menus-page .empty-state {
    padding: 4rem 2rem;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}
.owner-menus-page .empty-state h3 {
    color: #334155;
    font-size: 1.25rem;
    font-weight: 600;
}
.owner-menus-page .empty-state p {
    color: #64748b;
}

/* Navigation Bar - ispod svih dijaloga (overlay 1050, modali 1051+) */
.navbar {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 50%, #1e40af 100%);
    color: white;
    padding: 0;
    box-shadow: 0 4px 20px rgba(30, 64, 175, 0.35), 0 1px 3px rgba(0, 0, 0, 0.12);
    position: sticky;
    top: 0;
    z-index: 100;
    overflow: visible;
    width: 100%;
    min-width: 100%;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.navbar.menu-open {
    overflow: visible;
}

.navbar-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 0.5rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-sizing: border-box;
}

.navbar-header {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    min-width: 0;
}

.navbar-brand {
    display: flex;
    align-items: center;
    min-width: 0;
}

.navbar-toggle {
    display: none;
    flex-direction: column;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    gap: 4px;
    z-index: 110;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55),
                background 0.25s ease;
}
@media (min-width: 993px) {
    .navbar-toggle {
        display: none !important;
    }
}

.navbar-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transform-origin: center center;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55),
                opacity 0.3s ease,
                background 0.2s ease;
}

.navbar-toggle span:nth-child(1) {
    transform-origin: left center;
}

.navbar-toggle span:nth-child(3) {
    transform-origin: left center;
}

.navbar-toggle:hover span {
    background: rgba(255, 255, 255, 0.9);
}

.navbar-logo {
    color: white;
    text-decoration: none;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    transition: opacity 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.navbar-logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 4px;
    border-radius: 8px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.navbar-logo-img {
    width: 28px;
    height: 28px;
    min-width: 24px;
    min-height: 24px;
    object-fit: contain;
    border-radius: 6px;
    flex-shrink: 0;
}

.navbar-logo:hover {
    opacity: 0.8;
}

.navbar-menu,
.navbar-user-links {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
    justify-content: center;
    transition: all 0.3s ease;
}

/* Razmak između stavki */
.navbar-menu > * + * {
    margin-left: 0.5rem;
    padding-left: 0.5rem;
}
/* Separator samo između linkova (ne između dugmadi - dropdown toggle, Odjavi se) */
.navbar-menu > a.navbar-link + a.navbar-link {
    border-left: 1px solid rgba(255, 255, 255, 0.3);
}

.navbar-link-icon {
    width: 1.1em;
    height: 1.1em;
    vertical-align: -0.15em;
    margin-right: 0.35rem;
}

.navbar-link {
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.navbar-link:hover {
    background: rgba(255, 255, 255, 0.14);
    color: white;
}

.navbar-link.active {
    background: rgba(255, 255, 255, 0.22);
    color: white;
    font-weight: 600;
}

/* Navbar dropdown (owner menu groups) */
.navbar-dropdown {
    position: relative;
}
.navbar-dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    transition: background 0.2s ease;
}
.navbar-dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.14);
}
.navbar-dropdown.active > .navbar-dropdown-toggle {
    background: rgba(255, 255, 255, 0.22);
    font-weight: 600;
}
.navbar-dropdown-arrow {
    font-size: 0.6em;
    opacity: 0.8;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.navbar-dropdown.open .navbar-dropdown-arrow {
    transform: rotate(180deg);
}
.navbar-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: rgba(30, 58, 138, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    padding: 0.4rem 0;
    margin-top: 0.35rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s linear 0.25s;
    z-index: 110;
}
.navbar-dropdown:hover .navbar-dropdown-menu,
.navbar-dropdown.open .navbar-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s linear 0s;
}
.navbar-dropdown-link {
    display: block;
    padding: 0.55rem 1.1rem;
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: background 0.18s ease;
    margin: 0 0.25rem;
    border-radius: 6px;
}
.navbar-dropdown-link:hover {
    background: rgba(255, 255, 255, 0.18);
}
.navbar-dropdown-link.active {
    background: rgba(255, 255, 255, 0.25);
    font-weight: 600;
}
.navbar-dropdown-divider {
    padding: 0.5rem 1.1rem 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin-top: 0.25rem;
}
.navbar-dropdown-divider:first-child {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

.navbar-menu-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 1.25rem;
}

/* When there's no menu (user role), push logout to the right */
.navbar-menu-wrapper.user-navbar {
    justify-content: flex-end;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
    margin-left: auto;
}

.navbar-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.navbar-user-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: white;
}

.navbar-user-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Navbar - show mobile menu on tablets and smaller */
@media (max-width: 1052px) {
    /* Zaključaj scroll kad je meni otvoren */
    body:has(.navbar.menu-open) {
        overflow: hidden;
        touch-action: none;
    }
    /* Z-index: overlay < menu < header (X dugme uvek klikabilno) */
    .navbar.menu-open {
        z-index: 1002;
    }
    .navbar.menu-open .navbar-header {
        position: relative;
        z-index: 1003;
    }

    .navbar-container {
        position: relative;
        flex-wrap: wrap;
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    
    .navbar-header {
        width: 100%;
        flex: 1 1 100%;
        justify-content: space-between;
    }
    
    .navbar-toggle {
        display: flex;
        flex-shrink: 0;
        border-radius: 12px;
    }
    .navbar-toggle:active {
        transform: scale(0.94);
    }
    /* Rotacija celog ikona kad se otvori - X postaje + (90°) */
    .navbar-toggle.active {
        background: rgba(255, 255, 255, 0.12);
        transform: rotate(90deg);
    }
    .navbar-toggle.active:active {
        transform: rotate(90deg) scale(0.94);
    }
    
    /* Hamburger → X: elastic morph (cubic-bezier za blagi overshoot) */
    .navbar-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .navbar-toggle.active span:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }
    
    .navbar-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
    
    /* Full-screen overlay sa blur efektom */
    .navbar.menu-open::before {
        content: '';
        position: fixed;
        inset: 0;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.5);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        z-index: 1000;
        opacity: 0;
        animation: navbar-overlay-in 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
        pointer-events: auto;
    }
    
    .navbar-menu-wrapper {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: auto;
        width: 100%;
        min-width: 100%;
        margin-left: 0;
        background: linear-gradient(180deg, #1e40af 0%, #1d4ed8 50%, #2563eb 100%);
        flex-direction: column;
        padding: calc(60px + env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(2rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
        padding-top: calc(70px + env(safe-area-inset-top));
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
        gap: 0.5rem;
        box-sizing: border-box;
        z-index: 1002;
        max-height: 100vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px);
        pointer-events: none;
        transition: opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                    visibility 0s linear 0.4s;
    }
    
    .navbar-menu-wrapper.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
        transition: opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                    visibility 0s linear 0s;
    }
    
    .navbar-menu {
        flex-direction: column;
        width: 100%;
        gap: 0.25rem;
        justify-content: flex-start;
        flex: 0 0 auto;
    }
    /* Staggered slide-in animacija za stavke menija */
    .navbar-menu-wrapper.active .navbar-menu > * {
        animation: navbar-item-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
        opacity: 0;
    }
    .navbar-menu-wrapper.active .navbar-menu > *:nth-child(1) { animation-delay: 0.05s; }
    .navbar-menu-wrapper.active .navbar-menu > *:nth-child(2) { animation-delay: 0.1s; }
    .navbar-menu-wrapper.active .navbar-menu > *:nth-child(3) { animation-delay: 0.15s; }
    .navbar-menu-wrapper.active .navbar-menu > *:nth-child(4) { animation-delay: 0.2s; }
    .navbar-menu-wrapper.active .navbar-menu > *:nth-child(5) { animation-delay: 0.25s; }
    .navbar-menu-wrapper.active .navbar-menu > *:nth-child(6) { animation-delay: 0.3s; }
    .navbar-menu-wrapper.active .navbar-menu > *:nth-child(7) { animation-delay: 0.35s; }
    .navbar-menu-wrapper.active .navbar-menu > *:nth-child(8) { animation-delay: 0.4s; }
    .navbar-menu-wrapper.active .navbar-menu > *:nth-child(9) { animation-delay: 0.45s; }
    .navbar-menu-wrapper.active .navbar-menu > *:nth-child(10) { animation-delay: 0.5s; }
    .navbar-menu-wrapper.active .navbar-user,
    .navbar-menu-wrapper.active .navbar-user-links > * {
        animation: navbar-item-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.35s forwards;
        opacity: 0;
    }
    /* Mobile: razmak između stavki */
    .navbar-menu > * + * {
        margin-left: 0;
        margin-top: 0.25rem;
        padding-left: 0;
        padding-top: 0.5rem;
    }
    /* Mobile: separator samo između linkova (ne između dugmadi) */
    .navbar-menu > a.navbar-link + a.navbar-link {
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .navbar-link {
        width: 100%;
        padding: 0.85rem 1.15rem;
        text-align: left;
        border-radius: 12px;
        font-size: 1rem;
        transition: background 0.2s ease, transform 0.15s ease;
    }
    .navbar-link:active {
        transform: scale(0.98);
    }
    
    .navbar-link:hover {
        background: rgba(255, 255, 255, 0.15);
    }

    /* Mobile: dropdown as accordion */
    .navbar-dropdown {
        width: 100%;
    }
    .navbar-dropdown-toggle {
        width: 100%;
        justify-content: space-between;
        padding: 0.85rem 1.15rem;
        text-align: left;
        border-radius: 12px;
        transition: background 0.2s ease, transform 0.15s ease;
    }
    .navbar-dropdown-toggle:active {
        transform: scale(0.98);
    }
    .navbar-dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: rgba(0, 0, 0, 0.15);
        margin: 0.25rem 0 0 0.5rem;
        padding: 0.25rem 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .navbar-dropdown.open .navbar-dropdown-menu {
        max-height: 300px;
    }
    .navbar-dropdown-link {
        padding: 0.7rem 1.15rem;
        border-radius: 10px;
        margin: 0 0.35rem;
        transition: background 0.2s ease, transform 0.15s ease;
    }
    .navbar-dropdown-link:active {
        transform: scale(0.98);
    }
    
    .navbar-user {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
        padding: 1.25rem 0 0;
        margin-top: 0.75rem;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
    }
    .navbar-user .btn {
        transition: transform 0.15s ease;
    }
    .navbar-user .btn:active {
        transform: scale(0.98);
    }
    
    .navbar-user-info {
        align-items: flex-start;
        width: 100%;
    }
    
}

/* Responsive */
@media (max-width: 828px) {
    .login-box {
        padding: 2rem 1.5rem;
        max-width: 100%;
    }
    
    .login-box h1 {
        font-size: 1.75rem;
    }
    
    .container {
        padding: 1rem;
    }
    
    .page-content,
    .dashboard-content {
        padding: 1rem;
    }
    
    /* Navbar - tighter padding */
    .navbar-container {
        padding: 0.75rem 1rem;
    }
    
    .navbar-menu-wrapper {
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }
    
}

@media (max-width: 540px) {
    .navbar-logo {
        font-size: 1.15rem;
    }
    
    .navbar-logo-wrap { padding: 3px; }
    .navbar-logo-img {
        width: 30px;
        height: 30px;
    }
    
    .navbar-container {
        padding: 0.5rem 0.75rem;
    }
    
    .navbar-link {
        padding: 0.6rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .navbar-menu-wrapper {
        padding: 0.75rem;
    }
}

@media (max-width: 420px) {
    .navbar-logo {
        font-size: 1rem;
        white-space: normal;
        line-height: 1.2;
    }
    
    .navbar-logo-wrap { padding: 2px; }
    .navbar-logo-img {
        width: 28px;
        height: 28px;
    }
    
    .navbar-container {
        padding: 0.5rem 0.5rem;
    }
    
    .navbar-user-name {
        font-size: 0.875rem;
    }
    
    .navbar-user-role {
        font-size: 0.75rem;
    }
    
}

/* ========================================
   TABLES - Data table styles
   ======================================== */

/* Table container for responsive scrolling */
.table-container {
    overflow-x: auto;
    margin: 1.5em 0;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    padding: 0;
}

/* Data Table - Unified table style for all tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    margin: 1em 0;
    table-layout: auto;
    display: table;
}

.data-table thead {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
    display: table-header-group;
}

.data-table thead th {
    padding: 1.2em 1.25em;
    text-align: left;
    font-weight: 600;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    white-space: nowrap;
    color: white;
    background: transparent;
    position: relative;
}

.data-table thead th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.data-table thead th.sortable a {
    color: white;
    text-decoration: none;
    display: block;
    padding: 1.2em 1.25em;
    padding-right: 2em;
    position: relative;
    transition: background-color 0.2s ease;
}

.data-table thead th.sortable:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.data-table thead th.sortable:hover a {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Active sorted column */
.data-table thead th.sortable.sorted {
    background-color: rgba(255, 255, 255, 0.15);
}

.data-table thead th.sortable.sorted a {
    background-color: rgba(255, 255, 255, 0.15);
    font-weight: 700;
}

.data-table thead th.sortable.sorted:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.data-table thead th.sortable.sorted:hover a {
    background-color: rgba(255, 255, 255, 0.2);
}

.data-table thead th.sortable a::after {
    content: ' ↕';
    position: absolute;
    right: 0.5em;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8em;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.data-table thead th.sortable:hover a::after {
    opacity: 1;
}

.data-table thead th:first-child {
    border-top-left-radius: 8px;
}

.data-table thead th:last-child {
    border-top-right-radius: 8px;
}

.data-table tbody {
    display: table-row-group;
    background: white;
}

.data-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
    background: white;
    display: table-row;
}

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

.data-table tbody tr:hover {
    background-color: #f8f9fa;
}

.data-table tbody tr:nth-child(even) {
    background-color: #fafbfc;
}

.data-table tbody tr:nth-child(even):hover {
    background-color: #f1f3f5;
}

.data-table tbody td {
    padding: 1.2em 1.25em;
    color: #333;
    border: none;
    vertical-align: middle;
    font-size: 0.95em;
    display: table-cell;
    background: transparent;
}

.data-table tbody td:first-child {
    font-weight: 600;
    color: #666;
}

.data-table tbody td strong {
    color: #1e40af;
    font-weight: 600;
    font-size: 1em;
}

.data-table .table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.data-table .link-cell a {
    color: #1d4ed8;
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.2s ease;
}

.data-table .link-cell a:hover {
    color: #1e40af;
}

/* TreeTable - expandable rows with child templates */
.data-table.treetable .treetable-col-expand {
    padding: 0.5rem;
    text-align: center;
}

.data-table.treetable .treetable-cell-expand {
    padding: 0.5rem;
    text-align: center;
    vertical-align: middle;
}

.data-table.treetable .treetable-row-child {
    background: #f8fafc;
}

.data-table.treetable .treetable-row-child:hover {
    background: #f1f5f9;
}

.data-table.treetable .treetable-cell-indent {
    padding-left: 2rem;
}

.data-table.treetable .treetable-cell-indent a {
    font-weight: 500;
    color: #64748b;
}

.data-table.treetable .treetable-cell-indent a:hover {
    color: #1e40af;
}

.treetable-default-badge {
    font-size: 0.7rem;
    font-weight: 500;
    color: #059669;
    background: #d1fae5;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    margin-left: 0.5rem;
}

.treetable-no-templates {
    color: #94a3b8;
    font-size: 0.9rem;
}

.treetable-template-count {
    white-space: nowrap;
}

.text-muted {
    color: #64748b;
}

/* Badge variants (status labels) */
.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
}
.badge-secondary { background: #e2e8f0; color: #475569; }
.badge-info { background: #e0f2fe; color: #0369a1; }
.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger { background: #fee2e2; color: #b91c1c; }

/* Responsive table styles */
@media (max-width: 828px) {
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table,
    .table-container .job-table {
        min-width: 600px;
    }
    
    .data-table thead th {
        padding: 0.75em 1em;
        font-size: 0.9em;
    }
    .data-table thead th.sortable a {
        padding: 0.75em 1em;
        padding-right: 1.5em;
    }
    .data-table tbody td {
        padding: 0.75em 1em;
        font-size: 0.9em;
    }
    
    .data-table .btn-action {
        padding: 0.4em 0.8em;
        font-size: 0.85em;
    }
}

/* ========================================
   KPI / Stat kartice - globalne (dashboard, referral, itd.)
   ======================================== */

.kpi-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.kpi-card {
    padding: 1.25rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    min-width: 140px;
}

.kpi-card.kpi-card-success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    min-width: 180px;
}

.kpi-card .kpi-label {
    color: #64748b;
    font-size: 0.875rem;
}

.kpi-card.kpi-card-success .kpi-label {
    color: #047857;
}

.kpi-card .kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.kpi-card.kpi-card-success .kpi-value {
    color: #047857;
}

.form-panel {
    padding: 1.25rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.form-panel .form-group { margin-bottom: 1rem; }
.form-panel .form-group:last-of-type { margin-bottom: 0; }

.form-panel .btn { margin-top: 1rem; }

.form-msg {
    margin-top: 0.75rem;
    font-size: 0.875rem;
}

.form-msg:empty { display: none; }
.form-msg.form-msg-success { color: #047857; }
.form-msg.form-msg-error { color: #dc2626; }

.page-content-max {
    max-width: 500px;
}

.page-content-max-700 {
    max-width: 700px;
}

.form-hint {
    margin: 0.5rem 0 0 0;
    font-size: 0.875rem;
    color: #64748b;
}

.details-item {
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.details-item summary {
    cursor: pointer;
    font-weight: 600;
}

.details-item p {
    margin: 0.75rem 0 0 0;
}

.table-year-row td {
    background: #e2e8f0;
    font-weight: 700;
    padding: 0.75rem;
}

.section-title {
    font-size: 1.125rem;
    margin: 2rem 0 1rem 0;
}

.admin-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #475569;
    margin: 2rem 0 0.75rem 0;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid #e2e8f0;
}

.admin-section-title:first-of-type {
    margin-top: 0;
}

.filter-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-inline label {
    margin: 0;
    font-size: 0.875rem;
    color: #64748b;
}

.filter-inline select {
    min-width: 120px;
}

.copy-input-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.copy-input-row .form-input {
    flex: 1;
    min-width: 200px;
}

.copy-input-row .form-input[readonly] {
    background: #f8fafc;
    cursor: text;
}

.referral-url-block {
    margin-bottom: 1.5rem;
}

.referral-url-block .form-hint {
    margin-top: 0.5rem;
}

.referral-share-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.referral-share-label {
    font-size: 0.875rem;
    color: #64748b;
    margin-right: 0.25rem;
}

.btn-share {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 6px;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.15s;
}

.btn-share:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

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

.btn-share-fb {
    background: #1877f2;
    color: #fff;
}

.btn-share-wa {
    background: #25d366;
    color: #fff;
}

.btn-share-tg {
    background: #0088cc;
    color: #fff;
}

@media (max-width: 540px) {
    .kpi-grid { flex-direction: column; }
    .kpi-card,
    .kpi-card.kpi-card-success { min-width: 0; width: 100%; }
}

/* ========================================
   PAGINATION - Pagination styles
   ======================================== */

.pagination-container {
    margin-top: 1.5rem;
    padding: 1rem 0;
}

.pagination-info {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.75rem;
    text-align: center;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e40af;
    background: white;
    border: 2px solid #3b82f6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.pagination-btn:hover:not(:disabled) {
    background: #3b82f6;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(7, 70, 130, 0.3);
}

.pagination-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(7, 70, 130, 0.2);
}

.pagination-btn:disabled,
.pagination-btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8f9fa;
    border-color: #e9ecef;
    color: #9ca3af;
}

.pagination-page-ellipsis {
    padding: 0 0.25rem;
    color: #9ca3af;
    font-weight: 600;
}

.pagination-pages {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    flex-wrap: wrap;
}

.pagination-page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e40af;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pagination-page-btn:hover {
    background: #f8f9fa;
    border-color: #3b82f6;
    transform: translateY(-1px);
}

.pagination-page-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
    box-shadow: 0 2px 4px rgba(7, 70, 130, 0.3);
}

.pagination-page-btn.active:hover {
    background: #2563eb;
    border-color: #2563eb;
    transform: translateY(-1px);
}

/* Responsive pagination */
@media (max-width: 828px) {
    .pagination-controls {
        gap: 0.25rem;
    }
    
    .pagination-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .pagination-page-btn {
        min-width: 32px;
        height: 32px;
        padding: 0.4rem;
        font-size: 0.8rem;
    }
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 4px 0;
    min-width: 180px;
    z-index: 10001; /* Higher than modal (1000) and overlay (998) */
    font-size: 14px;
    user-select: none;
    pointer-events: auto; /* Ensure context menu can receive clicks */
}

.context-menu-item {
    padding: 10px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.2s;
    color: #333;
}

.context-menu-item:hover {
    background-color: #f0f0f0;
}

.context-menu-item-danger {
    color: #dc3545;
}

.context-menu-item-danger:hover {
    background-color: #fee;
    color: #c82333;
}

.context-menu-item span {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.context-menu-item-label {
    cursor: default;
}

/* Modal & Overlay - iznad navbar-a (100), siva pozadina */
#overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 1050;
    display: none;
}

#gridModal {
    z-index: 1051; /* iznad overlay-a (1050) */
}

#editModal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
    display: none;
    z-index: 1051;
    width: 650px;
    max-width: calc(100vw - 40px);
    max-height: 90vh;
    overflow: hidden;
    box-sizing: border-box;
    animation: modalSlideIn 0.3s ease-out;
}
#editModal.edit-modal-dialog {
    flex-direction: column;
    height: auto;
    max-height: 90vh;
}
@media (max-width: 828px) {
    #editModal {
        max-width: calc(100vw - 2rem);
        max-height: calc(100vh - 2rem);
        width: auto;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

#editModal .modal-header {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 24px 32px;
    border-radius: 16px 16px 0 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

#editModal .modal-header h3 {
    margin: 0;
    font-size: 1.5em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #374151;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.modal-close:active {
    transform: scale(0.98);
}

#editModal .modal-body {
    padding: 32px;
}

#editModal .form-section {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e9ecef;
}

#editModal .form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

#editModal .section-title {
    font-size: 1.1em;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 0.5em;
}

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

#editModal .form-group-modal:last-child {
    margin-bottom: 0;
}

#editModal .form-label-modal {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95em;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.5;
}

#editModal .label-icon {
    font-size: 1.2em;
    opacity: 0.8;
}

#editModal .required-star {
    color: #dc3545;
    font-weight: 700;
    margin-left: 2px;
}

#editModal .form-input-modal {
    width: 100%;
    box-sizing: border-box;
    padding: 0.75rem 1rem;
    min-height: 44px;
    font-size: 1rem;
    border: 2px solid #3b82f6;
    border-radius: 6px;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #fff;
    color: #0f172a;
}

#editModal .form-input-modal:hover {
    border-color: #2563eb;
}

#editModal .form-input-modal:focus {
    outline: none;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

#editModal .form-input-modal:disabled {
    background: #f8fafc;
    color: #64748b;
    cursor: not-allowed;
    border-color: #e2e8f0;
}

#editModal .form-input-modal::placeholder {
    color: #94a3b8;
    opacity: 1;
}

#editModal .form-color-input {
    width: 100%;
    height: 50px;
    padding: 4px;
    border: 2px solid #3b82f6;
    border-radius: 8px;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.2s ease;
    background: #fafafa;
}

#editModal .form-color-input:hover {
    border-color: #2563eb;
    background: #fff;
}

#editModal .form-color-input:focus {
    outline: none;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

#editModal .color-input-wrapper {
    width: 100%;
}

#editModal .table-color-palette {
    margin-top: 0.75rem;
}

#editModal .table-color-palette .palette-label {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

#editModal .table-color-palette .palette-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

#editModal .table-color-palette .palette-swatch {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#editModal .table-color-palette .palette-swatch:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#editModal .table-color-palette .palette-swatch:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

#editModal .form-hint-modal {
    display: block;
    margin-top: 6px;
    color: #666;
    font-size: 0.875em;
    line-height: 1.5;
    font-style: italic;
}

#editModal .row {
    display: flex;
    flex-direction: row;
    gap: 20px;
    margin-bottom: 0;
}

#editModal .row > div {
    flex: 1;
    min-width: 0;
}

#editModal input[type="number"] {
    font-size: 1em;
    font-weight: 500;
}

#editModal .validation-error {
    color: #dc3545;
    font-size: 0.875em;
    margin-top: 6px;
    display: none;
    padding: 8px 12px;
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: 6px;
}

#editModal .validation-error.show {
    display: block;
}

#editModal .modal-footer {
    background: #f8f9fa;
    padding: 20px 32px;
    border-radius: 0 0 16px 16px;
    border-top: 1px solid #e9ecef;
}

#editModal .footer-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    align-items: center;
}

/* Generic modal overlay (documents, etc.) */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-overlay .modal-content {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    max-height: 90vh;
    overflow: visible;
}
.modal-overlay .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e9ecef;
}
.modal-overlay .modal-header h3 { margin: 0; font-size: 1.25rem; }
.modal-overlay .modal-body { padding: 1.25rem; }
/* Modal sa dugim sadržajem - scroll unutar body da dropdown može da izađe */
.modal-overlay .modal-body.modal-body-scroll {
    max-height: 60vh;
    overflow-y: auto;
}
.modal-overlay .modal-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}
.modal-overlay .form-group { margin-bottom: 1rem; }
.modal-overlay .form-group label { display: block; margin-bottom: 0.25rem; font-weight: 500; }
.modal-overlay .form-group input,
.modal-overlay .form-group select { width: 100%; padding: 0.5rem 0.75rem; border-radius: 6px; border: 1px solid #ddd; }
.form-error { color: #dc2626; font-size: 0.9rem; margin-top: 0.5rem; }

/* Send document modal - lepši dizajn */
.send-document-modal-content {
    width: 100%;
    max-width: 420px;
    border-radius: 16px;
    overflow: visible;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}
.send-document-modal-header {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    padding: 1.25rem 1.5rem;
    border-bottom: none;
}
.send-document-modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.send-document-modal-icon {
    font-size: 1.5rem;
    line-height: 1;
}
.send-document-modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}
.send-document-modal-close {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    opacity: 0.9;
}
.send-document-modal-close:hover {
    opacity: 1;
}
.send-document-modal-body {
    padding: 1.5rem 1.5rem 1.25rem;
}
.send-document-main-question {
    margin: 0 0 1.25rem 0;
    font-size: 1.05rem;
    line-height: 1.5;
    color: #1e293b;
    font-weight: 500;
}
.send-document-paid-option {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem 1.25rem;
}
.send-document-paid-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 500;
    color: #334155;
}
.send-document-paid-label input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    margin-top: 0.15rem;
    flex-shrink: 0;
    accent-color: #0ea5e9;
}
.send-document-paid-text {
    flex: 1;
}
.send-document-paid-hint {
    margin: 0.6rem 0 0 1.85rem;
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.45;
}
.send-document-modal-footer {
    padding: 1rem 1.5rem 1.25rem;
    background: #f8fafc;
    gap: 0.75rem;
}

/* User Dashboard - Hall Cards */
.halls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.content-card,
.hall-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.content-card:hover,
.hall-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #0ea5e9;
}

.card-header,
.hall-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.card-title,
.hall-card-title {
    color: #1e40af;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.card-status,
.hall-card-status {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background: #d1fae5;
    color: #065f46;
}

.card-stats,
.hall-card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-item {
    text-align: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
}

.card-footer,
.hall-card-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.card-footer-info,
.hall-card-footer-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: #6b7280;
}

.card-footer-info-value,
.hall-card-footer-info-value {
    font-weight: 600;
    color: #1e40af;
}

.card-footer-updated,
.hall-card-footer-updated {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: #9ca3af;
    text-align: center;
}

.fill-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.fill-bar-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.fill-bar-fill.low {
    background: #10b981;
}

.fill-bar-fill.medium {
    background: #f59e0b;
}

.fill-bar-fill.high {
    background: #ef4444;
}

/* User Dashboard Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h2 {
    color: #1e40af;
    margin-bottom: 0.5rem;
}

.empty-state h3 {
    color: #1e40af;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.empty-state p {
    color: #6b7280;
    margin: 0;
}

@media (max-width: 828px) {
    .halls-grid {
        grid-template-columns: 1fr;
    }
}

/* User Hall Page Styles */
.user-hall-header {
    background: white;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1rem;
}

.user-hall-header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.user-hall-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.user-hall-stats {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.user-hall-stat-box {
    text-align: center;
    padding: 0.75rem 1.25rem;
    background: #f9fafb;
    border-radius: 8px;
    min-width: 100px;
}

.user-hall-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
}

/* Maks. gostiju 0 ili 1 - crvena boja na pregledima */
.user-hall-stat-box.max-guests-low .user-hall-stat-value,
input.max-guests-low,
.form-input.max-guests-low,
.hall-edit-input.max-guests-low {
    color: #dc2626 !important;
    font-weight: 700;
}
input.max-guests-low,
.form-input.max-guests-low,
.hall-edit-input.max-guests-low {
    border-color: #dc2626 !important;
    background-color: #fef2f2 !important;
}

.user-hall-stat-label {
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.25rem;
}

.user-hall-fill-indicator {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    background: #f9fafb;
    border-radius: 8px;
}

.user-hall-fill-bar {
    width: 200px;
    height: 12px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.user-hall-fill-progress {
    height: 100%;
    background: #10b981;
    transition: width 0.3s;
}

.user-hall-fill-progress.warning {
    background: #f59e0b;
}

.user-hall-fill-progress.danger {
    background: #ef4444;
}

.user-hall-actions {
    display: flex;
    gap: 0.75rem;
}

.user-hall-tutorial {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.user-info-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
}

.hall-page .user-info-section {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    flex: none !important;
    flex-basis: auto !important;
}

.info-section-header {
    margin-bottom: 1.5rem;
}

.info-section-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #333;
}

.info-content-full {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.info-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    height: 100%;
}

.info-card h4 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: #333;
    font-weight: 600;
}

/* Card grid - admin, accounting index, generic */
.card-grid,
.dashboard-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card-grid.card-grid-sm,
.dashboard-card-grid.dashboard-card-grid-sm {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card,
.dashboard-card {
    text-decoration: none;
    color: inherit;
}

.card-inner,
.dashboard-card-inner {
    padding: 1.5rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover .card-inner,
.dashboard-card:hover .dashboard-card-inner {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.card-inner h3,
.dashboard-card-inner h3 {
    margin: 0 0 0.5rem 0;
    color: #3b82f6;
    font-size: 1.1rem;
}

.card-icon,
.icon-inline {
    width: 1.1em;
    height: 1.1em;
    vertical-align: -0.2em;
    margin-right: 0.25rem;
}

.status-icon-svg {
    width: 1em;
    height: 1em;
    vertical-align: -0.15em;
}

.card-inner p,
.dashboard-card-inner p {
    margin: 0;
    color: #64748b;
    font-size: 0.95rem;
}

/* Kartice za kreiranje – suptilna akcent boja */
.card--create .card-inner,
.card--create .dashboard-card-inner {
    border-left: 3px solid #10b981;
    background: linear-gradient(to right, #f0fdf4 0%, #fff 12%);
}

.card--create .card-inner h3,
.card--create .dashboard-card-inner h3 {
    color: #059669;
}

/* Option cards - unificirani izbor opcija (checkbox u kartici), npr. licence */
.option-cards-section {
    margin-top: 1.5rem;
}

.option-cards-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.option-cards-header > .option-cards-icon,
.option-cards-header > span:first-child {
    font-size: 1.5rem;
}

.option-cards-title {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
}

.option-cards-desc {
    margin: 0;
    font-size: 0.9rem;
    color: #64748b;
}

.option-cards-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.option-card {
    flex: 1;
    min-width: 200px;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.option-card:hover {
    border-color: #94a3b8;
}

.option-card:has(input:checked),
.option-card.is-checked {
    border-color: #3b82f6;
    background: #f0f9ff;
}

.option-card-icon,
.option-card > span:not(input) {
    font-size: 1.25rem;
}

.option-card-content,
.option-card > div {
    margin-top: 0.5rem;
}

.option-card p,
.option-card-content p,
.option-card-content > span {
    margin: 0.25rem 0 0 0;
    font-size: 0.85rem;
    color: #64748b;
    display: block;
}

/* Menu type selector - izbor sadržaj vs link */
.menu-type-section {
    margin-top: 0.5rem;
}

.menu-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.menu-type-option {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
}

.menu-type-option:hover {
    border-color: #94a3b8;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.menu-type-option:has(input:checked) {
    border-color: #3b82f6;
    background: #f0f9ff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.menu-type-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.menu-type-option-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 10px;
    font-size: 1.5rem;
}

.menu-type-option:has(input:checked) .menu-type-option-icon {
    background: #dbeafe;
    color: #2563eb;
}

.menu-type-option-content {
    flex: 1;
    min-width: 0;
}

.menu-type-option-title {
    font-weight: 600;
    font-size: 1rem;
    color: #1e293b;
    margin: 0;
}

.menu-type-option-desc {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0.25rem 0 0 0;
    line-height: 1.4;
}

@media (max-width: 540px) {
    .menu-type-grid {
        grid-template-columns: 1fr;
    }
}

.option-card-features {
    margin: 0.5rem 0 0 0;
    padding-left: 1.25rem;
    font-size: 0.85rem;
    color: #64748b;
}

.guests-list {
    height: 640px;
    overflow-y: auto;
}

.guests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.guest-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 1rem;
    transition: box-shadow 0.2s;
}

.guest-item:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.guest-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.guest-details {
    font-size: 0.875rem;
    color: #666;
}

#tableGuestsModal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    padding: 2rem;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow: visible;
    z-index: 1001;
}

#tableGuestsTable {
    font-size: 0.9rem;
    width: 100%;
    border-collapse: collapse;
}

#tableGuestsTable tbody tr,
.table-guests-grid tbody tr {
    border-bottom: 1px solid #e2e8f0;
}

#tableGuestsTable tbody tr:hover,
.table-guests-grid tbody tr:hover {
    background: #f9fafb;
}

.owner-guest-sort:hover {
    background: #e2e8f0;
}

#tableGuestsTable td {
    padding: 0.75rem;
    vertical-align: top;
}

.pagination-container {
    margin-top: 1.5rem;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-page-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
}

.pagination-page-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

#guestModal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    z-index: 1002;
}

@media (max-width: 828px) {
    .user-hall-header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .user-hall-stats {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .user-info-section {
        padding: 1rem;
    }
    
    .guests-grid {
        grid-template-columns: 1fr;
    }
    
    .page-content > div[style*="grid-template-columns"],
    .dashboard-content > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    .guests-list {
        height: auto;
        min-height: 200px;
        max-height: 400px;
    }
}

@media (max-width: 540px) {
    .guests-list {
        max-height: 320px;
    }
}

/* Owner edit - licence za pravno lice */
.owner-licenses-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    min-height: 100px;
    margin-bottom: 2rem;
}

.owner-licenses-table-wrap {
    overflow-x: auto;
}

.owner-licenses-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.owner-licenses-table thead tr {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
}

.owner-licenses-table thead th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
}

.owner-licenses-table thead th.owner-licenses-actions-col {
    text-align: center;
    width: 1%;
    white-space: nowrap;
}

.owner-licenses-table tbody td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

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

.owner-licenses-table .license-type-select,
.owner-licenses-table .date-input {
    width: 100%;
    min-width: 0;
}

.owner-licenses-actions-cell {
    text-align: center;
}

.owner-licenses-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.license-details-row {
    display: none;
    background: #f1f5f9;
}

.license-details-row.is-expanded {
    display: table-row;
}

.license-details-row td {
    padding: 1.25rem !important;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
}

.license-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.license-detail-field {
    min-width: 0;
}

.license-detail-field-wide {
    grid-column: 1 / -1;
}

.license-detail-field-full {
    grid-column: 1 / -1;
}

.license-detail-field label {
    display: block;
    font-size: 0.85rem;
    color: #475569;
    margin-bottom: 0.35rem;
    font-weight: 600;
}

.license-detail-field .form-input {
    width: 100%;
}

.license-details-hint {
    display: block;
    margin-top: 1rem;
    color: #64748b;
    font-size: 0.875rem;
}

.owner-add-license-box {
    margin-top: 1rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
}

.owner-payment-section {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.owner-payment-section-title {
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
    color: #074682;
    font-size: 1.1rem;
}

.invoice-send-mode-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.invoice-send-mode-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.invoice-send-mode-option:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.invoice-send-mode-option input:checked + span {
    color: #1e40af;
}

.invoice-send-mode-option:has(input:checked) {
    border-color: #3b82f6;
    background: #eff6ff;
}

.invoice-send-mode-option input {
    margin-top: 0.2rem;
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
}

.invoice-send-mode-option span {
    font-size: 0.95rem;
    line-height: 1.5;
}

.owner-add-license-box h4 {
    margin: 0 0 0.5rem 0;
    color: #1e293b;
}

.owner-add-license-box p {
    margin: 0 0 0.75rem 0;
    color: #64748b;
}

@media (max-width: 828px) {
    .owner-licenses-table thead th,
    .owner-licenses-table tbody td {
        padding: 0.75rem;
    }
    .owner-licenses-actions {
        flex-direction: column;
    }
    .owner-licenses-actions .btn {
        width: 100%;
    }
}

/* Inline/filter checkbox - konzistentan stil */
.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: #475569;
}

.checkbox-inline input[type="checkbox"] {
    width: 1.5rem;
    height: 1.5rem;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
}

/* Owner edit - veliki checkbox sa labelom */
.owner-checkbox-group .owner-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    cursor: pointer;
}

.owner-checkbox-group .owner-checkbox-large {
    width: 1.5rem;
    height: 1.5rem;
    margin-top: 0.2rem;
    flex-shrink: 0;
    cursor: pointer;
}

.owner-checkbox-group .owner-checkbox-text small {
    color: #64748b;
}

/* License edit - Dodatne opcije sekcija */
.license-attributes-section {
    margin-top: 1.5rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.license-attributes-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.license-attributes-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.license-attributes-title {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e40af;
}

.license-attributes-desc {
    margin: 0;
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.4;
}

.license-attributes-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.license-option-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.license-option-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.08);
}

.license-option-card:has(input:checked),
.license-option-card.is-checked {
    border-color: #3b82f6;
    background: #eff6ff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.12);
}

.license-option-card input {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #3b82f6;
}

.license-option-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.license-option-content {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.license-option-content strong {
    font-size: 0.95rem;
    color: #1e293b;
}

.license-option-content span {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.3;
}

.license-option-features {
    margin: 0.5rem 0 0 0;
    padding-left: 1.1rem;
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.5;
}

.license-option-features li {
    margin-bottom: 0.2rem;
}

.license-option-features li:last-child {
    margin-bottom: 0;
}

.accounting-msg {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.95rem;
}
.accounting-msg.success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.accounting-msg.error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}
.accounting-result-header {
    margin-bottom: 1rem;
    padding: 0.75rem 0;
    font-size: 0.95rem;
}
.accounting-result-header strong {
    color: #1e293b;
}

/* Owner users page - tabela responsive */
@media (max-width: 828px) {
    .owner-users-page .dashboard-header {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .owner-users-page .dashboard-header .btn { width: 100% !important; text-align: center !important; }
    .owner-users-page .table-wrap .data-table { min-width: 500px; font-size: 0.9rem; }
    .owner-users-page .table-wrap .data-table th,
    .owner-users-page .table-wrap .data-table td { padding: 0.5rem 0.75rem !important; }
}
@media (max-width: 540px) {
    .owner-users-page .container { padding: 0.75rem 1rem !important; }
    .owner-users-page .page-content,
    .owner-users-page .dashboard-content { padding: 1rem !important; }
    .owner-users-page .page-header h1,
    .owner-users-page .dashboard-header h1 { font-size: 1.25rem !important; }
    .owner-users-page .table-wrap .data-table { min-width: 450px; font-size: 0.85rem !important; }
    .owner-users-page .table-wrap .data-table th,
    .owner-users-page .table-wrap .data-table td { padding: 0.4rem 0.5rem !important; }
}

/* Owner employees page - tabela responsive */
@media (max-width: 828px) {
    .owner-employees-page .dashboard-header {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .owner-employees-page .dashboard-header .btn { width: 100% !important; text-align: center !important; }
    .owner-employees-page .table-wrap .data-table { min-width: 550px; font-size: 0.9rem; }
    .owner-employees-page .table-wrap .data-table th,
    .owner-employees-page .table-wrap .data-table td { padding: 0.5rem 0.75rem !important; }
    .owner-employees-page .table-wrap .data-table .btn-action { padding: 0.35rem 0.6rem !important; font-size: 0.8rem !important; }
}
@media (max-width: 540px) {
    .owner-employees-page .container { padding: 0.75rem 1rem !important; }
    .owner-employees-page .page-content,
    .owner-employees-page .dashboard-content { padding: 1rem !important; }
    .owner-employees-page .page-header h1,
    .owner-employees-page .dashboard-header h1 { font-size: 1.25rem !important; }
    .owner-employees-page .table-wrap .data-table { min-width: 480px; font-size: 0.85rem !important; }
    .owner-employees-page .table-wrap .data-table th,
    .owner-employees-page .table-wrap .data-table td { padding: 0.4rem 0.5rem !important; }
}

/* Global dashboard responsive - sve stranice u users/* */
@media (max-width: 828px) {
    .dashboard-page .page-header,
    .dashboard-page .dashboard-header,
    .page-header-flex,
    .dashboard-header-flex {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .dashboard-page .page-header .btn,
    .dashboard-page .dashboard-header .btn,
    .page-header-flex .btn,
    .dashboard-header-flex .btn,
    .page-header-flex > a.btn,
    .dashboard-header-flex > a.btn { width: 100% !important; text-align: center !important; }
    .dashboard-page [style*="display: flex"][style*="gap"] form:not(.filter-form) {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .dashboard-page .table-container .data-table { min-width: 500px; font-size: 0.9rem; }
    .dashboard-page .table-container .data-table th,
    .dashboard-page .table-container .data-table td { padding: 0.5rem 0.75rem !important; }
    .dashboard-page .info-card[style*="display: flex"] {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .dashboard-page .info-card[style*="display: flex"] .btn { width: 100% !important; }
    .dashboard-page .page-header-actions .btn,
    .dashboard-page .dashboard-header-actions .btn,
    .dashboard-page .page-header-actions a.btn,
    .dashboard-page .dashboard-header-actions a.btn { width: 100% !important; }
}
@media (max-width: 540px) {
    .dashboard-page .container { padding: 0.75rem 1rem !important; }
    .dashboard-page .page-content,
    .dashboard-page .dashboard-content { padding: 1rem !important; }
    .dashboard-page .page-header,
    .dashboard-page .dashboard-header,
    .page-header,
    .dashboard-header { padding: 0.5rem 0.75rem !important; }
    .dashboard-page .page-header h1,
    .dashboard-page .dashboard-header h1 { font-size: 1.25rem !important; }
    .dashboard-page .page-subtitle,
    .dashboard-page .dashboard-subtitle { font-size: 0.85rem !important; }
    .dashboard-page .table-container .data-table { min-width: 450px; font-size: 0.85rem !important; }
    .dashboard-page .table-container .data-table th,
    .dashboard-page .table-container .data-table td { padding: 0.4rem 0.5rem !important; }
}

/* Filter tabs card - full responsive layout (access logs, itd.) */
.filter-tabs-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem !important;
}
.filter-tabs {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.filter-tabs-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.filter-tabs-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Desktop: sve u jednom redu, filteri inline sa dugmadima */
@media (min-width: 1052px) {
    .filter-tabs-card {
        gap: 1rem;
    }
    .filter-tabs {
        flex-direction: row;
        align-items: center;
        gap: 0.75rem;
    }
    .filter-tabs-label {
        flex-shrink: 0;
    }
    .filter-actions {
        flex-shrink: 0;
    }
}

/* Mobil: sve u kolonu, 100% širine */
@media (max-width: 540px) {
    .filter-tabs-buttons {
        flex-direction: column;
    }
    .filter-actions {
        width: 100%;
    }
}

/* Access logs - tabela responsive */
@media (max-width: 828px) {
    .owner-access-logs-page .table-wrap .data-table {
        min-width: 500px;
        font-size: 0.9rem;
    }
    .owner-access-logs-page .table-wrap .data-table th,
    .owner-access-logs-page .table-wrap .data-table td {
        padding: 0.5rem 0.75rem !important;
    }
}
@media (max-width: 540px) {
    .owner-access-logs-page .table-wrap .data-table {
        min-width: 450px;
        font-size: 0.85rem !important;
    }
    .owner-access-logs-page .table-wrap .data-table th,
    .owner-access-logs-page .table-wrap .data-table td {
        padding: 0.4rem 0.5rem !important;
    }
}

@media (max-width: 540px) {
    .owner-halls-page .filter-form .filter-group {
        flex-direction: column !important;
        width: 100% !important;
    }
    .owner-halls-page .filter-form .filter-group .btn,
    .owner-halls-page .filter-form .filter-group a.btn {
        width: 100% !important;
    }
    /* Radni dani filter */
    .owner-radni-dani-page .filter-form {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .owner-radni-dani-page .filter-form .filter-item {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
    }
    .owner-radni-dani-page .filter-form select,
    .owner-radni-dani-page .filter-form .form-input,
    .owner-radni-dani-page .filter-form .custom-select,
    .owner-radni-dani-page .filter-form .filter-select {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
    }
    .owner-radni-dani-page .filter-form .btn,
    .owner-radni-dani-page .filter-form a.btn {
        width: 100% !important;
    }
}

/* Print - samo kad je body.canvas-print-mode (klik na Štampaj raspored) */
@media print {
    @page {
        size: A4 landscape;
        margin: 10mm;
    }
    /* Sakriveni elementi van canvasa - izvan stranice, bez prostora */
    body.canvas-print-mode * {
        position: absolute !important;
        left: -99999px !important;
        width: 1px !important;
        height: 1px !important;
        overflow: hidden !important;
        visibility: hidden !important;
    }
    body.canvas-print-mode *:has(.canvas-print-wrapper),
    body.canvas-print-mode .canvas-print-wrapper,
    body.canvas-print-mode .canvas-print-wrapper *,
    body.canvas-print-mode #canvas-container,
    body.canvas-print-mode #canvas-container * {
        position: revert !important;
        left: revert !important;
        width: revert !important;
        height: revert !important;
        overflow: visible !important;
        visibility: visible !important;
    }
    body.canvas-print-mode #canvas-container {
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: 100% !important;
        min-height: 100vh !important;
        border: none !important;
        background: #fff !important;
        box-shadow: none !important;
        overflow: visible !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        page-break-inside: avoid !important;
    }
    body.canvas-print-mode #canvas-container #canvas {
        width: 2400px !important;
        height: 1500px !important;
        min-width: 2400px !important;
        min-height: 1500px !important;
        transform: translate(-50%, -50%) scale(0.42) !important;
        transform-origin: center center !important;
        position: absolute !important;
        left: 50% !important;
        top: 50% !important;
        overflow: visible !important;
    }
    body.canvas-print-mode #canvas-container .canvas-zoom-controls {
        display: none !important;
    }
}

/* Spinner pri pripremi štampe (Štampaj raspored) */
.canvas-print-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
}
.canvas-print-loading-overlay .canvas-print-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: canvas-print-spin 0.7s linear infinite;
}
.canvas-print-loading-overlay .canvas-print-loading-text {
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
}
@keyframes canvas-print-spin {
    to { transform: rotate(360deg); }
}

/* Canvas crop modal - osečite sliku pre štampe */
.canvas-crop-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.canvas-crop-modal {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.canvas-crop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}
.canvas-crop-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
}
.canvas-crop-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
    padding: 0.25rem;
}
.canvas-crop-close:hover {
    color: #1e293b;
}
.canvas-crop-body {
    padding: 1rem;
    overflow: auto;
    flex: 1;
    min-height: 0;
}
.canvas-crop-wrap {
    position: relative;
    display: inline-block;
    max-width: 100%;
}
.canvas-crop-img {
    display: block;
    max-width: 85vw;
    max-height: 70vh;
    width: auto;
    height: auto;
}
.canvas-crop-box {
    position: absolute;
    left: 5%;
    top: 5%;
    width: 90%;
    height: 90%;
    border: 2px dashed #3b82f6;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.4);
    cursor: move;
    box-sizing: border-box;
}
.canvas-crop-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #3b82f6;
    border: 2px solid #fff;
    border-radius: 2px;
    cursor: nwse-resize;
}
.canvas-crop-handle.n { top: -6px; left: 50%; transform: translateX(-50%); cursor: n-resize; }
.canvas-crop-handle.s { bottom: -6px; left: 50%; transform: translateX(-50%); cursor: s-resize; }
.canvas-crop-handle.e { right: -6px; top: 50%; transform: translateY(-50%); cursor: e-resize; }
.canvas-crop-handle.w { left: -6px; top: 50%; transform: translateY(-50%); cursor: w-resize; }
.canvas-crop-handle.ne { top: -6px; right: -6px; cursor: ne-resize; }
.canvas-crop-handle.nw { top: -6px; left: -6px; cursor: nw-resize; }
.canvas-crop-handle.se { bottom: -6px; right: -6px; cursor: se-resize; }
.canvas-crop-handle.sw { bottom: -6px; left: -6px; cursor: sw-resize; }
.canvas-crop-options {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
}
.canvas-crop-options-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.canvas-crop-options-row:last-child { margin-bottom: 0; }
.canvas-crop-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    user-select: none;
}
.canvas-crop-option input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    cursor: pointer;
}
.canvas-crop-option select {
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    font-size: 0.9rem;
    margin-left: 0.25rem;
}
.canvas-crop-grayscale-opts {
    gap: 1.5rem;
}
.canvas-crop-slider-label {
    font-size: 0.85rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.canvas-crop-contrast,
.canvas-crop-threshold {
    width: 80px;
    vertical-align: middle;
}
.canvas-crop-rotate {
    display: flex;
    gap: 0.25rem;
}
.canvas-crop-rotate .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 1rem;
}
.canvas-crop-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    border-top: 1px solid #e5e7eb;
}
.canvas-crop-footer-left {
    display: flex;
    gap: 0.5rem;
}
.canvas-crop-actions {
    display: flex;
    gap: 0.75rem;
}