/* ============================================================
   Računovodstvo – Global Design System
   Professional dark mode for Laravel Filament v3
   ============================================================ */

/* ── CSS Custom Properties ── */
:root {
    --ds-surface:         rgba(255, 255, 255, 0.04);
    --ds-surface-border:  rgba(255, 255, 255, 0.07);
    --ds-surface-hover:   rgba(255, 255, 255, 0.06);

    --ds-blue-bg:         rgba(59, 130, 246, 0.12);
    --ds-blue-border:     rgba(59, 130, 246, 0.30);
    --ds-blue-label:      #60a5fa;
    --ds-blue-value:      #93c5fd;
    --ds-blue-glow:       rgba(59, 130, 246, 0.15);

    --ds-green-bg:        rgba(34, 197, 94, 0.10);
    --ds-green-border:    rgba(34, 197, 94, 0.25);
    --ds-green-label:     #4ade80;
    --ds-green-value:     #86efac;
    --ds-green-glow:      rgba(34, 197, 94, 0.12);

    --ds-red-bg:          rgba(239, 68, 68, 0.10);
    --ds-red-border:      rgba(239, 68, 68, 0.25);
    --ds-red-label:       #f87171;
    --ds-red-value:       #fca5a5;
    --ds-red-glow:        rgba(239, 68, 68, 0.12);

    --ds-orange-bg:       rgba(249, 115, 22, 0.10);
    --ds-orange-border:   rgba(249, 115, 22, 0.25);
    --ds-orange-label:    #fb923c;
    --ds-orange-value:    #fdba74;
    --ds-orange-glow:     rgba(249, 115, 22, 0.12);

    --ds-purple-bg:       rgba(168, 85, 247, 0.10);
    --ds-purple-border:   rgba(168, 85, 247, 0.25);
    --ds-purple-label:    #c084fc;
    --ds-purple-value:    #d8b4fe;
    --ds-purple-glow:     rgba(168, 85, 247, 0.12);

    --ds-text-label:      #94a3b8;
    --ds-text-value:      #e2e8f0;
    --ds-text-sub:        #64748b;
    --ds-text-muted:      #475569;

    --ds-radius:          14px;
    --ds-radius-sm:       10px;
    --ds-radius-lg:       18px;
    --ds-padding:         22px 24px;
    --ds-padding-sm:      16px 18px;
    --ds-transition:      0.2s ease;
}

/* ── Prevent horizontal overflow everywhere ── */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}
.fi-main-ctn,
.fi-page,
.fi-page-content,
.fi-page-content-ctn {
    max-width: 100%;
    overflow-x: hidden;
}

/* ── Base Font Improvements ── */
.fi-sidebar,
.fi-main,
.fi-header {
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   DS-CARD Component System
   ============================================================ */

.ds-card {
    border-radius: var(--ds-radius);
    background: var(--ds-surface);
    border: 1px solid var(--ds-surface-border);
    padding: var(--ds-padding);
    transition: transform var(--ds-transition), box-shadow var(--ds-transition);
}
.ds-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.ds-card-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ds-text-label);
    margin-bottom: 10px;
}
.ds-card-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--ds-text-value);
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}
.ds-card-sub {
    font-size: 12px;
    color: var(--ds-text-sub);
    line-height: 1.4;
}
.ds-card-icon {
    font-size: 28px;
    margin-bottom: 12px;
    display: block;
    opacity: 0.85;
}

/* Color Variants */
.ds-card-blue {
    background: var(--ds-blue-bg);
    border-color: var(--ds-blue-border);
}
.ds-card-blue:hover {
    box-shadow: 0 8px 28px var(--ds-blue-glow), 0 0 0 1px var(--ds-blue-border);
}
.ds-card-blue .ds-card-label { color: var(--ds-blue-label); }
.ds-card-blue .ds-card-value { color: var(--ds-blue-value); }

.ds-card-green {
    background: var(--ds-green-bg);
    border-color: var(--ds-green-border);
}
.ds-card-green:hover {
    box-shadow: 0 8px 28px var(--ds-green-glow), 0 0 0 1px var(--ds-green-border);
}
.ds-card-green .ds-card-label { color: var(--ds-green-label); }
.ds-card-green .ds-card-value { color: var(--ds-green-value); }

.ds-card-red {
    background: var(--ds-red-bg);
    border-color: var(--ds-red-border);
}
.ds-card-red:hover {
    box-shadow: 0 8px 28px var(--ds-red-glow), 0 0 0 1px var(--ds-red-border);
}
.ds-card-red .ds-card-label { color: var(--ds-red-label); }
.ds-card-red .ds-card-value { color: var(--ds-red-value); }

.ds-card-orange {
    background: var(--ds-orange-bg);
    border-color: var(--ds-orange-border);
}
.ds-card-orange:hover {
    box-shadow: 0 8px 28px var(--ds-orange-glow), 0 0 0 1px var(--ds-orange-border);
}
.ds-card-orange .ds-card-label { color: var(--ds-orange-label); }
.ds-card-orange .ds-card-value { color: var(--ds-orange-value); }

.ds-card-purple {
    background: var(--ds-purple-bg);
    border-color: var(--ds-purple-border);
}
.ds-card-purple:hover {
    box-shadow: 0 8px 28px var(--ds-purple-glow), 0 0 0 1px var(--ds-purple-border);
}
.ds-card-purple .ds-card-label { color: var(--ds-purple-label); }
.ds-card-purple .ds-card-value { color: var(--ds-purple-value); }

/* Highlight variant (2px border + stronger glow) */
.ds-card-highlight {
    border-width: 2px;
}
.ds-card-orange.ds-card-highlight {
    border-color: rgba(249, 115, 22, 0.50);
    background: rgba(249, 115, 22, 0.16);
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.10);
}
.ds-card-green.ds-card-highlight {
    border-color: rgba(34, 197, 94, 0.50);
    background: rgba(34, 197, 94, 0.16);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.10);
}
.ds-card-blue.ds-card-highlight {
    border-color: rgba(59, 130, 246, 0.50);
    background: rgba(59, 130, 246, 0.16);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.10);
}
.ds-card-purple.ds-card-highlight {
    border-color: rgba(168, 85, 247, 0.50);
}

/* ── DS-GRID ── */
.ds-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
.ds-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}
@media (max-width: 1024px) {
    .ds-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .ds-grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .ds-grid-4, .ds-grid-3 { grid-template-columns: 1fr; }
}

/* ============================================================
   Glassmorphism Info Panel
   ============================================================ */

.ds-info-panel {
    border-radius: var(--ds-radius);
    background: rgba(59, 130, 246, 0.07);
    border: 1px solid rgba(59, 130, 246, 0.20);
    padding: 18px 22px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.ds-info-panel-title {
    font-size: 14px;
    font-weight: 700;
    color: #93c5fd;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ds-info-panel ul {
    margin: 0;
    padding-left: 18px;
    space-y: 4px;
}
.ds-info-panel li {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.6;
    margin-bottom: 4px;
}
.ds-info-panel li strong {
    color: #bfdbfe;
}
.ds-info-panel-footer {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(59, 130, 246, 0.15);
    font-size: 12px;
    color: #7dd3fc;
}
.ds-info-panel-footer strong {
    color: #93c5fd;
}

/* ============================================================
   Pill Tabs
   ============================================================ */

.ds-tabs {
    display: flex;
    gap: 6px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    width: fit-content;
}
.ds-tab-btn {
    padding: 8px 20px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background var(--ds-transition), color var(--ds-transition), box-shadow var(--ds-transition);
    outline: none;
    white-space: nowrap;
}
.ds-tab-btn-active {
    background: rgba(59, 130, 246, 0.20);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.35);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}
.ds-tab-btn-inactive {
    background: transparent;
    color: #64748b;
    border: 1px solid transparent;
}
.ds-tab-btn-inactive:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #94a3b8;
}

/* ============================================================
   DS-TABLE
   ============================================================ */

.ds-table-wrap {
    overflow-x: auto;
    border-radius: var(--ds-radius);
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.02);
}
.ds-table {
    min-width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.ds-table thead tr {
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.ds-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #64748b;
    white-space: nowrap;
}
.ds-table thead th.text-right { text-align: right; }
.ds-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background var(--ds-transition);
}
.ds-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.015);
}
.ds-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.06);
}
.ds-table tbody td {
    padding: 10px 16px;
    color: #cbd5e1;
    vertical-align: middle;
}
.ds-table tbody td.text-right { text-align: right; }
.ds-table tbody td.text-muted { color: #475569; }
.ds-table tbody td.font-mono  { font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace; font-size: 12px; }
.ds-table tbody td.font-semibold { font-weight: 600; color: #e2e8f0; }
.ds-table tfoot tr {
    background: rgba(255, 255, 255, 0.04);
    border-top: 2px solid rgba(255, 255, 255, 0.10);
}
.ds-table tfoot td {
    padding: 12px 16px;
    font-weight: 700;
    font-size: 13px;
    color: #e2e8f0;
}
.ds-table tfoot td.text-right { text-align: right; }
.ds-table-empty {
    text-align: center;
    padding: 32px 16px;
    color: #475569;
    font-size: 13px;
}

/* ── Status Badges ── */
.ds-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.ds-badge-green {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.25);
}
.ds-badge-blue {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.25);
}
.ds-badge-orange {
    background: rgba(249, 115, 22, 0.15);
    color: #fb923c;
    border: 1px solid rgba(249, 115, 22, 0.25);
}
.ds-badge-yellow {
    background: rgba(234, 179, 8, 0.15);
    color: #facc15;
    border: 1px solid rgba(234, 179, 8, 0.25);
}
.ds-badge-red {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

/* ── Section Titles ── */
.ds-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #94a3b8;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.ds-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: currentColor;
    opacity: 0.15;
}

/* ── Divider ── */
.ds-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin: 0;
}

/* ── Legend bar ── */
.ds-legend {
    border-radius: var(--ds-radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 12px 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    font-size: 12px;
    color: var(--ds-text-sub);
    align-items: center;
}
.ds-legend a {
    color: #60a5fa;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.ds-legend-sep {
    color: rgba(255,255,255,0.12);
}

/* ============================================================
   Filament Table Overrides (fi-ta-*)
   ============================================================ */

/* Header cells */
.fi-ta-header-cell {
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
    color: #64748b !important;
}

/* Row hover */
.fi-ta-row:hover {
    background: rgba(59, 130, 246, 0.05) !important;
    transition: background 0.15s ease;
}

/* Table zebra effect */
.fi-ta-row:nth-child(even) {
    background: rgba(255, 255, 255, 0.015);
}

/* Actions visibility */
.fi-ta-actions {
    opacity: 0.55;
    transition: opacity 0.15s ease;
}
.fi-ta-row:hover .fi-ta-actions {
    opacity: 1;
}

/* Action buttons enhanced */
.fi-ac-btn-action {
    transition: transform 0.15s ease, opacity 0.15s ease !important;
}
.fi-ac-btn-action:hover {
    transform: scale(1.08);
}

/* Table container */
.fi-ta-ctn {
    border-radius: 14px !important;
    overflow: hidden;
}

/* Footer total row */
.fi-ta-footer-row {
    font-weight: 700 !important;
    background: rgba(255, 255, 255, 0.04) !important;
}

/* ============================================================
   Global page spacing improvements
   ============================================================ */

/* Consistent spacing in custom pages */
.fi-page > .fi-page-content > .fi-page-content-ctn > * + * {
    margin-top: 1.25rem;
}

/* Select dropdowns in dark mode */
.ds-status-select {
    font-size: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    padding: 4px 28px 4px 10px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: border-color 0.2s ease;
}
.ds-status-select:focus {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.ds-status-select-open {
    background-color: rgba(234, 179, 8, 0.12);
    color: #fde68a;
    border-color: rgba(234, 179, 8, 0.30);
}
.ds-status-select-submitted {
    background-color: rgba(34, 197, 94, 0.12);
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.30);
}
.ds-status-select-paid {
    background-color: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.30);
}

/* Delete button */
.ds-btn-delete {
    font-size: 12px;
    color: #f87171;
    background: none;
    border: none;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
}
.ds-btn-delete:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

/* ── Warning boxes ── */
.ds-warn-yellow {
    margin-top: 14px;
    font-size: 12.5px;
    background: rgba(234, 179, 8, 0.08);
    border: 1px solid rgba(234, 179, 8, 0.25);
    border-radius: 10px;
    padding: 12px 16px;
    color: #fde68a;
    line-height: 1.65;
}
.ds-warn-purple {
    margin-top: 8px;
    font-size: 12px;
    color: #c4b5fd;
    background: rgba(124, 58, 237, 0.10);
    border-radius: 10px;
    padding: 10px 14px;
    border: 1px solid rgba(167, 139, 250, 0.20);
}
.ds-warn-purple a { color: #a78bfa; text-decoration: underline; }

/* KPO table colored header segments */
.ds-th-green  { color: #4ade80 !important; }
.ds-th-red    { color: #f87171 !important; }
.ds-th-orange { color: #fb923c !important; }
.ds-th-blue   { color: #60a5fa !important; }
.ds-th-muted  { font-size: 10px; font-weight: 400; color: #475569; display: block; margin-top: 2px; letter-spacing: 0.02em; text-transform: none; }

/* ── Filament record row status colors (dark mode) ── */
.fi-ta-row.row-sent     { background: rgba(59, 130, 246, 0.06) !important; }
.fi-ta-row.row-paid     { background: rgba(34, 197, 94, 0.07) !important; }
.fi-ta-row.row-cancelled{ background: rgba(239, 68, 68, 0.06) !important; opacity: 0.65; }
.fi-ta-row.row-approved { background: rgba(34, 197, 94, 0.06) !important; }

/* Stat widget cards above tables — fix light backgrounds */
.fi-wi-stats-overview-stat {
    background: rgba(255,255,255,0.04) !important;
    border-color: rgba(255,255,255,0.08) !important;
}

/* ── Stat card components ── */
.ds-card {
    border-radius: 13px;
    padding: 18px 20px;
    border: 1px solid;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.ds-card:hover { transform: translateY(-2px); }
.ds-card-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 9px; }
.ds-card-value { font-size: 24px; font-weight: 700; line-height: 1.15; margin-bottom: 5px; letter-spacing: -.02em; }
.ds-card-sub   { font-size: 11.5px; color: #475569; }
.ds-card-year  { font-size: 11px; color: #475569; margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.06); }
.ds-card-year strong { color: #94a3b8; }

.ds-card-blue   { background: rgba(59,130,246,.10); border-color: rgba(59,130,246,.28); }
.ds-card-blue   .ds-card-label { color: #60a5fa; }
.ds-card-blue   .ds-card-value { color: #93c5fd; }
.ds-card-blue:hover   { box-shadow: 0 8px 24px rgba(59,130,246,.12); }

.ds-card-green  { background: rgba(34,197,94,.10); border-color: rgba(34,197,94,.25); }
.ds-card-green  .ds-card-label { color: #4ade80; }
.ds-card-green  .ds-card-value { color: #86efac; }
.ds-card-green:hover  { box-shadow: 0 8px 24px rgba(34,197,94,.12); }

.ds-card-red    { background: rgba(239,68,68,.10); border-color: rgba(239,68,68,.25); }
.ds-card-red    .ds-card-label { color: #f87171; }
.ds-card-red    .ds-card-value { color: #fca5a5; }
.ds-card-red:hover    { box-shadow: 0 8px 24px rgba(239,68,68,.12); }

.ds-card-orange { background: rgba(249,115,22,.10); border-color: rgba(249,115,22,.25); }
.ds-card-orange .ds-card-label { color: #fb923c; }
.ds-card-orange .ds-card-value { color: #fdba74; }
.ds-card-orange:hover { box-shadow: 0 8px 24px rgba(249,115,22,.12); }

.ds-card-purple { background: rgba(168,85,247,.10); border-color: rgba(168,85,247,.25); }
.ds-card-purple .ds-card-label { color: #c084fc; }
.ds-card-purple .ds-card-value { color: #d8b4fe; }
.ds-card-purple:hover { box-shadow: 0 8px 24px rgba(168,85,247,.12); }

/* FURS badge inside card */
.ds-card-furs   { display: inline-block; border-radius: 6px; padding: 3px 10px; font-size: 12px; font-weight: 600; margin-top: 6px; }
.ds-furs-pay    { background: rgba(249,115,22,.15); color: #fdba74; }
.ds-furs-ret    { background: rgba(34,197,94,.15);  color: #86efac; }

/* Info notice (DDV opomba) */
.ds-info-notice {
    border-radius: 10px;
    background: rgba(59,130,246,0.07);
    border: 1px solid rgba(59,130,246,0.18);
    padding: 10px 16px;
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 4px;
    line-height: 1.6;
}
.ds-info-notice strong { color: #60a5fa; }
