/* CRM Remonti – jauns vizuālais stils, iedvesmots no gtkbaltais.lv */

:root {
    --repairs-bg: #0f172a;
    --repairs-bg-soft: #020617;
    --repairs-surface: #0b1120;
    --repairs-surface-soft: #111827;
    --repairs-border-subtle: rgba(148, 163, 184, 0.25);
    --repairs-primary: #22c55e;
    --repairs-primary-soft: rgba(34, 197, 94, 0.12);
    --repairs-primary-dark: #16a34a;
    --repairs-accent: #38bdf8;
    --repairs-text-main: #e5e7eb;
    --repairs-text-muted: #9ca3af;
    --repairs-danger: #ef4444;
    --repairs-warning: #f59e0b;
    --repairs-success: #22c55e;
    --repairs-radius-lg: 16px;
    --repairs-radius-md: 12px;
    --repairs-radius-sm: 10px;
    --repairs-shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.65);
}

body {
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #1e293b 0, #020617 45%, #000 100%);
    color: var(--repairs-text-main);
}

body.repairs-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.repairs-main {
    flex: 1;
    min-width: 0; /* nepārsniedz ekrāna platumu — saturs (tabulas) neizstiepj lapu */
    padding-top: 2rem;
    padding-bottom: 2.5rem;
}

/* Navigācija / header */

.repairs-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.repairs-navbar {
    background: radial-gradient(circle at top left, #22c55e 0, #16a34a 12%, #0f172a 42%, #020617 100%);
}

.repairs-navbar .navbar-brand {
    font-weight: 600;
    color: #f9fafb;
}

.repairs-logo-circle {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 20%, #bbf7d0 0, #22c55e 35%, #0f172a 100%);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.6), 0 18px 35px rgba(16, 185, 129, 0.55);
}

.repairs-logo-image {
    width: 34px;
    height: 34px;
    object-fit: contain;
    border-radius: 8px;
}

.repairs-logo-text {
    font-size: 1rem;
    letter-spacing: 0.02em;
}

.repairs-logo-subtext {
    font-size: 0.75rem;
    color: rgba(226, 232, 240, 0.8);
}

.repairs-navbar .nav-link {
    position: relative;
    font-size: 0.95rem;
    font-weight: 500;
    color: rgba(226, 232, 240, 0.75);
    padding-inline: 0.9rem;
}

.repairs-navbar .nav-link::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 4px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, #22c55e, #38bdf8);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.2s ease-out;
}

.repairs-navbar .nav-link:hover,
.repairs-navbar .nav-link:focus,
.repairs-navbar .nav-link.show,
.repairs-navbar .show > .nav-link {
    color: #f9fafb;
}

.repairs-navbar .nav-link.active {
    color: #f9fafb;
}

.repairs-navbar .nav-link.active::after {
    transform: scaleX(1);
}

/* Dropdown caret: reset Bootstrap's ::after caret so our underline works */
.repairs-navbar .dropdown-toggle::after {
    display: none;
}

/* Dropdown menu – dark theme */
.repairs-navbar .dropdown-menu {
    background: linear-gradient(160deg, #0f172a 0%, #020617 100%);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: var(--repairs-radius-md);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
    padding: 0.4rem 0;
}

.repairs-navbar .dropdown-item {
    color: rgba(226, 232, 240, 0.8);
    font-size: 0.9rem;
    padding: 0.45rem 1.1rem;
    transition: background 0.15s ease, color 0.15s ease;
}

.repairs-navbar .dropdown-item:hover,
.repairs-navbar .dropdown-item:focus {
    background-color: rgba(34, 197, 94, 0.12);
    color: #f9fafb;
}

.repairs-navbar .dropdown-item.active,
.repairs-navbar .dropdown-item:active {
    background-color: rgba(34, 197, 94, 0.2);
    color: #f9fafb;
}

.repairs-user-name {
    font-size: 0.9rem;
    color: rgba(226, 232, 240, 0.9);
}

.repairs-btn-logout {
    border-radius: 999px;
    border-width: 0;
    padding-inline: 1.1rem;
    padding-block: 0.45rem;
    font-size: 0.85rem;
    font-weight: 500;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.9));
    color: #e5e7eb;
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.45);
}

.repairs-btn-logout:hover {
    color: #fefce8;
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    box-shadow: 0 16px 35px rgba(239, 68, 68, 0.45);
}

.navbar-toggler {
    border-color: rgba(249, 250, 251, 0.45);
}

.navbar-toggler-icon {
    filter: invert(1);
}

/* Kartītes un virsraksti */

h1, h2, h3, h4 {
    color: #f9fafb;
    letter-spacing: 0.02em;
}

h1 {
    font-size: clamp(1.6rem, 2.2vw, 2rem);
}

.card {
    border-radius: var(--repairs-radius-lg);
    border: 1px solid var(--repairs-border-subtle);
    background: radial-gradient(circle at top left, rgba(34, 197, 94, 0.12), rgba(15, 23, 42, 0.96));
    box-shadow: var(--repairs-shadow-soft);
    color: var(--repairs-text-main);
}

.card-header {
    border-bottom-color: rgba(148, 163, 184, 0.25);
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.6));
    font-weight: 500;
    color: #e5e7eb;
}

.card.bg-secondary,
.card.bg-primary,
.card.bg-success,
.card.bg-warning,
.card.bg-info {
    background: radial-gradient(circle at top, rgba(34, 197, 94, 0.25), rgba(15, 23, 42, 0.98));
    border-color: rgba(34, 197, 94, 0.5);
}

.card.bg-warning {
    background: radial-gradient(circle at top, rgba(245, 158, 11, 0.25), rgba(15, 23, 42, 0.98));
    border-color: rgba(245, 158, 11, 0.6);
}

.card.bg-info {
    background: radial-gradient(circle at top, rgba(56, 189, 248, 0.25), rgba(15, 23, 42, 0.98));
    border-color: rgba(56, 189, 248, 0.6);
}

.display-6 {
    font-weight: 600;
}

/* Tabulas */

.table-responsive {
    border-radius: var(--repairs-radius-lg);
    overflow: hidden;
    box-shadow: var(--repairs-shadow-soft);
}

.table {
    margin-bottom: 0;
    color: #f9fafb !important;
}

.table th {
    white-space: nowrap;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.table thead.table-dark th {
    background: linear-gradient(90deg, #020617, #0f172a);
    border-bottom-color: rgba(148, 163, 184, 0.35);
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(15, 23, 42, 0.9);
}

.table-striped > tbody > tr:nth-of-type(even) > * {
    background-color: rgba(15, 23, 42, 0.7);
}

.table-hover > tbody > tr:hover > * {
    background-color: rgba(34, 197, 94, 0.08);
}

/* Remontu saraksta tabula – mazāks fonts, lai ietilpst 1920x1080 */

.repairs-page-wide {
    margin-left: 0;
    margin-right: 0;
    padding-left: 18px;
    padding-right: 18px;
}

.repairs-table-wrapper {
    overflow-x: auto;
}

.repairs-table {
    font-size: 0.8rem !important;
    table-layout: fixed;
    width: 100%;
}

.repairs-table th,
.repairs-table td {
    padding: 0.32rem 0.4rem !important;
    vertical-align: middle;
}

.repairs-table th {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: none;
}

.repairs-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Pēdējā kolonna ar pogu vienmēr redzama */
.repairs-table th:last-child,
.repairs-table td:last-child {
    position: sticky;
    right: 0;
    z-index: 2;
    width: 5%;
    min-width: 5%;
    text-align: right;
}

.repairs-table th:last-child {
    z-index: 3;
    background: linear-gradient(90deg, #0f172a, #020617);
}

.repairs-table td:last-child {
    background-color: rgba(15, 23, 42, 0.92);
}

.repairs-table tbody tr:nth-of-type(even) td:last-child {
    background-color: rgba(15, 23, 42, 0.75);
}

/* Kolonnu platumi (Nr..Kopā..Poga) */
.repairs-table th:nth-child(1),
.repairs-table td:nth-child(1) { width: 6%; }
.repairs-table th:nth-child(2),
.repairs-table td:nth-child(2) { width: 10%; }
.repairs-table th:nth-child(3),
.repairs-table td:nth-child(3) { width: 10%; }
.repairs-table th:nth-child(4),
.repairs-table td:nth-child(4) { width: 22%; }
.repairs-table th:nth-child(5),
.repairs-table td:nth-child(5) { width: 20%; }
.repairs-table th:nth-child(6),
.repairs-table td:nth-child(6) { width: 11%; }
.repairs-table td:nth-child(6) .badge { font-weight: 400; }
.repairs-table th:nth-child(7),
.repairs-table td:nth-child(7) { width: 5%; }
.repairs-table th:nth-child(8),
.repairs-table td:nth-child(8) { width: 7%; }
.repairs-table th:nth-child(9),
.repairs-table td:nth-child(9) { width: 5%; }

.repairs-table .btn,
.parts-table .btn {
    font-size: 0.74rem;
    padding: 0.18rem 0.48rem;
}

.parts-table th:nth-child(1),
.parts-table td:nth-child(1) {
    width: 75%;
    max-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.parts-table th:last-child,
.parts-table td:last-child { width: 90px; text-align: right; }

.repairs-table-wrapper {
    box-shadow: var(--repairs-shadow-soft);
}

/* Remontu saraksts – saturs un galvenes obligāti gaišs */
.table thead th,
.table tbody td,
.table tbody td a {
    color: #f9fafb !important;
}

/* Izņēmums: rēķinu rindu saite „Rediģēt detaļu” (zaļa atzīme) */
.table tbody td a.line-edit-part-link.btn-outline-green {
    color: var(--repairs-primary) !important;
}
.table tbody td a.line-edit-part-link.btn-outline-green:hover {
    color: #fff !important;
}

/* Tabula kartē (Detaļas remonta skatā) – tumša, saskaņā ar tēmu */
.parts-table-view {
    background-color: transparent !important;
    color: #f9fafb !important;
    border-color: rgba(148, 163, 184, 0.35) !important;
}
.parts-table-view thead,
.parts-table-view tbody,
.parts-table-view tr,
.parts-table-view th,
.parts-table-view td {
    background-color: rgba(15, 23, 42, 0.9) !important;
    border-color: rgba(148, 163, 184, 0.35) !important;
    color: #f9fafb !important;
}
.parts-table-view tbody tr:nth-of-type(even) th,
.parts-table-view tbody tr:nth-of-type(even) td {
    background-color: rgba(15, 23, 42, 0.7) !important;
}
.parts-table-view tbody td a {
    color: #93c5fd !important;
}
.parts-table-view tbody td a:hover {
    color: #bfdbfe !important;
}

/* Detaļu tabula remonta izveides lapā – tumšs rāmis, bez baltas malas */

.parts-table {
    border-width: 0 !important;
}

.parts-table-wrapper {
    border-radius: var(--repairs-radius-md);
    box-shadow: none;
}

.parts-table > :not(caption) > * > * {
    border-color: rgba(55, 65, 81, 0.7);
}

/* Zaļi virsraksti visās tabulās */
.table thead th {
    color: #22c55e !important;
}

/* Piespiedu gaišs teksts tabulās (īpaši Lietotāji saraksts) */

.users-table th,
.users-table td,
.users-table .badge {
    color: #f9fafb !important;
}

.users-table tbody td a,
.users-table tbody td span,
.users-table tbody td button {
    color: #f9fafb !important;
}

.users-table tbody td .text-muted {
    color: rgba(209, 213, 219, 0.85) !important;
}

.users-table tbody tr > * {
    background-color: rgba(15, 23, 42, 0.9) !important;
    border-color: rgba(55, 65, 81, 0.9) !important;
}

/* Žetoni, statusi */

.badge {
    font-size: 0.8rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
}

.badge.bg-secondary {
    background-color: rgba(148, 163, 184, 0.25) !important;
    color: #e5e7eb;
}

.badge.bg-success {
    background-color: rgba(34, 197, 94, 0.2) !important;
    color: #bbf7d0;
}

.badge.bg-warning {
    background-color: rgba(245, 158, 11, 0.25) !important;
    color: #fef3c7;
}

.badge.bg-info {
    background-color: rgba(56, 189, 248, 0.25) !important;
    color: #e0f2fe;
}

/* Pogas un formas */

.btn-primary {
    border-radius: 6px;
    border-width: 0;
    background: linear-gradient(135deg, var(--repairs-primary), var(--repairs-accent));
    box-shadow: 0 16px 35px rgba(34, 197, 94, 0.45);
    font-weight: 500;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--repairs-primary-dark), #22c55e);
    box-shadow: 0 18px 40px rgba(34, 197, 94, 0.6);
}

.btn-outline-primary {
    border-radius: 6px;
    border-color: var(--repairs-primary);
    color: #fff;
}

.btn-outline-primary:hover {
    background-color: var(--repairs-primary);
    border-color: var(--repairs-primary);
    color: #fff;
}

.btn-outline-secondary {
    border-radius: 6px;
    border-color: rgba(148, 163, 184, 0.7);
    color: #e5e7eb;
}

.btn-outline-secondary:hover {
    background-color: rgba(15, 23, 42, 0.9);
    color: #f9fafb;
}

.btn-outline-green {
    border-radius: 6px;
    border-color: var(--repairs-primary);
    color: #e5e7eb;
    background-color: transparent;
}

.btn-outline-green:hover {
    background-color: var(--repairs-primary);
    border-color: var(--repairs-primary);
    color: #fff;
}

/* Rēķinu rindu „Rediģēt detaļu”: zaļa atzīme iekš zaļās apmales */
.btn-outline-green.invoice-line-action-btn {
    color: var(--repairs-primary);
}
.btn-outline-green.invoice-line-action-btn:hover {
    color: #fff;
}

/* Зеленая рамка + белый текст (для "Печатать счёт") */
.btn-outline-green-white {
    border-radius: 6px;
    border-color: var(--repairs-primary);
    color: #fff;
    background-color: transparent;
}

.btn-outline-green-white:hover {
    background-color: var(--repairs-primary);
    border-color: var(--repairs-primary);
    color: #fff;
}

/* Таблица выбора детали */
.pick-parts-table {
    table-layout: fixed;
    width: 100%;
}

.pick-parts-table th,
.pick-parts-table td {
    color: #f9fafb !important;
    vertical-align: middle;
}

.pick-parts-table .pick-plus-col {
    width: 42px;
    padding-right: 2px;
    white-space: nowrap;
    position: relative;
    z-index: 5;
}
.pick-parts-table .pick-plus-col .btn {
    position: relative;
    z-index: 6;
    pointer-events: auto;
}

.pick-parts-table .pick-name-col {
    padding-left: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pick-parts-table th:nth-child(3) { width: 130px; }
.pick-parts-table th:nth-child(4) { width: 120px; }

/* Pārdošanas rēķins: «Izvēlēties detaļu» / «Izvēlēties pakalpojumu» — tabulas fonts kā rēķina Rindas */
.pick-parts-table.sales-invoice-pick-catalog thead th {
    text-transform: none !important;
    letter-spacing: normal;
    font-size: 0.85rem !important;
    padding-top: 0.3rem !important;
    padding-bottom: 0.3rem !important;
}
.pick-parts-table.sales-invoice-pick-catalog tbody td {
    font-size: 0.9rem !important;
    padding-top: 0.3rem !important;
    padding-bottom: 0.3rem !important;
}
.pick-parts-table.sales-invoice-pick-catalog tbody td .btn {
    font-size: 0.9rem !important;
    padding-top: 0.2rem !important;
    padding-bottom: 0.2rem !important;
}

/* Iepirkuma rēķins: kompaktāka izvēles tabula (zemāks augstums, mazāks fonts, bez UPPERCASE galvenēs) */
.pick-parts-table.purchase-invoice-pick-catalog thead th {
    text-transform: none !important;
    font-size: 0.8rem !important;
    padding-top: 0.22rem !important;
    padding-bottom: 0.22rem !important;
}
.pick-parts-table.purchase-invoice-pick-catalog tbody td {
    font-size: 0.85rem !important;
    padding-top: 0.22rem !important;
    padding-bottom: 0.22rem !important;
    line-height: 1.15;
}
.pick-parts-table.purchase-invoice-pick-catalog tbody td .btn {
    font-size: 0.8rem !important;
    padding-top: 0.12rem !important;
    padding-bottom: 0.12rem !important;
}

.form-control,
.form-select {
    border-radius: var(--repairs-radius-sm);
    border-color: rgba(148, 163, 184, 0.4);
    background-color: rgba(15, 23, 42, 0.9);
    color: var(--repairs-text-main);
}

/* Bootstrap [readonly] ir augstāka specifiskums — atgriežam tumšo fonu kā pārējiem laukiem */
.form-control[readonly] {
    background-color: rgba(15, 23, 42, 0.9);
    color: var(--repairs-text-main);
    opacity: 1;
}

/* Mazāki ievades lauki detaļu tabulā (Pievienot remontu) */

.parts-table .part-input.form-control-sm {
    border-radius: 6px;
    border-width: 1px;
    border-color: rgba(31, 41, 55, 0.9);
    background-color: rgba(15, 23, 42, 0.9);
}

.parts-table .part-input.form-control-sm:focus {
    border-color: rgba(34, 197, 94, 0.8);
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.6);
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(34, 197, 94, 0.8);
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.7);
    background-color: #020617;
    color: #f9fafb;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--repairs-text-muted);
}

.invalid-feedback {
    font-size: 0.8rem;
}

/* Login lapa */

body.login-page {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, #22c55e 0, #0f172a 40%, #020617 100%);
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.login-card {
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    background: radial-gradient(circle at top, rgba(34, 197, 94, 0.15), rgba(15, 23, 42, 0.98));
    box-shadow: var(--repairs-shadow-soft);
    color: var(--repairs-text-main);
}

.login-title {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Footer */

.repairs-footer {
    border-top: 1px solid rgba(148, 163, 184, 0.35);
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.92));
    color: var(--repairs-text-muted);
    font-size: 0.8rem;
}

.repairs-footer-brand {
    color: rgba(209, 213, 219, 0.9);
}

.repairs-footer-meta {
    color: rgba(148, 163, 184, 0.9);
}

/* Attēli */

.img-thumbnail {
    object-fit: cover;
    border-radius: var(--repairs-radius-md);
    border-color: rgba(148, 163, 184, 0.5);
    background-color: #020617;
}

/* Mazas pielāgošanas */

.text-muted {
    color: var(--repairs-text-muted) !important;
}

.list-group-item {
    background-color: rgba(15, 23, 42, 0.95);
    border-color: rgba(55, 65, 81, 0.7);
    color: var(--repairs-text-main);
}

/* Remonta kartītes lauku virsraksti */
.rv-label {
    color: #22c55e;
    font-weight: 600;
}

/* Ikdienas kase — atlikuma krāsa */
.daily-kase-balance-value--pos {
    color: var(--repairs-success);
    font-weight: 600;
}

.daily-kase-balance-value--neg {
    color: var(--repairs-danger);
    font-weight: 600;
}

.daily-kase-balance-value--zero {
    color: var(--repairs-text-main);
    font-weight: 600;
}

/* Ikdienas kase — kolonnu platumi (4 × 23%, dzēšanai atlikums 8%) */
#dailyKaseTable.daily-kase-table-fixed {
    table-layout: fixed;
    width: 100%;
}

#dailyKaseTable col.daily-kase-data-col {
    width: 23%;
}

#dailyKaseTable col.daily-kase-actions-col {
    width: 8%;
}

#dailyKaseTable th.daily-kase-actions-th,
#dailyKaseTable td.daily-kase-actions-td {
    width: 8%;
    min-width: 2.25rem;
    padding-left: 0.2rem;
    padding-right: 0.2rem;
    vertical-align: middle;
    text-align: center;
}

.daily-kase-del-btn {
    min-width: 1.65rem;
    height: 1.65rem;
    padding: 0;
    line-height: 1;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Modālie logi */
.modal-content {
    background: #0f172a;
    border: 1px solid var(--repairs-border-subtle);
    border-radius: var(--repairs-radius-lg);
    box-shadow: var(--repairs-shadow-soft);
    color: var(--repairs-text-main);
}

.modal-header {
    border-bottom: 1px solid var(--repairs-border-subtle);
    background: #0b1220;
    border-radius: var(--repairs-radius-lg) var(--repairs-radius-lg) 0 0;
}

.modal-header .modal-title {
    font-weight: 600;
    color: var(--repairs-text-main);
}

.modal-header .btn-close {
    filter: invert(1) grayscale(1) brightness(1.5);
}

.modal-footer {
    border-top: 1px solid var(--repairs-border-subtle);
    background: #0b1220;
    border-radius: 0 0 var(--repairs-radius-lg) var(--repairs-radius-lg);
}

.modal-backdrop {
    backdrop-filter: blur(4px);
}

.catalog-pick-table tbody tr:hover td {
    background-color: rgba(34, 197, 94, 0.08);
}

/* Klientu saraksts — tās pašas tabulas klases kā remontiem + kolonnu platumi (6 kolonnas) */
.repairs-table.clients-table th:nth-child(1),
.repairs-table.clients-table td:nth-child(1) {
    width: 150px;
}
.repairs-table.clients-table th:nth-child(2),
.repairs-table.clients-table td:nth-child(2) {
    width: 120px;
}
.repairs-table.clients-table th:nth-child(3),
.repairs-table.clients-table td:nth-child(3) {
    width: 200px;
}
.repairs-table.clients-table th:nth-child(4),
.repairs-table.clients-table td:nth-child(4) {
    width: 127px; /* +15% no 110px — Reģ. nr. / Personas kods */
}
/* Pēdējā kolonna: divas pogas — platāka nekā viena «Skatīt» remontu tabulā */
.repairs-table.clients-table th:last-child,
.repairs-table.clients-table td:last-child {
    width: 200px;
    min-width: 200px;
}
.repairs-table.clients-table td:last-child {
    white-space: nowrap;
}

/* Rediģēt klientu — Remonta vēsture: kā remontu saraksts, virsraksti bez UPPERCASE */
.repairs-table.client-repairs-history-table thead th {
    text-transform: none !important;
    letter-spacing: normal;
}
.repairs-table.client-repairs-history-table th:nth-child(1),
.repairs-table.client-repairs-history-table td:nth-child(1) {
    width: 10%;
}
.repairs-table.client-repairs-history-table th:nth-child(2),
.repairs-table.client-repairs-history-table td:nth-child(2) {
    width: 18%;
}
.repairs-table.client-repairs-history-table th:nth-child(3),
.repairs-table.client-repairs-history-table td:nth-child(3) {
    width: 28%;
}
.repairs-table.client-repairs-history-table th:nth-child(4),
.repairs-table.client-repairs-history-table td:nth-child(4) {
    width: 11%;
    text-align: center !important;
}
.repairs-table.client-repairs-history-table th:nth-child(5),
.repairs-table.client-repairs-history-table td:nth-child(5) {
    width: 18%;
    text-align: center !important;
}
.repairs-table.client-repairs-history-table td:nth-child(5) .badge {
    font-weight: 400;
}
.repairs-table.client-repairs-history-table th:nth-child(6),
.repairs-table.client-repairs-history-table td:nth-child(6) {
    width: 15%;
    min-width: 88px;
}

.repairs-table.client-invoices-history-table th,
.repairs-table.client-invoices-history-table td {
    text-align: center !important;
}
.repairs-table.client-invoices-history-table thead th {
    text-transform: none !important;
    letter-spacing: normal;
}
.repairs-table.client-invoices-history-table th:nth-child(1),
.repairs-table.client-invoices-history-table td:nth-child(1) {
    width: 14%;
    min-width: 96px;
}
.repairs-table.client-invoices-history-table th:nth-child(2),
.repairs-table.client-invoices-history-table td:nth-child(2) {
    width: 28%;
}
.repairs-table.client-invoices-history-table th:nth-child(3),
.repairs-table.client-invoices-history-table td:nth-child(3) {
    width: 18%;
}
.repairs-table.client-invoices-history-table th:nth-child(4),
.repairs-table.client-invoices-history-table td:nth-child(4) {
    width: 18%;
}

/* Pakalpojumi tabula (tā pati shēma kā remontiem, bet ar vietu 2 pogām) */
.repairs-table.services-table th:nth-child(1),
.repairs-table.services-table td:nth-child(1) {
    width: 75%;
}
.repairs-table.services-table th:last-child,
.repairs-table.services-table td:last-child {
    width: 180px;
    min-width: 180px;
    white-space: nowrap;
}

/* Detaļu noliktava — pārējās kolonnas pa 10%, Nosaukums atlikušais platums (4×10% + 60%) */
.repairs-table.warehouse-parts-table th:nth-child(1),
.repairs-table.warehouse-parts-table td:nth-child(1) {
    width: 60%;
}
.repairs-table.warehouse-parts-table th:nth-child(2),
.repairs-table.warehouse-parts-table td:nth-child(2),
.repairs-table.warehouse-parts-table th:nth-child(3),
.repairs-table.warehouse-parts-table td:nth-child(3),
.repairs-table.warehouse-parts-table th:nth-child(4),
.repairs-table.warehouse-parts-table td:nth-child(4) {
    width: 10%;
}
.repairs-table.warehouse-parts-table th:last-child,
.repairs-table.warehouse-parts-table td:last-child {
    width: 10%;
    min-width: 10%;
    white-space: nowrap;
}

/* Pārdošanas rēķinu saraksts — Pircējs ~50% platuma */
.repairs-table.sales-invoices-table th:nth-child(1),
.repairs-table.sales-invoices-table td:nth-child(1) {
    width: 10%;
    min-width: 84px;
}
.repairs-table.sales-invoices-table th:nth-child(2),
.repairs-table.sales-invoices-table td:nth-child(2) {
    width: 12%;
    min-width: 96px;
}
.repairs-table.sales-invoices-table th:nth-child(3),
.repairs-table.sales-invoices-table td:nth-child(3) {
    width: 50%;
}
.repairs-table.sales-invoices-table th.col-bez-pvn,
.repairs-table.sales-invoices-table td.col-bez-pvn,
.repairs-table.sales-invoices-table th.col-ar-pvn,
.repairs-table.sales-invoices-table td.col-ar-pvn {
    width: 10%;
}
.repairs-table.sales-invoices-table th:last-child,
.repairs-table.sales-invoices-table td:last-child {
    width: 10%;
    min-width: 92px;
}

/* Iepirkuma rēķinu saraksts — fiksēts kolonnu sadalījums (%) */
.repairs-table.purchase-invoices-table th:nth-child(1),
.repairs-table.purchase-invoices-table td:nth-child(1) {
    width: 10%;
}
.repairs-table.purchase-invoices-table th:nth-child(2),
.repairs-table.purchase-invoices-table td:nth-child(2) {
    width: 14%;
}
.repairs-table.purchase-invoices-table th:nth-child(3),
.repairs-table.purchase-invoices-table td:nth-child(3) {
    width: 44%;
}
.repairs-table.purchase-invoices-table th:nth-child(4),
.repairs-table.purchase-invoices-table td:nth-child(4) {
    width: 10%;
}
.repairs-table.purchase-invoices-table th:nth-child(5),
.repairs-table.purchase-invoices-table td:nth-child(5) {
    width: 15%;
}
.repairs-table.purchase-invoices-table th:nth-child(6),
.repairs-table.purchase-invoices-table td:nth-child(6) {
    width: 7%;
}

/* Iepirkuma rēķinu tabulai nelietojam sticky pēdējo kolonnu, lai nerastos horizontāls scroll */
.repairs-table.purchase-invoices-table th:last-child,
.repairs-table.purchase-invoices-table td:last-child {
    position: static;
    right: auto;
    min-width: 0;
}

/* Piegādātāja izvēle (iepirkuma rēķinam) — vienots tabulas izskats */
.repairs-table.purchase-pick-supplier-table th:nth-child(1),
.repairs-table.purchase-pick-supplier-table td:nth-child(1) {
    width: 8%;
    min-width: 64px;
    text-align: center;
}
.repairs-table.purchase-pick-supplier-table th:nth-child(2),
.repairs-table.purchase-pick-supplier-table td:nth-child(2) {
    width: 56%;
}
.repairs-table.purchase-pick-supplier-table th:nth-child(3),
.repairs-table.purchase-pick-supplier-table td:nth-child(3) {
    width: 36%;
}

.repairs-table.purchase-pick-supplier-table th:last-child,
.repairs-table.purchase-pick-supplier-table td:last-child {
    position: static;
    right: auto;
    min-width: 0;
    text-align: left;
}

/* Pircēja izvēle (pārdošanas rēķinam) — tāds pats tabulas izskats kā Remonti / piegādātāja izvēle */
.repairs-table.sales-pick-supplier-table th:nth-child(1),
.repairs-table.sales-pick-supplier-table td:nth-child(1) {
    width: 8%;
    min-width: 64px;
    text-align: center;
}
.repairs-table.sales-pick-supplier-table th:nth-child(2),
.repairs-table.sales-pick-supplier-table td:nth-child(2) {
    width: 56%;
}
.repairs-table.sales-pick-supplier-table th:nth-child(3),
.repairs-table.sales-pick-supplier-table td:nth-child(3) {
    width: 36%;
}

.repairs-table.sales-pick-supplier-table th:last-child,
.repairs-table.sales-pick-supplier-table td:last-child {
    position: static;
    right: auto;
    min-width: 0;
    text-align: left;
}

/* Global date display (dd.mm.yyyy) while preserving native calendar */
.date-display-wrapper {
    position: relative;
}

.date-display-wrapper .date-display-input {
    padding-right: 2.2rem;
    cursor: pointer;
}

.date-display-wrapper .date-display-btn {
    position: absolute;
    top: 50%;
    right: 0.55rem;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--repairs-text-muted);
    padding: 0;
    line-height: 1;
    font-size: 1rem;
}

.date-display-wrapper .date-display-btn:hover {
    color: var(--repairs-text-main);
}

.date-display-wrapper .date-native-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* Meistara pārskats — filtri: šaurāka datumu kolonna (līdzās pogām uz xl) */
.user-edit-master-filters .user-edit-filter-date-col {
    min-width: min(100%, 11.5rem);
}

/* Meistara pārskats — kolonnu platumi (% no tabulas) */
.user-edit-master-overview-table th:nth-child(1),
.user-edit-master-overview-table td:nth-child(1) {
    width: 12%;
}

.user-edit-master-overview-table th:nth-child(2),
.user-edit-master-overview-table td:nth-child(2) {
    width: 13%;
}

.user-edit-master-overview-table th:nth-child(3),
.user-edit-master-overview-table td:nth-child(3) {
    width: 47.65%;
}

.user-edit-master-overview-table th:nth-child(4),
.user-edit-master-overview-table td:nth-child(4) {
    width: 10%;
}

.user-edit-master-overview-table th:nth-child(5),
.user-edit-master-overview-table td:nth-child(5) {
    width: 4%;
}

.user-edit-master-overview-table th:nth-child(6),
.user-edit-master-overview-table td:nth-child(6) {
    width: 6%;
}

.user-edit-master-overview-table th.user-edit-payout-col,
.user-edit-master-overview-table td.user-edit-payout-col {
    width: 5%;
    min-width: 5%;
    max-width: 5%;
    padding: 0.125rem !important;
    vertical-align: middle !important;
    box-sizing: border-box;
    text-align: center;
    white-space: nowrap;
}

.user-edit-master-overview-table .user-edit-payout-del {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    min-width: 1.25rem;
    min-height: 1.25rem;
    margin: 0;
    padding: 0;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1;
    color: var(--repairs-danger);
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.45);
    border-radius: 3px;
    cursor: pointer;
    box-sizing: border-box;
    vertical-align: middle;
}

.user-edit-master-overview-table .user-edit-payout-del:hover {
    color: #fff;
    background: var(--repairs-danger);
    border-color: var(--repairs-danger);
}

.user-edit-master-overview-table .user-edit-payout-del:focus-visible {
    outline: 2px solid var(--repairs-danger);
    outline-offset: 1px;
}
