/* 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;
    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-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 {
    color: #f9fafb;
}

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

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

.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: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    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;
}

.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: 92px;
    min-width: 92px;
    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: 120px; }
.repairs-table th:nth-child(2),
.repairs-table td:nth-child(2) { width: 150px; }
.repairs-table th:nth-child(3),
.repairs-table td:nth-child(3) { width: 120px; }
.repairs-table th:nth-child(7),
.repairs-table td:nth-child(7) { width: 110px; }
.repairs-table th:nth-child(8),
.repairs-table td:nth-child(8) { width: 84px; }
.repairs-table th:nth-child(9),
.repairs-table td:nth-child(9) { width: 104px; }
.repairs-table th:nth-child(10),
.repairs-table td:nth-child(10) { width: 104px; }
.repairs-table th:nth-child(11),
.repairs-table td:nth-child(11) { width: 92px; }

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

.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;
}

/* 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);
}

/* 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: 999px;
    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-secondary {
    border-radius: 999px;
    border-color: rgba(148, 163, 184, 0.7);
    color: #e5e7eb;
}

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

.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);
}

/* 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);
}
