﻿:root {
  --background:        #FFFFFF;
  --foreground:        #1A2540;
  --primary:           #0F1E3C;
  --primary-mid:       #1A3260;
  --primary-light:     #1E3A73;
  --primary-fg:        #FFFFFF;
  --secondary:         #1E3A73;
  --muted:             #F4F6FA;
  --muted-fg:          #6B7A99;
  --border:            #DDE2EC;
  --destructive:       hsl(0, 80%, 55%);
  --success:           hsl(145, 70%, 40%);
  --campaign:          #C9A84C;
  --gold:              #C9A84C;
  --gold-light:        #E2C46A;
  --gold-pale:         #F5ECD7;
  --search-highlight:  hsl(55, 100%, 50%);
  --table-header-bg:   #F4F6FA;
  --table-border:      #DDE2EC;
  --header-grad-from:  #0F1E3C;
  --header-grad-to:    #1A3260;
  --tecdoc:            hsl(210, 80%, 45%);
  --info-blue:         hsl(210, 80%, 50%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 12px;
  color: var(--foreground);
  background: var(--background);
}

body { display: flex; flex-direction: column; overflow: hidden; }

/* HEADER */
.header {
  background: linear-gradient(90deg, #0F1E3C 0%, #1A3260 100%);
  border-bottom: 2px solid #C9A84C;
  color: var(--primary-fg);
  display: flex;
  align-items: stretch;
}
.logo-wrap { display: flex; align-items: center; gap: 6px; padding: 4px 12px; }
.logo-square {
  width: 32px; height: 32px;
  background: #C9A84C;
  color: #0F1E3C;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; border-radius: 4px;
}
.logo-square.big { width: 40px; height: 40px; font-size: 22px; }
.logo-text { font-weight: 700; font-size: 20px; letter-spacing: 1px; color: #FFFFFF; }

.nav-icons { display: flex; }
.nav-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 60px; padding: 4px 10px; border: none; background: transparent;
  color: var(--primary-fg); cursor: pointer; transition: background 0.15s; text-decoration: none;
}
.nav-btn:hover { background: rgba(201,168,76,0.15); color: #E2C46A; }
.nav-btn .ic { font-size: 18px; line-height: 1; margin-bottom: 2px; }
.nav-btn .lbl { font-size: 10px; font-weight: 500; }

.promo { margin-left: auto; display: flex; align-items: stretch; }
.promo-text {
  background: linear-gradient(to right, var(--header-grad-from), var(--header-grad-to));
  padding: 4px 16px;
  display: flex; flex-direction: column; justify-content: center;
  text-align: center; line-height: 1.15;
}
.promo-text p { color: var(--primary-fg); margin: 0; }
.promo-text .small { font-size: 10px; }
.promo-text .bold { font-weight: 600; }
.promo-text .campaign { font-size: 13px; font-weight: 700; color: var(--gold); }
.promo-badge {
  background: var(--header-grad-to);
  padding: 6px 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.promo-percent { color: var(--gold); font-weight: 700; font-size: 28px; line-height: 1; }

/* SEARCH BAR */
.searchbar {
  background: rgba(15,30,60,0.95);
  padding: 6px 8px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.search-input {
  display: flex; align-items: center; gap: 4px;
  background: var(--primary-fg); border-radius: 4px;
  padding: 4px 8px; min-width: 160px;
}
.search-input .ic { color: var(--muted-fg); }
.search-input input {
  border: none; outline: none; background: transparent;
  font-size: 12px; width: 100%; color: var(--foreground);
}
.icon-btn {
  background: transparent; border: none; color: var(--primary-fg);
  cursor: pointer; font-size: 16px; padding: 2px;
}
.search-icon-btn {
  background: var(--muted);
  border: 1px solid var(--table-border);
  border-right: none;
  padding: 0 8px;
  border-radius: 3px 0 0 3px;
  cursor: pointer;
  font-size: 14px;
  height: 28px;
  display: flex;
  align-items: center;
}
.main-search { display: flex; align-items: center; }
.highlight-wrap { position: relative; }
.highlight-input {
  background: var(--background);
  border: 1px solid var(--table-border);
  font-size: 13px; font-weight: 700; padding: 4px 8px;
  width: 180px; outline: none; color: var(--foreground);
  border-radius: 0 3px 3px 0;
  height: 28px;
}
.date-stamp {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-size: 9px; color: var(--muted-fg);
}

/* TABS */
.tabs {
  display: flex; align-items: center;
  border-bottom: 1px solid var(--table-border);
}
.tabs-left { display: flex; }
.tab-btn {
  padding: 5px 12px; font-size: 11px; font-weight: 500;
  background: var(--muted); color: var(--muted-fg);
  border: 1px solid var(--table-border); border-bottom: none;
  cursor: pointer; transition: background 0.15s;
}
.tab-btn:hover { background: hsla(0, 0%, 100%, 0.8); }
.tab-btn.active {
  background: var(--background); color: var(--foreground);
  border-bottom: 1px solid var(--background);
  margin-bottom: -1px; position: relative; z-index: 2;
}
.tab-btn:first-child { border-top-left-radius: 3px; }

.tabs-right {
  margin-left: auto; display: flex; align-items: center; gap: 12px;
  padding: 0 8px; font-size: 11px;
}
.tabs-right .muted { color: var(--muted-fg); }
.tabs-right .chip {
  border: 1px solid var(--table-border);
  padding: 2px 8px; background: var(--background);
}
.tabs-right label { display: flex; align-items: center; gap: 4px; cursor: pointer; margin-bottom: 0; }
.tabs-right .ok { color: var(--success); font-weight: 600; }

/* TABLE WRAPPER */
/* overflow-x kapalı: yatay scroll yok, dikey scrollbar payı sabit (titreme önlemi) */
.table-wrap { flex: 1; overflow-x: hidden; overflow-y: auto; scrollbar-gutter: stable; display: flex; flex-direction: column; }

/* TABULATOR OVERRIDES TO MATCH CUSTOM TABLE CSS */
.tabulator {
    border: none !important;
    background: var(--background) !important;
    font-size: 11px !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}
.tabulator-header {
    background: var(--table-header-bg) !important;
    color: var(--foreground) !important;
    border-bottom: 1px solid var(--table-border) !important;
}
.tabulator-col {
    background: var(--table-header-bg) !important;
    border-right: 1px solid var(--table-border) !important;
}
.tabulator-col-title {
    font-weight: 600 !important;
    font-size: 9.5px !important;
    white-space: nowrap !important;
    text-align: center;
}
.tabulator-row {
    border-bottom: 1px solid var(--table-border) !important;
    min-height: 26px !important;
}
.tabulator-row:nth-child(even) {
    background-color: hsla(210, 20%, 96%, 0.3) !important;
}
.tabulator-row:hover {
    background-color: hsla(189, 60%, 40%, 0.1) !important;
}
.tabulator-cell {
    border-right: 1px solid var(--table-border) !important;
    padding: 2px 6px !important;
    display: flex;
    align-items: center;
}

/* CUSTOM CELL CONTENT STYLES */
.code-cell { color: var(--primary); font-weight: 500; white-space: nowrap; text-decoration: none; }
.code-cell:hover { text-decoration: underline; }
.ref-cell { white-space: pre-line; line-height: 1.3; font-size: 11px; }
.name-cell { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.name-cell .pname { color: var(--primary); font-weight: 500; }

.badge-campaign {
  background: var(--campaign); color: var(--foreground);
  font-size: 9px; font-weight: 700; padding: 2px 6px;
  border-radius: 2px; white-space: nowrap;
}
.tecdoc {
  background: var(--tecdoc); color: var(--primary-fg);
  font-size: 8px; font-weight: 700; padding: 2px 4px;
  border-radius: 2px; line-height: 1;
}
.img-ic { color: var(--muted-fg); font-size: 14px; margin-left: 2px; }

.dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  color: white; font-size: 11px; font-weight: 700; line-height: 1;
}
.dot.ok { background: var(--success); }
.dot.no { background: var(--destructive); width: 16px; height: 16px; font-size: 10px; }
.dot.info { background: var(--info-blue); }
.dot-active::after { 
  content: ''; display: inline-block; width: 6px; height: 6px;
  background: var(--success); border-radius: 50%; margin-left: 4px; vertical-align: middle; 
}

/* CHAT */
.chat-btn {
  position: fixed; bottom: 16px; right: 16px;
  background: var(--primary); color: var(--primary-fg);
  border: none; border-radius: 999px;
  padding: 10px 18px; font-size: 13px; font-weight: 500;
  cursor: pointer; box-shadow: 0 4px 12px hsla(0, 0%, 0%, 0.2);
  z-index: 50; transition: background 0.15s;
}
.chat-btn:hover { background: var(--secondary); }

/* SEARCH DROPDOWN & TREE */
.search-dropdown {
    position: relative;
}
.tree-menu {
    min-width: 300px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1050;
    margin-top: 5px !important;
    background: white;
}
.custom-tree {
    font-size: 13px;
}
.jstree-default .jstree-anchor {
    font-family: inherit !important;
}
.jstree-default .jstree-search {
    color: var(--primary) !important;
    font-weight: 600 !important;
}
.searchbar .dropdown-toggle::after {
    display: none;
}
.search-input[data-bs-toggle="dropdown"] {
    cursor: pointer;
}

/* ============================
   INNER PAGE STYLES
   Martas-Arayuz Design System
   ============================ */

/* Page Content Wrapper */
.page-content {
  padding: 16px 20px;
  flex: 1;
  overflow-y: auto;
  font-size: 12px;
}

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--table-border);
}
.page-header h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.page-header .page-subtitle {
  font-size: 11px;
  color: var(--muted-fg);
  margin-top: 2px;
}

/* Page Cards */
.page-card {
  background: var(--background);
  border: 1px solid var(--table-border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}
.page-card-header {
  background: var(--table-header-bg);
  padding: 8px 14px;
  border-bottom: 1px solid var(--table-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.page-card-header h6,
.page-card-header .card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--foreground);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.page-card-body {
  padding: 14px;
}

/* Page Stat Cards */
.page-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.page-stat-card {
  background: var(--table-header-bg);
  border: 1px solid var(--table-border);
  border-radius: 4px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 140px;
}
.page-stat-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--primary-fg);
}
.page-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--foreground);
  line-height: 1;
}
.page-stat-label {
  font-size: 10px;
  color: var(--muted-fg);
  margin-top: 2px;
}

/* Page Filters */
.page-filters {
  background: var(--table-header-bg);
  border: 1px solid var(--table-border);
  border-radius: 4px;
  padding: 10px 14px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 12px;
}
.page-filter-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 160px;
  flex: 1;
}
.page-filter-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted-fg);
  text-transform: uppercase;
}

/* Form Elements (Theme-Matched) */
.page-content input[type="text"],
.page-content input[type="number"],
.page-content input[type="search"],
.page-content textarea,
.page-content select,
.page-filter-input {
  padding: 5px 10px;
  border: 1px solid var(--table-border);
  border-radius: 3px;
  font-size: 12px;
  font-family: inherit;
  color: var(--foreground);
  background: var(--background);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
.page-content input:focus,
.page-content textarea:focus,
.page-content select:focus,
.page-filter-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px hsla(189, 100%, 25%, 0.1);
}

/* Buttons */
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 14px;
  border: none;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  font-family: inherit;
}
.page-btn:active { transform: scale(0.97); }

.page-btn-primary {
  background: var(--primary);
  color: var(--primary-fg);
}
.page-btn-primary:hover { background: var(--secondary); }

.page-btn-secondary {
  background: var(--muted);
  color: var(--foreground);
  border: 1px solid var(--table-border);
}
.page-btn-secondary:hover { background: var(--table-header-bg); }

.page-btn-danger {
  background: var(--destructive);
  color: var(--primary-fg);
}
.page-btn-danger:hover { background: hsl(0, 80%, 48%); }

.page-btn-success {
  background: var(--success);
  color: var(--primary-fg);
}
.page-btn-success:hover { background: hsl(145, 70%, 34%); }

.page-btn-sm {
  padding: 4px 10px;
  font-size: 11px;
}

.page-btn-lg {
  padding: 8px 20px;
  font-size: 13px;
}

/* Tables (Inner Pages) */
.page-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.page-table th {
  background: var(--table-header-bg);
  color: var(--foreground);
  border: 1px solid var(--table-border);
  padding: 6px 8px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
.page-table td {
  border: 1px solid var(--table-border);
  padding: 5px 8px;
  vertical-align: middle;
}
.page-table tbody tr:nth-child(even) { background: hsla(210, 20%, 96%, 0.3); }
.page-table tbody tr:hover { background: hsla(189, 60%, 40%, 0.1); }

/* List Items */
.page-list-item {
  padding: 8px 12px;
  border-bottom: 1px solid var(--table-border);
  cursor: pointer;
  font-size: 12px;
  transition: background 0.15s;
}
.page-list-item:hover { background: hsla(189, 60%, 40%, 0.08); }
.page-list-item.active {
  background: hsla(189, 100%, 25%, 0.1);
  border-left: 3px solid var(--primary);
  color: var(--primary);
  font-weight: 600;
}

/* Badges */
.page-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.page-badge-primary { background: var(--primary); color: var(--primary-fg); }
.page-badge-success { background: var(--success); color: var(--primary-fg); }
.page-badge-danger { background: var(--destructive); color: var(--primary-fg); }
.page-badge-warning { background: var(--campaign); color: var(--foreground); }
.page-badge-info { background: var(--info-blue); color: var(--primary-fg); }
.page-badge-muted { background: var(--muted); color: var(--muted-fg); border: 1px solid var(--table-border); }

/* Status Badges */
.page-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
}
.page-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.page-status-pending { background: #fef9e7; color: #856404; }
.page-status-pending::before { background: #ffc107; }
.page-status-processing { background: hsla(189, 60%, 40%, 0.1); color: var(--primary); }
.page-status-processing::before { background: var(--primary); }
.page-status-completed { background: hsla(145, 70%, 40%, 0.1); color: var(--success); }
.page-status-completed::before { background: var(--success); }
.page-status-cancelled { background: hsla(0, 80%, 55%, 0.1); color: var(--destructive); }
.page-status-cancelled::before { background: var(--destructive); }

/* Empty State */
.page-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted-fg);
}
.page-empty-icon {
  font-size: 36px;
  margin-bottom: 10px;
  opacity: 0.4;
}
.page-empty h5 {
  font-size: 14px;
  color: var(--foreground);
  margin-bottom: 4px;
}
.page-empty p {
  font-size: 11px;
  color: var(--muted-fg);
}

/* Loading */
.page-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--muted-fg);
  font-size: 12px;
}
.page-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--table-border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: page-spin 0.8s linear infinite;
  margin-bottom: 8px;
}
@keyframes page-spin { to { transform: rotate(360deg); } }

/* Price Display */
.page-price {
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}
.page-price-lg {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}
.page-price-old {
  text-decoration: line-through;
  color: var(--muted-fg);
  font-size: 11px;
}

/* Two-Column Layout */
.page-row {
  display: flex;
  gap: 12px;
}
.page-col { flex: 1; min-width: 0; }
.page-col-3 { flex: 0 0 25%; max-width: 25%; }
.page-col-4 { flex: 0 0 33.33%; max-width: 33.33%; }
.page-col-5 { flex: 0 0 41.66%; max-width: 41.66%; }
.page-col-6 { flex: 0 0 50%; max-width: 50%; }
.page-col-7 { flex: 0 0 58.33%; max-width: 58.33%; }
.page-col-8 { flex: 0 0 66.66%; max-width: 66.66%; }
.page-col-9 { flex: 0 0 75%; max-width: 75%; }

/* Summary Sidebar */
.page-summary {
  background: var(--background);
  border: 1px solid var(--table-border);
  border-radius: 4px;
  overflow: hidden;
}
.page-summary-header {
  background: var(--primary);
  color: var(--primary-fg);
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
}
.page-summary-body {
  padding: 12px 14px;
}
.page-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--table-border);
  font-size: 12px;
}
.page-summary-row:last-child {
  border-bottom: none;
  padding-top: 10px;
  margin-top: 4px;
  border-top: 2px solid var(--primary);
}
.page-summary-footer {
  background: var(--muted);
  padding: 10px 14px;
  border-top: 1px solid var(--table-border);
  font-size: 11px;
  color: var(--muted-fg);
  text-align: center;
}

/* Form Groups */
.page-form-group {
  margin-bottom: 12px;
}
.page-form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 4px;
}

/* Radio / Checkbox Group (toggle style) */
.page-toggle-group {
  display: flex;
  border: 1px solid var(--table-border);
  border-radius: 3px;
  overflow: hidden;
}
.page-toggle-group label {
  flex: 1;
  text-align: center;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  border-right: 1px solid var(--table-border);
  background: var(--muted);
  color: var(--muted-fg);
  transition: background 0.15s;
  margin: 0;
}
.page-toggle-group label:last-child { border-right: none; }
.page-toggle-group input { display: none; }
.page-toggle-group input:checked + label,
.page-toggle-group label.active {
  background: var(--primary);
  color: var(--primary-fg);
}

/* Input Group */
.page-input-group {
  display: flex;
  align-items: stretch;
}
.page-input-group input {
  flex: 1;
  border-radius: 3px 0 0 3px;
}
.page-input-group .page-btn {
  border-radius: 0 3px 3px 0;
}

/* Info Card */
.page-info {
  background: hsla(189, 60%, 40%, 0.05);
  border: 1px solid hsla(189, 100%, 25%, 0.15);
  border-radius: 4px;
  padding: 10px 14px;
  font-size: 11px;
  color: var(--foreground);
}
.page-info-title {
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--primary);
}

/* Footer */
#footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 16px;
  background: var(--primary);
  color: var(--primary-fg);
  font-size: 11px;
  border-top: 1px solid var(--table-border);
}
.footer-left, .footer-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
  .page-row { flex-direction: column; }
  .page-col-3, .page-col-4, .page-col-5, .page-col-6,
  .page-col-7, .page-col-8, .page-col-9 {
    flex: 1; max-width: 100%;
  }
  .page-stats { flex-direction: column; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--muted); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }
