/**
 * Theme: design system for map-app.
 * Use after Bootstrap, before style.css. Reusable across all pages.
 */

:root {
    --section-gap: 1.75rem;
    --card-padding: 1.25rem 1.5rem;
    --card-radius: 0.5rem;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.1);
    --page-title-size: 1.5rem;
    --section-title-size: 1.125rem;
    --muted-text: #6c757d;
    /* Brand: primary identity (used for accent, buttons, links, focus) */
    --brand-primary: #0e7490;
    --brand-primary-hover: #0c5a6e;
    --brand-subtle: rgba(14, 116, 144, 0.06);
    /* Surfaces & accent (accent derived from brand) */
    --surface-page: #f5f6f8;
    --surface-card: #ffffff;
    --surface-header: #fafafa;
    --accent: var(--brand-primary);
    --accent-hover: var(--brand-primary-hover);
    --border-light: rgba(0, 0, 0, 0.06);
    --border-muted: rgba(0, 0, 0, 0.08);
    /* Form */
    --field-label-color: #374151;
    --field-spacing: 0.5rem;
    --form-group-gap: 1rem;
}

/* ========== Typography & brand ========== */
.brand-name {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--brand-primary);
}

.page-title {
    font-size: var(--page-title-size);
    font-weight: 600;
    margin-bottom: var(--section-gap);
    color: #212529;
    letter-spacing: -0.01em;
}

.page-title--hero {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
}

.page-intro {
    font-size: 1rem;
    color: var(--muted-text);
    margin-bottom: var(--section-gap);
    max-width: 42em;
}

.page-header {
    margin-bottom: var(--section-gap);
}

.section-title {
    font-size: var(--section-title-size);
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #343a40;
}

.section-title--muted {
    color: var(--muted-text);
    font-weight: 500;
}

.field-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--field-label-color);
    margin-bottom: var(--field-spacing);
}

/* ========== Cards & panels ========== */
.card-modern {
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-light);
    background: var(--surface-card);
}

.card-modern .card-header {
    font-weight: 600;
    font-size: var(--section-title-size);
    border-bottom: 1px solid var(--border-light);
    padding: 0.75rem 1.25rem;
    background: var(--surface-header);
    border-radius: var(--card-radius) var(--card-radius) 0 0;
}

.card-modern .card-header.card-header--brand {
    background: var(--brand-subtle);
    border-bottom-color: rgba(14, 116, 144, 0.12);
}

.card-header__app {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--brand-primary);
    margin-bottom: 0.15rem;
}

.card-header--detail {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.card-header--detail .card-header__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
}

.card-header--detail .card-header__subtitle {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted-text);
}

.page-form.page-login .card-login {
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
}

.page-login .page-title {
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
}

.card-modern .card-body {
    padding: var(--card-padding);
}

.section-card {
    margin-bottom: var(--section-gap);
}

/* Form section: grouped fields with optional title */
.form-section {
    margin-bottom: var(--section-gap);
}

.form-section__title {
    font-size: var(--section-title-size);
    font-weight: 600;
    color: #374151;
    margin-top: 0;
    margin-bottom: 0.75rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--border-muted);
}

.form-section .form-group {
    margin-bottom: var(--form-group-gap);
}

/* Form grid: two columns on desktop, one on mobile */
.form-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 0;
}

@media (min-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem 1.25rem;
    }
}

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

/* Form field: label above input, for use inside form-grid */
.form-field {
    margin-bottom: 0;
}

.form-field .field-label {
    display: block;
    margin-bottom: 0.35rem;
}

.form-field .form-control {
    width: 100%;
}

.form-field .invalid-feedback {
    display: block;
}

@media (min-width: 768px) {
    .form-grid .form-field--full {
        grid-column: 1 / -1;
    }
}

/* ========== Detail page (single): map + detail grid ========== */
.map-detail {
    height: 460px;
    border-radius: var(--card-radius);
    overflow: hidden;
}

.map-detail .map-embed,
.map-detail #mapSingle {
    height: 100%;
    min-height: 0;
}

.detail-section {
    margin-top: var(--section-gap);
}

.detail-section .section-title {
    margin-bottom: 1rem;
}

.detail-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    margin-bottom: 1.25rem;
    padding: 1rem 1.125rem;
    background: var(--brand-subtle, rgba(14, 116, 144, 0.06));
    border-radius: var(--card-radius);
}

.detail-highlight {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.detail-highlight--wide {
    flex: 1;
    min-width: 12rem;
}

.detail-highlight__label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted-text);
}

.detail-highlight__value {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.detail-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.65rem 1.5rem;
    align-items: baseline;
    margin-bottom: var(--section-gap);
}

.detail-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--field-label-color);
}

.detail-value {
    font-size: 0.9375rem;
    color: #212529;
}

.detail-action-zone {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-light);
}

.detail-action-links {
    margin-bottom: 1rem;
}

.detail-action-links + .toolbar {
    margin-top: 0;
}

.detail-link-external {
    font-size: 0.875rem;
    color: var(--brand-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.detail-link-external:hover {
    color: var(--brand-primary-hover);
    text-decoration: underline;
}

.toolbar--detail {
    gap: 0.75rem;
    padding-top: 0;
}

@media (max-width: 991px) {
    .map-detail {
        height: 360px;
    }
}

@media (max-width: 767px) {
    .map-detail {
        height: 300px;
    }

    .detail-highlights {
        flex-direction: column;
        gap: 1rem;
        padding: 0.875rem 1rem;
    }

    .detail-highlight--wide {
        min-width: 0;
    }

    .detail-grid {
        grid-template-columns: 1fr;
        gap: 0.25rem 0;
    }

    .detail-grid .detail-value {
        margin-bottom: 0.75rem;
    }
}

/* ========== Map location section (create forms) ========== */
.map-location-block {
    margin-bottom: var(--section-gap);
}

.map-location-section {
    margin-bottom: 1.25rem;
}

.map-location-header {
    margin-bottom: 1rem;
}

.map-location-title {
    font-size: var(--section-title-size);
    font-weight: 600;
    color: #374151;
    margin: 0 0 0.35rem 0;
}

.map-location-helper {
    font-size: 0.875rem;
    color: var(--muted-text);
    margin: 0;
    line-height: 1.45;
}

.map-form-card {
    border-radius: var(--card-radius);
    border: 1px solid var(--border-light);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    margin-bottom: 1rem;
    background: var(--surface-card);
}

.map-form-card .map-embed,
.map-form-card #map {
    height: 420px;
    min-height: 320px;
}

.map-feedback {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.map-status {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--card-radius);
    background: var(--brand-subtle, rgba(14, 116, 144, 0.08));
    color: var(--brand-primary);
}

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

.map-status--error {
    background: #fef3c7;
    color: #92400e;
}

.map-coordinates-section {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-light);
}

.map-coordinates-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--muted-text);
    margin-bottom: 0.75rem;
}

.map-coordinates-grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 768px) {
    .map-coordinates-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 767px) {
    .map-form-card .map-embed,
    .map-form-card #map {
        height: 320px;
        min-height: 280px;
    }
}

/* Table panel: card with table inside */
.table-panel {
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-light);
    background: var(--surface-card);
    margin-bottom: var(--section-gap);
}

.table-panel .card-header {
    font-weight: 600;
    font-size: var(--section-title-size);
    border-bottom: 1px solid var(--border-light);
    padding: 0.75rem 1.25rem;
    background: var(--surface-header);
    border-radius: var(--card-radius) var(--card-radius) 0 0;
}

.table-panel .card-body {
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    min-width: 0;
}

.table-panel .card-body:not(.p-0) .dataTables_wrapper {
    min-width: 0;
}

.table-panel .table {
    margin-bottom: 0;
    font-size: 0.9rem;
}

.table-panel thead th {
    background: #f1f3f5;
    font-weight: 600;
    font-size: 0.8125rem;
    border-bottom: 1px solid var(--border-muted);
}

/* ========== Table modern (DataTables list pages) ========== */
.table-panel .table-modern {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.table-panel .table-modern thead th,
.table-panel .table-modern tfoot th {
    background: #e9ecef;
    color: #374151;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid #dee2e6;
    white-space: normal;
    word-break: break-word;
}

.table-panel .table-modern tfoot th {
    border-bottom: 1px solid var(--border-muted);
    border-top: 1px solid #dee2e6;
}

.table-panel .table-modern tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    font-size: 0.875rem;
    line-height: 1.4;
    border-bottom: 1px solid var(--border-muted);
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
}

.table-panel .table-modern tbody tr {
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.table-panel .table-modern tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.table-panel .table-modern tbody tr:hover {
    background: #e8ecf1;
}

.table-panel .table-modern tbody tr:nth-child(even):hover {
    background: #e2e6eb;
}

.table-panel .table-modern tbody tr:focus-within {
    background: #e4e9f0;
}

.table-panel .table-modern tbody tr:nth-child(even):focus-within {
    background: #dde2e9;
}

/* Numeric columns: right-align (objects: Cena €, Cena RSD, Povrsina Parcele, Povrsina Objekta) */
.table-list-objects .table-modern thead th:nth-child(6),
.table-list-objects .table-modern thead th:nth-child(7),
.table-list-objects .table-modern thead th:nth-child(8),
.table-list-objects .table-modern thead th:nth-child(9),
.table-list-objects .table-modern tfoot th:nth-child(6),
.table-list-objects .table-modern tfoot th:nth-child(7),
.table-list-objects .table-modern tfoot th:nth-child(8),
.table-list-objects .table-modern tfoot th:nth-child(9),
.table-list-objects .table-modern tbody td:nth-child(6),
.table-list-objects .table-modern tbody td:nth-child(7),
.table-list-objects .table-modern tbody td:nth-child(8),
.table-list-objects .table-modern tbody td:nth-child(9) {
    text-align: right;
}

/* Numeric columns: right-align (rgz: Cena €, Cena RSD) */
.table-list-rgz .table-modern thead th:nth-child(4),
.table-list-rgz .table-modern thead th:nth-child(5),
.table-list-rgz .table-modern tfoot th:nth-child(4),
.table-list-rgz .table-modern tfoot th:nth-child(5),
.table-list-rgz .table-modern tbody td:nth-child(4),
.table-list-rgz .table-modern tbody td:nth-child(5) {
    text-align: right;
}

/* Objects list: column widths (fixed layout) – Ulica, Opstina, Br Resenja limited */
.table-list-objects.table-modern thead th:nth-child(1) { width: 6%; }   /* Br. Parcele */
.table-list-objects.table-modern thead th:nth-child(2) { width: 14%; }  /* Ulica */
.table-list-objects.table-modern thead th:nth-child(3) { width: 10%; }   /* Opstina KO */
.table-list-objects.table-modern thead th:nth-child(4) { width: 12%; }   /* Br. Resenja */
.table-list-objects.table-modern thead th:nth-child(5) { width: 9%; }    /* Datum Resenja */
.table-list-objects.table-modern thead th:nth-child(6) { width: 6%; }    /* Cena € */
.table-list-objects.table-modern thead th:nth-child(7) { width: 8%; }    /* Cena RSD */
.table-list-objects.table-modern thead th:nth-child(8) { width: 6%; }    /* Povrsina Parcele */
.table-list-objects.table-modern thead th:nth-child(9) { width: 7%; }    /* Povrsina Objekta */
.table-list-objects.table-modern thead th:nth-child(10) { width: 10%; } /* Pregled na Mapi */
.table-list-objects.table-modern thead th:nth-child(11) { width: 10%; } /* Akcija */

/* RGZ list: column widths */
.table-list-rgz.table-modern thead th:nth-child(1) { width: 18%; }
.table-list-rgz.table-modern thead th:nth-child(2) { width: 14%; }
.table-list-rgz.table-modern thead th:nth-child(3) { width: 12%; }
.table-list-rgz.table-modern thead th:nth-child(4) { width: 8%; }
.table-list-rgz.table-modern thead th:nth-child(5) { width: 10%; }
.table-list-rgz.table-modern thead th:nth-child(6) { width: 14%; }
.table-list-rgz.table-modern thead th:nth-child(7) { width: 14%; }

/* Action column: compact, balanced spacing */
.table-panel .table-modern thead th:last-child,
.table-panel .table-modern tfoot th:last-child,
.table-panel .table-modern td:last-child {
    white-space: nowrap;
}

.table-panel .table-modern thead th:last-child,
.table-panel .table-modern tfoot th:last-child {
    word-break: normal;
}

.table-panel .table-modern td:last-child {
    padding-left: 0.75rem;
    padding-right: 1rem;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.4rem;
}

.table-panel .table-modern td:last-child .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    min-height: 1.75rem;
    border-radius: 0.35rem;
    border-width: 1px;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.table-panel .table-modern td:last-child .btn:last-child {
    margin-right: 0;
}

/* Action buttons: lighter outline style in table */
.table-panel .table-modern td:last-child .btn-outline-primary {
    color: var(--brand-primary);
    border-color: rgba(14, 116, 144, 0.35);
    background: transparent;
}

.table-panel .table-modern td:last-child .btn-outline-primary:hover {
    background: var(--brand-subtle);
    border-color: var(--brand-primary);
    color: var(--brand-primary-hover);
}

.table-panel .table-modern td:last-child .btn-outline-secondary {
    color: #495057;
    border-color: rgba(0, 0, 0, 0.12);
    background: transparent;
}

.table-panel .table-modern td:last-child .btn-outline-secondary:hover {
    background: #f1f3f5;
    border-color: rgba(0, 0, 0, 0.2);
    color: #212529;
}

/* Focus-visible for table action buttons */
.table-panel .table-modern .btn:focus-visible,
.table-panel .table-modern a.btn:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

/* DataTables wrapper: keep pagination/search unchanged, add spacing */
.table-panel .dataTables_wrapper {
    font-size: 0.9rem;
}

.table-panel .dataTables_wrapper .dataTables_length,
.table-panel .dataTables_wrapper .dataTables_filter {
    margin-bottom: 0.75rem;
}

/* ========== Dashboard (home) ========== */
.page-dashboard .page-intro {
    margin-bottom: 1.75rem;
}

.dashboard-section {
    margin-bottom: 2rem;
}

.dashboard-section:last-of-type {
    margin-bottom: 1.5rem;
}

.page-dashboard .dashboard-kpis .row {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

.page-dashboard .dashboard-kpis .row [class^="col-"] {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.dashboard-kpi-card {
    display: block;
    padding: 1.25rem 1.35rem;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.dashboard-kpi-card:hover {
    text-decoration: none;
    color: inherit;
    box-shadow: var(--card-shadow-hover);
    border-color: rgba(14, 116, 144, 0.25);
}

.dashboard-kpi-card--static:hover {
    transform: none;
}

.dashboard-kpi__value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.dashboard-kpi__number {
    font-variant-numeric: tabular-nums;
}

.dashboard-kpi__unit {
    font-weight: 600;
    font-size: 1rem;
    color: #4b5563;
    margin-left: 0.15rem;
}

.dashboard-kpi__empty {
    font-weight: 500;
    color: var(--muted-text);
}

.dashboard-kpi__label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #4b5563;
    margin-top: 0.35rem;
    letter-spacing: 0.01em;
}

.dashboard-kpi__meta {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

.dashboard-kpi__meta-value {
    font-variant-numeric: tabular-nums;
}

/* Chart cards */
.dashboard-chart-card .card-header {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.dashboard-chart-title {
    font-size: var(--section-title-size);
    font-weight: 600;
}

.dashboard-chart-subtitle {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted-text);
}

.card-body--chart {
    padding: 1rem 1.25rem 1.25rem;
}

.card-body--chart-pie {
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashboard-chart-wrap {
    position: relative;
    min-height: 260px;
}

.dashboard-chart-wrap--bar {
    height: 280px;
}

.dashboard-chart-wrap--pie {
    height: 280px;
    max-width: 280px;
    margin: 0 auto;
}

.dashboard-chart-wrap canvas {
    max-width: 100%;
}

.dashboard-chart-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafbfc;
    border-radius: var(--card-radius);
}

.dashboard-chart-empty__text {
    font-size: 0.875rem;
    color: #9ca3af;
}

/* Recent activity */
.dashboard-recent-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dashboard-recent-item {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-muted);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dashboard-recent-item:last-child {
    border-bottom: 0;
}

.dashboard-recent-item:hover {
    background: #fafbfc;
}

.dashboard-recent-item__title {
    color: var(--brand-primary);
    font-weight: 500;
    font-size: 0.9375rem;
    line-height: 1.35;
}

.dashboard-recent-item__title:hover {
    color: var(--brand-primary-hover);
    text-decoration: underline;
}

.dashboard-recent-item__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
}

.dashboard-recent-item__opstina,
.dashboard-recent-item__date {
    color: #6b7280;
}

.dashboard-recent-item__sep {
    color: #9ca3af;
}

.dashboard-recent-empty {
    padding: 1.5rem 1.25rem;
    text-align: center;
    background: #fafbfc;
}

.dashboard-recent-empty__text {
    margin: 0;
    font-size: 0.875rem;
    color: #9ca3af;
    font-style: italic;
}

/* Quick links section */
.dashboard-actions__title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1.25rem;
}

.dashboard-action-row {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

.dashboard-action-col {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    margin-bottom: 1rem;
}

.dashboard-action-col:last-child {
    margin-bottom: 0;
}

.dashboard-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.75rem 1.25rem;
    text-decoration: none;
    color: #111827;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
    min-height: 160px;
}

.dashboard-action-card:hover {
    text-decoration: none;
    color: #111827;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: rgba(14, 116, 144, 0.25);
}

.dashboard-action-card:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

.dashboard-action-icon {
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: #4b5563;
    transition: color 0.2s ease;
}

.dashboard-action-icon i {
    font-size: 1.75rem;
}

.dashboard-action-card:hover .dashboard-action-icon {
    color: var(--brand-primary);
}

.dashboard-action-title {
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #111827;
    margin-bottom: 0.35rem;
}

.dashboard-action-desc {
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.35;
}

@media (min-width: 576px) {
    .dashboard-action-col {
        margin-bottom: 1rem;
    }
}

@media (min-width: 992px) {
    .dashboard-action-col {
        margin-bottom: 0;
    }
}

/* Unos / Pregled section cards (2 cards per page) */
.page-section-cards .page-intro {
    margin-bottom: 1.5rem;
}

.section-action-row {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

.section-action-col {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    margin-bottom: 1rem;
}

.section-action-col:last-child {
    margin-bottom: 0;
}

@media (min-width: 576px) {
    .section-action-col {
        margin-bottom: 1rem;
    }

    .section-action-col:last-child {
        margin-bottom: 1rem;
    }
}

@media (min-width: 992px) {
    .section-action-row {
        max-width: 640px;
        margin-left: auto;
        margin-right: auto;
    }

    .section-action-col {
        margin-bottom: 0;
    }
}

/* Unos: input/action feel – subtle left accent on hover */
.dashboard-action-card--input:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1), inset 3px 0 0 var(--brand-primary);
}

/* Pregled: view/browse feel – softer accent */
.dashboard-action-card--view:hover .dashboard-action-icon {
    color: var(--brand-primary);
}

.dashboard-action-card--view:hover {
    background-color: #fafbfc;
}

@media (max-width: 767px) {
    .dashboard-kpi__value {
        font-size: 1.25rem;
    }

    .dashboard-kpi__unit {
        font-size: 0.875rem;
    }

    .dashboard-section {
        margin-bottom: 1.5rem;
    }

    .dashboard-chart-wrap--bar,
    .dashboard-chart-wrap--pie {
        height: 260px;
    }
}

/* ========== Toolbar ========== */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 0;
    margin-top: var(--section-gap);
    border-top: 1px solid var(--border-muted);
}

.toolbar .btn + .btn {
    margin-left: 0;
}

/* ========== Buttons (brand-aligned) ========== */
.btn-primary,
.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--accent);
    border-color: var(--accent);
}

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

.btn-action-primary {
    min-width: 10rem;
}

.btn-action-secondary {
    min-height: 2.5rem;
}

/* Focus states for accessibility */
.btn:focus-visible,
.link-button:focus-visible,
a.link-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ========== Status badges ========== */
.badge-pill {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge--success { background: #d1fae5; color: #065f46; }
.badge--warning { background: #fef3c7; color: #92400e; }
.badge--danger { background: #fee2e2; color: #991b1b; }
.badge--info { background: #cffafe; color: #0e7490; }
.badge--muted { background: #f3f4f6; color: #4b5563; }
.badge--brand { background: var(--brand-subtle); color: var(--brand-primary); }

/* ========== Alerts ========== */
.alert-inline {
    padding: 0.5rem 0.75rem;
    border-radius: var(--card-radius);
    font-size: 0.875rem;
    margin-bottom: var(--section-gap);
}

.alert--danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert--warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert--info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* ========== Spacing ========== */
.section-gap {
    margin-bottom: var(--section-gap);
}

.section-gap--top {
    margin-top: var(--section-gap);
}

/* ========== Detail view (read-only key-value) ========== */
.detail-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.detail-list__row {
    display: flex;
    flex-wrap: wrap;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-muted);
    gap: 0.5rem;
}

.detail-list__row:last-child {
    border-bottom: 0;
}

.detail-list__label {
    font-weight: 500;
    color: var(--field-label-color);
    min-width: 10rem;
    font-size: 0.875rem;
}

.detail-list__value {
    color: #111827;
}

/* ========== Search page (existing) ========== */
.search-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    margin-top: var(--section-gap);
    border-top: 1px solid var(--border-muted);
}

.search-actions .btn-primary {
    min-width: 10rem;
}

.search-selected-summary {
    font-size: 0.875rem;
    color: var(--muted-text);
}

.search-selected-summary strong {
    color: #495057;
}

/* ========== Responsive: Tablet (768px – 991px) ========== */
@media (max-width: 991px) {
    .page-title {
        font-size: 1.35rem;
        margin-bottom: 1.25rem;
    }

    .page-title--hero {
        font-size: 1.5rem;
    }

    .card-modern .card-body {
        padding: 1rem 1.25rem;
    }

    .card-modern .card-header {
        padding: 0.65rem 1rem;
        font-size: 1.0625rem;
    }

    .table-panel .card-body {
        padding: 0.85rem 1rem;
    }

    .toolbar {
        gap: 0.5rem;
        padding: 0.85rem 0;
    }

    .search-actions {
        gap: 0.75rem;
        padding: 0.85rem 0;
    }

    .btn-action-primary {
        min-width: 8rem;
    }

    .detail-list__label {
        min-width: 8rem;
    }

    /* Table column priority: hide tertiary on tablet */
    .table-list-objects thead th.col-tertiary,
    .table-list-objects tfoot th.col-tertiary,
    .table-list-objects tbody td:nth-child(4),
    .table-list-objects tbody td:nth-child(7),
    .table-list-objects tbody td:nth-child(9),
    .table-list-objects tbody td:nth-child(10) {
        display: none !important;
    }

    .table-list-rgz thead th.col-tertiary,
    .table-list-rgz tfoot th.col-tertiary,
    .table-list-rgz tbody td:nth-child(6) {
        display: none !important;
    }
}

/* ========== Responsive: Mobile (< 768px) ========== */
@media (max-width: 767px) {
    :root {
        --section-gap: 1.25rem;
        --card-padding: 1rem 1rem;
    }

    .page-title {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    .page-title--hero {
        font-size: 1.35rem;
    }

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

    .card-modern .card-body {
        padding: var(--card-padding);
    }

    .card-modern .card-header {
        padding: 0.6rem 1rem;
        font-size: 1rem;
    }

    .section-card {
        margin-bottom: var(--section-gap);
    }

    .form-section .form-group {
        margin-bottom: 0.85rem;
    }

    /* Forms: single column, full-width inputs */
    .form-group.row {
        margin-left: 0;
        margin-right: 0;
    }

    .form-group.row .col-form-label,
    .form-group.row .col-md-6,
    .form-group.row .col-sm-4,
    .form-group.row [class^="col-"] {
        max-width: 100%;
        flex: 0 0 100%;
        padding-left: 0;
        padding-right: 0;
        text-align: left !important;
    }

    .form-group.row .col-form-label {
        margin-bottom: 0.25rem;
    }

    .table-panel .card-body {
        padding: 0.75rem 1rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-panel .table {
        font-size: 0.8125rem;
        min-width: 600px;
    }

    .table-panel .table-modern {
        min-width: 0;
    }

    .table-panel .table-modern thead th,
    .table-panel .table-modern tfoot th {
        padding: 0.6rem 0.75rem;
    }

    .table-panel .table-modern tbody td {
        padding: 0.65rem 0.75rem;
    }

    /* Table column priority: hide secondary + tertiary on mobile */
    .table-list-objects thead th.col-secondary,
    .table-list-objects tfoot th.col-secondary,
    .table-list-objects tbody td:nth-child(5),
    .table-list-objects tbody td:nth-child(8) {
        display: none !important;
    }

    .table-list-rgz thead th.col-secondary,
    .table-list-rgz tfoot th.col-secondary,
    .table-list-rgz tbody td:nth-child(5) {
        display: none !important;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding: 0.75rem 0;
    }

    .toolbar .btn,
    .toolbar .link-button,
    .toolbar a.btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    .btn-action-primary {
        min-width: 0;
        width: 100%;
    }

    .search-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding: 0.75rem 0;
    }

    .search-actions .btn-primary {
        min-width: 0;
        width: 100%;
        min-height: 44px;
    }

    .detail-list__row {
        flex-direction: column;
        gap: 0.25rem;
        padding: 0.5rem 0;
    }

    .detail-list__label {
        min-width: 0;
    }
}
