/* ========== Design tokens (accounting-friendly) ========== */
:root {
  --color-bg: #f6f7f9;
  --color-surface: #ffffff;
  --color-border: #e5e7eb;
  --color-border-light: #f1f3f5;
  --color-text: #1f2937;
  --color-text-muted: #6b7280;
  --color-primary: #1e98d4;
  --color-primary-hover: #1585b8;
  --color-nav: #1e3a5f;
  --color-nav-hover: #2a4a7a;
  --font-sans: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --font-mono: 'SF Mono', 'Consolas', 'Liberation Mono', monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.08);
}

html { font-size: 15px; }
body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
}

html, body, table, .dataTables_wrapper, .dataTables_info, .dataTables_filter, .dataTables_length, .dataTables_paginate {
  font-family: var(--font-sans);
}

table {
  width: 100%;
}
/* Horizontal scroll for wide tables (many columns) */
.table-responsive,
.table-responsivessd,
[class*="table-responsive"] {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Tabular numbers for numeric columns - better alignment in accounting */
table.dataTable td,
table.dataTable th {
  font-family: var(--font-sans) !important;
  font-size: 13px;
}
table.dataTable td {
  font-variant-numeric: tabular-nums;
}

th,

td {

    text-align: right;

}



th:first-child,

td:first-child,

th:nth-child(2),

td:nth-child(2) {

    text-align: left;

    font-family: 'Noto Serif', serif;

    /* Macedonian Cyrillic font for Client Code and Company Name */

}



th:nth-child(5),

td:nth-child(5) {

    text-align: left;

}



/* Type column */

th:nth-child(6),

td:nth-child(6) {

    text-align: left;

    white-space: pre-wrap;

    min-width: 150px;

}


/* ========== Cards & surfaces ========== */
.tile-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 24px;
  margin-bottom: 32px;
  border: 1px solid var(--color-border-light);
}


/* Invoices column */

.red {

    color: red !important;

}



.file-upload {

    position: relative;

    display: inline-block;

}



.file-upload input[type="file"] {

    display: none;

    /* hide the default input */

}







.file-name {

    margin-left: 10px;

    font-family: sans-serif;

    color: #333;

}



button.import-btn {

    background-color: #007bff;

    color: white;

    border: none;

    padding: 8px 16px;

    border-radius: 5px;

    margin-left: 15px;

    cursor: pointer;

}



.uploader-card {
  max-width: 720px;
  margin: 48px auto;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 28px;
  border: 1px solid var(--color-border-light);
}



.uploader-title {

    font-size: 20px;

    font-weight: 700;

    margin: 0 0 6px;

}



.uploader-subtitle {

    color: #6c757d;

    margin-bottom: 18px;

}



.dropzone {

    border: 2px dashed #cfd6df;

    border-radius: 16px;

    padding: 28px;

    background: linear-gradient(180deg, #fafbfc, #f6f8fa);

    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;

    text-align: center;

    position: relative;

}



.dropzone.dragover {

    border-color: #4c8bf7;

    background: #f0f6ff;

    box-shadow: 0 0 0 6px rgba(76, 139, 247, .12) inset;

}



.dz-icon {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    width: 56px;

    height: 56px;

    border-radius: 14px;

    background: #eef4ff;

    margin-bottom: 10px;

}



.dz-icon svg {

    width: 28px;

    height: 28px;

}



.file-upload {

    display: inline-flex;

    align-items: center;

    gap: 12px;

    margin-top: 12px;

}



.file-upload input[type="file"] {

    display: none;

}



.file-upload-label {

    background-color: #fff;

    display: inline-block;

    border: 1px solid #6c757d;

    /* primary */

    color: #6c757d;

    padding: 7px 20px;

    border-radius: 10px;

    cursor: pointer;

    font-weight: 600;

    transition: transform .06s ease, box-shadow .2s ease, background .2s ease;

    user-select: none;

}



.file-upload-label:hover {

    background: #495057;

}



.file-upload-label:active {

    transform: translateY(1px);

}



.file-name {

    color: #495057;

    font-size: 14px;

}



.uploader-actions {

    margin-top: 16px;

    display: flex;

    gap: 10px;

    justify-content: center;

}



.btn-import {

    background: #2f2f2f;

    color: #fff;

    border: none;

    padding: 10px 16px;

    border-radius: 10px;

    font-weight: 600;

    cursor: pointer;

    transition: transform .06s ease, background .2s ease;

}



.btn-import:hover {

    background: #0e0101;

}



.btn-import:active {

    transform: translateY(1px);

}



.progress-wrap {

    display: none;

    margin-top: 18px;

}



/* Small helper for messages */

.uploader-msg {

    display: none;

    margin-top: 12px;

    font-size: 14px;

}



.uploader-msg.ok {

    color: #198754;

}



.uploader-msg.err {

    color: #dc3545;

}



/* Make the clickable area large and accessible */

.dropzone .clickable {

    color: #2563eb;

    text-decoration: underline;

    cursor: pointer;

}



.spinner-wrap {

    display: flex;

    align-items: center;

    gap: 10px;

    margin-top: 16px;

}



.spinner {

    width: 28px;

    height: 28px;

    border-radius: 50%;

    border: 3px solid #e9ecef;

    border-top-color: #0d6efd;

    animation: spin 0.8s linear infinite;

}



.spinner-text {

    color: #495057;

    font-size: 14px;

}



.overlay {

    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .35);

    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;

}

.overlay[hidden] {
    display: none;
}

.overlay-box {

    background: #fff;
    padding: 18px 22px;
    border-radius: 12px;

    box-shadow: 0 10px 30px rgba(0, 0, 0, .15);

    display: flex;
    align-items: center;
    gap: 12px;
    font-family: sans-serif;

}

.spinner {

    width: 28px;
    height: 28px;
    border-radius: 50%;

    border: 3px solid #e9ecef;
    border-top-color: #0d6efd;

    animation: spin .8s linear infinite;

}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}



button svg {

    transition: transform .2s ease;

}

button:hover svg {

    transform: translateX(-3px);

}

.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem .85rem;
    border-radius: 0.375rem;
    background: #2563eb;
    color: #fff;
    text-decoration: none;
    font: 500 14px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
    transition: transform .08s ease, box-shadow .15s ease, background .15s ease;
    box-shadow: 0 2px 8px rgba(30,152,212,.25);
    white-space: nowrap;
    margin-right: 5px;
  }
  .btn-icon svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
  }
  .btn-icon:hover { background:#187fb3; }
  .btn-icon:active { transform: translateY(1px); }
  .btn-icon:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(24,127,179,.35);
  }

  /* Optional: a subtle outline variant */
  .btn-outline {
    background: transparent;
    color: #1e98d4;
    border: 1.5px solid #1e98d4;
    box-shadow: none;
  }
  .btn-outline:hover { background: rgba(30,152,212,.08); }

  /* login page  */

  .login-card {
    max-width: 420px;
    margin: 60px auto;
    padding: 30px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,.1);
    text-align: center;
  }

  .uploader-title {
    font-size: 1.6rem;
    color: #1e98d4;
    margin-bottom: 5px;
  }

  .uploader-subtitle {
    color: #6b7280;
    margin-bottom: 20px;
    font-size: 0.95rem;
  }

  .login-error {
    background: #fee2e2;
    color: #7f1d1d;
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 15px;
    font-weight: 500;
  }

  .form-group {
    text-align: left;
    margin-bottom: 16px;
  }

  .form-group label {
    display: block;
    color: #374151;
    font-weight: 600;
    margin-bottom: 5px;
  }

  .form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
  }

  .form-group input:focus {
    border-color: #1e98d4;
  }

  .upload-btn {
    display: inline-block;
    background: #1e98d4;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    padding: 10px 18px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
  }

  .upload-btn:hover {
    background: #187fb3;
  }

  .upload-btn:active {
    transform: translateY(1px);
  }

  .logo {
    width: 40%;
  }

  /* ========== Layout ========== */
.app-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px 20px;
}
.app-content {
  margin-top: 0;
}

/* ========== Topbar & Navbar ========== */
.topbar {
  background: var(--color-nav);
  padding: 0 20px;
  box-shadow: var(--shadow-md);
  min-height: 56px;
  display: flex;
  align-items: center;
}
.topbar-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar-inner .navbar { flex: 1; }
.topbar-greeting {
  color: rgba(255,255,255,.9);
  font-size: 14px;
  white-space: nowrap;
}
.topbar .navbar {
  background: transparent !important;
  padding: 0;
  --bs-navbar-padding-y: 0;
}
.topbar .navbar-dark .navbar-nav .nav-link {
  color: rgba(255,255,255,.9);
  font-weight: 500;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
}
.topbar .navbar-dark .navbar-nav .nav-link:hover {
  background: var(--color-nav-hover);
  color: #fff;
}
.topbar .navbar-dark .navbar-nav .dropdown-menu {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px 0;
}
.topbar .navbar-dark .navbar-nav .dropdown-item {
  padding: 8px 16px;
  font-size: 14px;
}
.topbar .navbar-dark .navbar-nav .dropdown-item:hover {
  background: var(--color-bg);
}
.topbar .btn-outline-light {
  border-radius: var(--radius-sm);
  font-weight: 500;
}
.app-navbar,
.app-navbar.bg-dark {
  background: transparent !important;
}

.main-nav {
  background: var(--color-nav);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 0;
  box-shadow: var(--shadow-md);
}
.main-nav ul {
  list-style: none;
  display: flex;
  gap: 24px;
  margin: 0;
  padding: 0;
}
.main-nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background 0.2s;
}
.main-nav a:hover {
  background: rgba(255,255,255,0.15);
}
.main-nav .logout {
  background: #dc2626;
}
.main-nav .logout:hover {
  background: #b91c1c;
}
.action-buttons{
  display: flex;
}
/* ========== DataTables ========== */
.dataTables_wrapper {
  font-size: 13px;
}
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 13px;
}
.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
  border-color: var(--color-primary);
  outline: none;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: var(--radius-sm) !important;
  padding: 6px 12px !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
}
table.dataTable thead th {
  background: var(--color-bg) !important;
  color: var(--color-text);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 12px 10px !important;
  border-bottom: 2px solid var(--color-border) !important;
}
table.dataTable tbody td {
  padding: 10px !important;
  border-bottom: 1px solid var(--color-border-light) !important;
}
table.dataTable.stripe tbody tr.odd,
table.dataTable.display tbody tr.odd {
  background-color: var(--color-surface) !important;
}
table.dataTable.stripe tbody tr.even,
table.dataTable.display tbody tr.even {
  background-color: var(--color-bg) !important;
}
table.dataTable.hover tbody tr:hover,
table.dataTable.display tbody tr:hover {
  background-color: #e8f4fc !important;
}

/* warranty_requests page: full-width layout */
.page-warranty-requests .app-container {
  max-width: none;
  padding-left: 16px;
  padding-right: 16px;
}
.page-warranty-requests .warranty-table-full-width {
  margin-left: -16px;
  margin-right: -16px;
  width: calc(100% + 32px);
  box-sizing: border-box;
}
.warranty-table-full-width .tile-card {
  border-radius: 0;
  border-left: none;
  border-right: none;
  padding-left: 16px;
  padding-right: 16px;
}

/* Full-width table cards (e.g. warranty_requests) - no slider */
.table-card-full {
  width: 100%;
  overflow: visible;
}
.table-card-full .dataTables_wrapper,
.table-card-full .dataTables_scroll,
.table-card-full .dataTables_scrollHead,
.table-card-full .dataTables_scrollBody {
  width: 100% !important;
  overflow: visible !important;
  overflow-x: hidden !important;
  max-width: none !important;
}
.table-card-full .dataTables_scrollBody > table {
  width: 100% !important;
  max-width: none !important;
}
.table-card-full #requestsTable {
  width: 100% !important;
  table-layout: fixed;
}
.table-card-full #requestsTable td,
.table-card-full #requestsTable th {
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.dt-buttons .btn,
.btn-group > .btn {
  background: var(--color-surface) !important;
  border: 1px solid var(--color-border) !important;
  padding: 6px 12px !important;
  border-radius: var(--radius-sm) !important;
  margin-right: 8px !important;
  color: var(--color-text) !important;
  font-size: 13px !important;
}
.dt-buttons .btn:hover,
.btn-group > .btn:hover {
  background: var(--color-bg) !important;
  border-color: var(--color-primary) !important;
  color: var(--color-primary) !important;
}

.listed-notes {
  background-color: var(--color-bg);
  border-radius: var(--radius-sm);
}
#notesList{
  height: 50VH;
  overflow-y: scroll;
}

.text-custom-warning{
  color:red;
}

.select2-container--default .select2-selection--single {
    height: 38px;
    padding: 6px 12px;
}

.select2-selection__rendered {
    line-height: 24px !important;
}

.select2-selection__arrow {
    height: 36px;
}

.select2-container .select2-selection--single {
  height: auto !important;
}


/* fixed aligned columns in Select2 dropdown rows */
.select2-results__option .s2-inv-row{
  display: grid;
  grid-template-columns: 180px 180px 140px; /* adjust widths */
  gap: 5px;
  align-items: left;
}

.select2-results__option .s2-inv-col{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.select2-results__option .s2-inv-amt{
  text-align: left;
}

/* Totals header row */
thead tr.dt-totals-row th {
  background: var(--color-nav) !important;
  font-weight: 600;
  color: #fff;
  border-top: 2px solid var(--color-border);
  border-bottom: 2px solid var(--color-border);
}

/* Label cell */
thead tr.dt-totals-row th:first-child {
  text-align: right;
  color: #495057;
}

/* Negative totals */
thead tr.dt-totals-row th.text-danger {
  color: #dc3545 !important;
}
thead tr.dt-totals-row th {
  pointer-events: none;   /* 👈 makes row not clickable */
  cursor: default !important;
}

/* —— Document extractions: PDF-like viewer —— */
.de-sheet .de-doc-title {
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: 0.02em;
}
.de-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  background: var(--color-bg) !important;
  border-bottom: 1px solid var(--color-border);
}
.de-field {
  margin-bottom: 0.75rem;
}
.de-field-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: 0.15rem;
}
.de-field-value {
  font-size: 0.95rem;
  color: var(--color-text);
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--color-border-light);
  min-height: 1.5rem;
  word-break: break-word;
}
.de-ref-list {
  padding-left: 1.25rem;
  margin: 0;
}
.de-ref-list li {
  margin-bottom: 0.25rem;
}
.de-items-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
}
.de-sheet-body {
  background: var(--color-surface);
}
@media print {
  .no-print,
  .app-navbar,
  nav.navbar,
  .btn,
  details > summary {
    display: none !important;
  }
  details[open] .card-body {
    display: block !important;
  }
  body {
    background: #fff !important;
    font-size: 11pt;
  }
  .container {
    max-width: 100% !important;
  }
  .de-sheet {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
  .de-section {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}