html, body {
    height: 100%;
    overflow: hidden;
    font-family: Inter, 'Segoe UI', Helvetica, Arial, sans-serif;
    background: #f5f7ff;
    color: #1d2749;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

body {
    margin: 0;
}

a, .btn-link {
    color: #635bff;
}

.content {
    padding-top: 0;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]):not(.login-input) {
    outline: 1px solid #26b050;
}

.invalid:not(.login-input) {
    outline: 1px solid #e50000;
}

.login-input.valid,
.login-input.modified,
.login-input.invalid {
    outline: none !important;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEz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eat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.dashboard-preview {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.metric-card,
.panel {
    background: #fff;
    border: 1px solid #edf0fb;
    border-radius: 24px;
    box-shadow: 0 16px 36px rgba(102, 112, 154, 0.08);
}

.metric-card {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.metric-label,
.panel-heading span,
.list-item span,
th {
    color: #8c93b3;
}

.metric-card strong {
    font-size: 1.7rem;
    line-height: 1.1;
    color: #18213f;
}

.metric-trend {
    font-size: 0.88rem;
    font-weight: 600;
}

.metric-trend.positive {
    color: #0f9d6c;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(280px, 1fr);
    gap: 1rem;
}

.panel {
    padding: 1.25rem;
}

.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.panel-heading h2 {
    margin: 0;
    font-size: 1.08rem;
    color: #18213f;
}

.panel-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #0f9d6c;
    background: #ebfff6;
}

.chart-placeholder {
    height: 280px;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: end;
    gap: 0.65rem;
    padding: 1rem 0.5rem 0.25rem;
    background: linear-gradient(180deg, #fcfcff 0%, #f5f7ff 100%);
    border-radius: 20px;
}

.chart-placeholder span {
    display: block;
    border-radius: 999px 999px 10px 10px;
    background: linear-gradient(180deg, #cfd6f7 0%, #a7b1ea 100%);
}

.chart-placeholder span:nth-child(1) { height: 35%; }
.chart-placeholder span:nth-child(2) { height: 48%; }
.chart-placeholder span:nth-child(3) { height: 42%; }
.chart-placeholder span:nth-child(4) { height: 58%; }
.chart-placeholder span:nth-child(5) { height: 64%; }
.chart-placeholder span:nth-child(6) { height: 60%; }
.chart-placeholder span:nth-child(7) { height: 72%; }
.chart-placeholder span:nth-child(8) { height: 66%; }
.chart-placeholder span:nth-child(9) { height: 80%; }
.chart-placeholder span:nth-child(10) { height: 74%; }
.chart-placeholder span:nth-child(11) { height: 88%; }
.chart-placeholder span:nth-child(12) { height: 82%; }

.side-panel {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid #edf0fb;
}

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

.list-item strong {
    display: block;
}

.orders-panel a {
    text-decoration: none;
    font-weight: 600;
}

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

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

th,
td {
    padding: 0.95rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #edf0fb;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.order-status {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
}

.order-status.done {
    color: #0f9d6c;
    background: #ebfff6;
}

.order-status.pending {
    color: #b77a10;
    background: #fff8e8;
}

.dark-theme .metric-card,
.dark-theme .panel {
    background: #16213c;
    border-color: #263557;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
}

.dark-theme .metric-label,
.dark-theme .panel-heading span,
.dark-theme .list-item span,
.dark-theme th {
    color: #98a5ca;
}

.dark-theme .metric-card strong,
.dark-theme .panel-heading h2,
.dark-theme .list-item strong,
.dark-theme td {
    color: #eef3ff;
}

.dark-theme .chart-placeholder {
    background: linear-gradient(180deg, #111a31 0%, #16213c 100%);
}

.dark-theme .chart-placeholder span {
    background: linear-gradient(180deg, #6f7ed9 0%, #4b5fb8 100%);
}

.dark-theme .list-item,
.dark-theme th,
.dark-theme td {
    border-bottom-color: #263557;
}

.dark-theme .orders-panel a {
    color: #aebdff;
}

.dark-theme .order-status.done {
    color: #7ff1c0;
    background: rgba(30, 112, 82, 0.24);
}

.dark-theme .order-status.pending {
    color: #ffd580;
    background: rgba(148, 101, 18, 0.22);
}

@media (max-width: 1100px) {
    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 640px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}
/* ================================================================
   SIDEBAR NAV  (global – NavLink renders <a> outside CSS isolation)
   ================================================================ */
.sidebar-item {
    position: relative;
    width: 100%;
}

.sidebar-link {
    display: flex !important;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    height: 42px;
    min-height: 42px;
    padding: 0 1.1rem 0 1.7rem;
    border-radius: 14px;
    text-decoration: none !important;
    color: #50607f;
    font-size: 0.93rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1;
    cursor: pointer;
    position: relative;
    overflow: visible;
    background-color: transparent;
    border: none;
    box-shadow: none;
    transition: background-color 0.18s ease, color 0.18s ease,
                box-shadow 0.18s ease, transform 0.15s ease;
}

/* icon wrapper */
.sbi {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.3rem;
    height: 1.3rem;
    opacity: 0.55;
    transition: opacity 0.18s ease;
}

.sbi::before,
.sbi::after {
    content: none !important;
    display: none !important;
}

.sbi svg {
    width: 1.3rem;
    height: 1.3rem;
    display: block;
    flex-shrink: 0;
}

.sbt {
    display: inline-block;
    white-space: nowrap;
}

.sidebar-link:hover {
    color: #2a3758;
    background: #eef1f9;
    box-shadow: 0 2px 10px rgba(44, 55, 90, 0.08);
    transform: translateX(3px);
}

.sidebar-link:hover .sbi {
    opacity: 1;
}

.sidebar-link.active {
    color: #ffffff !important;
    background: linear-gradient(135deg, #3b28cc 0%, #2d1f99 100%) !important;
    box-shadow: 0 8px 24px rgba(48, 33, 150, 0.3) !important;
    transform: translateX(5px);
    height: 42px;
    min-height: 42px;
    text-decoration: none !important;
    font-size: 0.95rem;
}

.sidebar-link.active .sbi {
    opacity: 1;
}

/* dark theme */
html.dark-theme .sidebar-link {
    color: #9daace;
}

html.dark-theme .sidebar-link:hover {
    color: #e8edff;
    background: #1a2746;
    box-shadow: 0 4px 12px rgba(10, 18, 37, 0.28);
}

html.dark-theme .sidebar-link.active {
    background: linear-gradient(135deg, #4a5ce8 0%, #3d4ed4 100%) !important;
    box-shadow: 0 8px 22px rgba(38, 49, 180, 0.38) !important;
}

/* ── sidebar collapsed state ─────────────────────────────────────── */
html.sidebar-collapsed .sidebar-link {
    padding: 0 !important;
    width: 42px !important;
    justify-content: center !important;
    border-radius: 12px;
    gap: 0;
    transform: none !important;
    margin-left: auto;
    margin-right: auto;
}

html.sidebar-collapsed .sidebar-link:hover {
    transform: none !important;
}

html.sidebar-collapsed .sbt {
    display: none !important;
    width: 0;
    overflow: hidden;
}

html.sidebar-collapsed .sbi {
    opacity: 0.7;
    margin: 0;
}

html.sidebar-collapsed .sidebar-link:hover .sbi,
html.sidebar-collapsed .sidebar-link.active .sbi {
    opacity: 1;
}

html.sidebar-collapsed .sidebar-item {
    display: flex;
    justify-content: center;
    width: 100%;
}

/* hide brand text, keep logo mark */
html.sidebar-collapsed .navbar-brand {
    display: none !important;
}

html.sidebar-collapsed .brand-panel {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

html.sidebar-collapsed .brand-mark {
    margin: 0 auto;
}

html.sidebar-collapsed .nav-sections {
    align-items: center;
}

html.dark-theme .sidebar-link.active::before {
    background: rgba(220, 228, 255, 0.95);
}

/* ── Collapsed sidebar tooltip ───────────────────────────────────── */
html.sidebar-collapsed .sidebar-link {
    position: relative;
}

html.sidebar-collapsed .sidebar-link::after {
    content: attr(title);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: #2a3758;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    padding: 0.3rem 0.7rem;
    border-radius: 8px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 9999;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}

html.sidebar-collapsed .sidebar-link:hover::after {
    opacity: 1;
}

html.dark-theme.sidebar-collapsed .sidebar-link::after {
    background: #3d4ed4;
    box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}

/* ================================================================
   DARK THEME — SIDEBAR & TOPBAR
   ================================================================ */
html.dark-theme .sidebar {
    background: #0f172a;
    border-right-color: #1e2d4a;
}

html.dark-theme .topbar {
    background: #0f172a;
    border-bottom-color: #1e2d4a;
}

html.dark-theme .search-shell {
    background: #1a2746;
    border-color: #2a3b5e;
}

html.dark-theme .search-input {
    color: #c5cfea;
}

html.dark-theme .search-input::placeholder {
    color: #5a6a8a;
}

html.dark-theme .icon-button {
    background: #1a2746;
    border-color: #2a3b5e;
    color: #9daace;
}

html.dark-theme .icon-button:hover {
    background: #243258;
    border-color: #3d4ed4;
}

html.dark-theme .theme-toggle-label {
    color: #9daace;
}

html.dark-theme .surface-title {
    color: #e6ebff;
}

html.dark-theme .breadcrumb-shell {
    color: #5a6a8a;
}

/* ================================================================
   DARK THEME — TOPBAR USER
   ================================================================ */
html.dark-theme .topbar-user {
    background: #1a2746;
    border-color: #2a3b5e;
}

html.dark-theme .topbar-user-name {
    color: #c5cfea;
}

/* ================================================================
   DARK THEME — BM TABLE (Kompanije, Korisnici, ...)
   NOTE: Per-component overrides are in each .razor.css file
   ================================================================ */

/* ================================================================
   CSS VARIABLES — BM COMPONENTS
   ================================================================ */
:root {
    --bm-surface:             #ffffff;
    --bm-surface-raised:      #f5f7ff;
    --bm-surface-modal:       #ffffff;
    --bm-border:              #e8edf5;
    --bm-border-subtle:       #f0f3fb;
    --bm-text-primary:        #2f3d63;
    --bm-text-secondary:      #6b7494;
    --bm-text-muted:          #8c93b3;
    --bm-text-placeholder:    #b0b7ca;
    --bm-row-hover:           #f5f7ff;
    --bm-row-selected:        #eef1ff;
    --bm-scrollbar-thumb:     #d1d9ef;
    --bm-search-bg:           #ffffff;
    --bm-search-border:       #e2e8f0;
    --bm-skeleton-from:       #edf0fb;
    --bm-skeleton-to:         #f5f7ff;
    --bm-sortable-hover:      #5468ff;
}

html.dark-theme {
    --bm-surface:             #0f172a;
    --bm-surface-raised:      #111f38;
    --bm-surface-modal:       #111f38;
    --bm-border:              #1e2d4a;
    --bm-border-subtle:       #1a2746;
    --bm-text-primary:        #c5cfea;
    --bm-text-secondary:      #7a8db5;
    --bm-text-muted:          #5a6a8a;
    --bm-text-placeholder:    #5a6a8a;
    --bm-row-hover:           #1a2746;
    --bm-row-selected:        #1e3160;
    --bm-scrollbar-thumb:     #2a3b5e;
    --bm-search-bg:           #1a2746;
    --bm-search-border:       #2a3b5e;
    --bm-skeleton-from:       #1a2746;
    --bm-skeleton-to:         #243258;
    --bm-sortable-hover:      #7e8fff;
}

/* ================================================================
   DARK THEME — BM MODAL
   NOTE: Per-component overrides are in each .razor.css file
   ================================================================ */

/* ================================================================
   DARK THEME — FORM CONTROLS (global)
   ================================================================ */
html.dark-theme .form-control,
html.dark-theme .form-select {
    background: #1a2746;
    border-color: #2a3b5e;
    color: #c5cfea;
}

html.dark-theme .form-control:focus,
html.dark-theme .form-select:focus {
    background: #1e2d4a;
    border-color: #5468ff;
    color: #e6ebff;
}

html.dark-theme .form-control:disabled,
html.dark-theme .form-select:disabled {
    background: #111f38;
    color: #5a6a8a;
}

/* ================================================================
   DARK THEME — NAVBAR (NavMenu CSS isolation overrides)
   ================================================================ */
html.dark-theme .brand-mark {
    background: linear-gradient(135deg, #4a5ce8 0%, #3d4ed4 100%);
}

/* ================================================================
   LOGIN / REGISTER  –  consolidated global styles
   ================================================================ */

.login-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.login-input,
input.login-input {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    height: 2.85rem !important;
    padding: 0 0.9rem 0 2.9rem !important;
    border-radius: 10px !important;
    font-size: 0.95rem !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
    outline: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    background: #eef1fb !important;
    color: #2f3d63 !important;
    border: 1px solid #c8d0e8 !important;
    box-shadow: none !important;
    -webkit-text-fill-color: #2f3d63 !important;
}

.login-input--password,
input.login-input--password {
    padding-right: 3.2rem !important;
}

.login-input::placeholder,
input.login-input::placeholder {
    color: #9ba4c0 !important;
    opacity: 1 !important;
}

.login-input:focus,
input.login-input:focus {
    background: #eef1fb !important;
    color: #2f3d63 !important;
    -webkit-text-fill-color: #2f3d63 !important;
    border-color: #5468ff !important;
    box-shadow: 0 0 0 3px rgba(84, 104, 255, 0.13) !important;
}

.login-input:-webkit-autofill,
.login-input:-webkit-autofill:hover,
.login-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #eef1fb inset !important;
    -webkit-text-fill-color: #2f3d63 !important;
}

html.dark-theme .login-input,
html.dark-theme input.login-input {
    background: #0e1c35 !important;
    color: #c5cfea !important;
    border: 1px solid #243457 !important;
    -webkit-text-fill-color: #c5cfea !important;
    box-shadow: none !important;
}

html.dark-theme .login-input::placeholder,
html.dark-theme input.login-input::placeholder {
    color: #5a6a8a !important;
    opacity: 1 !important;
}

html.dark-theme .login-input:focus,
html.dark-theme input.login-input:focus {
    background: #0e1c35 !important;
    color: #c5cfea !important;
    -webkit-text-fill-color: #c5cfea !important;
    border-color: #5468ff !important;
    box-shadow: 0 0 0 3px rgba(84, 104, 255, 0.18) !important;
}

html.dark-theme .login-input:-webkit-autofill,
html.dark-theme .login-input:-webkit-autofill:hover,
html.dark-theme .login-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #0e1c35 inset !important;
    -webkit-text-fill-color: #c5cfea !important;
}

/* ── Eye toggle button ────────────────────────────────────────── */
.login-eye {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none !important;
    border-radius: 6px;
    cursor: pointer;
    background: transparent !important;
    color: #8c93b3;
    transition: color 0.15s ease, background 0.15s ease;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.login-eye:hover {
    color: #5468ff;
    background: rgba(84, 104, 255, 0.1) !important;
}

.login-eye svg {
    width: 1.1rem;
    height: 1.1rem;
    display: block;
    pointer-events: none;
}

html.dark-theme .login-eye {
    background: transparent !important;
    color: #7a8db5;
}

html.dark-theme .login-eye:hover {
    color: #a0afff;
    background: rgba(84, 104, 255, 0.15) !important;
}

/* ── Card dark override ───────────────────────────────────────── */
html.dark-theme .login-card {
    background: #0d1b2e !important;
    border-color: #1e2d4a !important;
    color: #c5cfea !important;
}

html.dark-theme .login-card__header h4 {
    color: #e4eaff !important;
}

html.dark-theme .login-label {
    color: #7a8db5 !important;
}
