/* Audit-driven premium theme
   Local-first authoritative visual layer.
   Goal: single blue corporate palette, red reserved for unpaid cases. */

:root {
  --brand: #12233b;
  --brand-2: #eef4fb;
  --accent: #295ea8;
  --accent-2: #eef4ff;
  --paid: #234f8f;
  --warn: #4a6fa6;
  --blue: #295ea8;
  --blue-2: #eef4ff;
  --violet: #3560a5;
  --violet-2: #f1f6ff;
  --focus: #295ea8;
  --gold: #295ea8;
}

.primary-action {
  border-color: rgba(41, 94, 168, 0.34);
  background: linear-gradient(135deg, #173a67 0%, #295ea8 100%);
  color: #ffffff;
  box-shadow: 0 16px 30px rgba(41, 94, 168, 0.18);
}

.nav-item.active,
.sidebar-guide.active {
  box-shadow: inset 4px 0 0 #295ea8, 0 14px 30px rgba(0, 0, 0, 0.18);
}

.sidebar .sidebar-guide {
  border-color: rgba(41, 94, 168, 0.18);
  background: linear-gradient(180deg, #ffffff, #f4f8fd);
  color: #12233b;
}

.sidebar .sidebar-guide::before {
  background: linear-gradient(180deg, #8ab1ea, #295ea8);
  box-shadow: 0 0 0 4px rgba(41, 94, 168, 0.12);
}

.sidebar .sidebar-guide:hover {
  border-color: rgba(41, 94, 168, 0.36);
  background: linear-gradient(180deg, #ffffff, #f6f9fe);
}

.sidebar .sidebar-guide.active {
  border-color: rgba(41, 94, 168, 0.52);
  background: linear-gradient(135deg, #eaf2ff, #dce9ff);
  color: #102033;
  box-shadow: inset 0 -3px 0 rgba(18, 35, 59, 0.16), 0 18px 36px rgba(0, 0, 0, 0.18);
}

.sidebar .sidebar-guide .button-icon {
  color: #295ea8;
}

.icon-nav-item {
  grid-template-columns: 20px minmax(0, 1fr) 38px;
  gap: 14px;
  min-height: 64px;
}

.icon-nav-label {
  font-size: 12px;
  line-height: 1.16;
  text-wrap: pretty;
  overflow-wrap: break-word;
}

.icon-nav-item strong {
  min-width: 38px;
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 12px;
  justify-self: end;
}

.icon-nav-group {
  grid-template-columns: 1fr;
  gap: 10px;
}

.status-tab[data-status="Randevu Alınacaklar"],
.status-tab[data-status="Vize Takip"],
.status-tab[data-status="Black List"],
.status-tab[data-status="İptal Olanlar"],
.status-tab[data-status="Arşiv"],
.status-tab[data-status="Ödeme Takip"],
.status-tab[data-status="Evrak Eksikleri"],
.status-tab[data-status="Sonuç Bekleyenler"],
.status-tab[data-status="Pasaport Teslim"] {
  border-top-color: #295ea8;
  background: #ffffff;
}

.status-tab.active,
.status-tab[data-status="Randevu Alınacaklar"].active,
.status-tab[data-status="Vize Takip"].active,
.status-tab[data-status="Black List"].active,
.status-tab[data-status="İptal Olanlar"].active,
.status-tab[data-status="Arşiv"].active,
.status-tab[data-status="Ödeme Takip"].active,
.status-tab[data-status="Evrak Eksikleri"].active,
.status-tab[data-status="Sonuç Bekleyenler"].active,
.status-tab[data-status="Pasaport Teslim"].active {
  border-color: #12233b;
  background: #ffffff;
  color: #12233b;
  box-shadow: inset 0 -4px 0 #295ea8, 0 12px 26px rgba(16, 24, 40, 0.08);
}

.ops-card.urgent,
.ops-card.today,
.ops-card.week,
.ops-card.danger {
  border-color: #cfddef;
  background: linear-gradient(180deg, #ffffff, #f6f9fd);
  color: #173a67;
}

.badge.warn,
.badge.track,
.badge.info,
.ready-panel,
.warning-panel,
.balance-warning,
.payment-currency-banner {
  background: #eef4ff;
  border-color: #cfddef;
  color: #234f8f;
}

.badge.danger,
.blacklist-panel {
  background: #f5f7fb;
  border-color: #dbe3ee;
  color: #44546a;
}

.tab.active {
  box-shadow: inset 0 -4px 0 #295ea8, 0 10px 22px rgba(16, 24, 40, 0.12);
}

.case-card[data-status-group="Randevu Alınacaklar"],
.case-card[data-status-group="Vize Takip"],
.case-card[data-status-group="Black List"],
.case-card[data-status-group="İptal Olanlar"],
.case-card[data-status-group="Arşiv"],
.case-card[data-status-group="Ödeme Takip"],
.case-card[data-status-group="Evrak Eksikleri"],
.case-card[data-status-group="Sonuç Bekleyenler"],
.case-card[data-status-group="Pasaport Teslim"] {
  border-left-color: #295ea8;
  background: #ffffff;
}

.case-card[data-status-group="Ödeme Takip"],
.case-card[data-status-group="Evrak Eksikleri"],
.case-card[data-status-group="Sonuç Bekleyenler"],
.case-card[data-status-group="Pasaport Teslim"] {
  background: linear-gradient(90deg, rgba(41, 94, 168, 0.08), #ffffff 18%);
}

.case-card.payment-partial {
  border-left-color: #295ea8;
  background: linear-gradient(90deg, rgba(41, 94, 168, 0.12) 0 12px, #eef4ff 12px, #ffffff 46%);
}

.case-card.payment-partial .case-next {
  border-color: #cfddef;
  background: #eef4ff;
}

.case-card.payment-partial .appointment-stamp,
.case-card.payment-partial .case-title,
.case-card.payment-paid .appointment-stamp,
.case-card.payment-paid .case-title {
  color: #173a67;
}

.case-card.payment-paid {
  border-left-color: #234f8f;
  background: linear-gradient(90deg, rgba(35, 79, 143, 0.12) 0 12px, #f3f7fd 12px, #ffffff 46%);
}

.case-card.payment-paid .case-next {
  border-color: #d7e3f2;
  background: #f3f7fd;
}

.mobile-queue-bar {
  display: none;
}

.document-rule-card {
  border: 1px solid #dbe3ee;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.06);
}

.document-rule-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.document-rule-card__head strong {
  color: #12233b;
  font-size: 18px;
  font-weight: 900;
}

.compact-check {
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  color: #42546c;
}

@media (max-width: 680px) {
  html,
  body {
    overflow-x: hidden;
  }

  body:not(.mobile-menu-open) .mobile-menu-backdrop {
    pointer-events: none;
  }

  .brand {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    margin-bottom: 18px;
  }

  .brand-logo {
    width: 52px;
    height: 52px;
    border-radius: 16px;
  }

  .brand h1 {
    font-size: 16px;
    line-height: 1.05;
  }

  .brand p {
    font-size: 10px;
    line-height: 1.25;
    opacity: 0.82;
  }

  .icon-nav-group {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .icon-nav-item {
    grid-template-columns: 20px minmax(0, 1fr) 34px;
    min-height: 58px;
    padding: 12px 14px;
    gap: 12px;
    border-radius: 16px;
  }

  .icon-nav-symbol {
    width: 20px;
    height: 20px;
  }

  .icon-nav-symbol svg {
    width: 18px;
    height: 18px;
  }

  .icon-nav-label {
    font-size: 13px;
    font-weight: 800;
    line-height: 1.12;
    text-wrap: balance;
  }

  .icon-nav-item strong {
    min-width: 34px;
    width: 34px;
    height: 34px;
    padding: 0;
    font-size: 12px;
    justify-self: end;
  }

  body.mobile-menu-open .status-tabs {
    display: none;
  }

  .operations-panel {
    display: block;
    margin-bottom: 10px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .operations-panel__copy,
  .operations-panel__metrics {
    display: none;
  }

  .mobile-queue-bar {
    position: sticky;
    top: 64px;
    z-index: 9;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
    padding: 2px 0 0;
    background: rgba(244, 247, 251, 0.96);
  }

  .mobile-queue-tab {
    display: grid;
    grid-template-columns: 1fr;
    align-content: center;
    gap: 4px;
    min-height: 52px;
    padding: 8px 8px 7px;
    border: 1px solid #dbe3ee;
    border-radius: 14px;
    background: #ffffff;
    color: #173a67;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
    font: inherit;
    font-weight: 800;
    text-align: left;
  }

  .mobile-queue-tab span {
    min-width: 0;
    font-size: 10px;
    line-height: 1.15;
    text-align: center;
  }

  .mobile-queue-tab strong {
    display: inline-grid;
    place-items: center;
    justify-self: center;
    min-width: 26px;
    height: 26px;
    padding: 0 7px;
    border-radius: 999px;
    background: #eef4ff;
    color: #295ea8;
    font-size: 11px;
    font-weight: 900;
  }

  .mobile-queue-tab.active {
    border-color: #12233b;
    background: linear-gradient(135deg, #173a67 0%, #295ea8 100%);
    color: #ffffff;
    box-shadow: 0 16px 30px rgba(41, 94, 168, 0.16);
  }

  .mobile-queue-tab.active strong {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
  }

  .mobile-queue-tab--menu {
    background: #12233b;
    color: #ffffff;
  }

  .mobile-queue-tab--menu strong {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
  }

  .status-tabs {
    display: none;
  }

  .detail-head .header-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-head .header-actions .secondary-action,
  .detail-head .header-actions .danger-action {
    min-height: 40px;
    font-size: 12px;
  }

  .tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tab-label {
    font-size: 10.5px;
  }

  .mobile-case-brief {
    align-items: center;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .mobile-case-brief strong {
    font-size: 18px;
    line-height: 1.05;
    color: #12233b;
  }

  .mobile-brief-place strong {
    color: #12233b;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.05;
  }

  .mobile-brief-place small {
    color: #66758a;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
  }

  .mobile-brief-place small:empty {
    display: none;
  }

  .case-card {
    min-height: 88px;
    border-radius: 18px;
    padding: 14px 14px 14px 16px;
    box-shadow: 0 14px 26px rgba(15, 23, 42, 0.06);
  }

  .case-title {
    gap: 4px;
  }

  .case-title > span:first-child {
    font-size: 15px;
    font-weight: 900;
    line-height: 1.15;
    color: #12233b;
  }

  .case-card.active > .case-subtitle {
    display: grid;
    gap: 4px;
    margin-top: 10px;
  }

  .case-card.active > .case-next {
    display: grid;
    gap: 8px;
    margin-top: 10px;
    padding: 10px;
    border-radius: 14px;
  }

  .case-card.active > .badge-row {
    margin-top: 10px;
  }

.document-rule-card__head {
  align-items: flex-start;
  flex-direction: column;
}

@media (max-width: 1360px) {
  .icon-nav-group {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .icon-nav-item {
    grid-template-columns: 20px minmax(0, 1fr) 34px;
    min-height: 60px;
    padding: 12px 14px;
    gap: 10px;
    border-radius: 16px;
  }

  .icon-nav-symbol {
    width: 20px;
    height: 20px;
  }

  .icon-nav-symbol svg {
    width: 18px;
    height: 18px;
  }

  .icon-nav-label {
    font-size: 12px;
    line-height: 1.12;
    white-space: normal;
    overflow-wrap: anywhere;
    text-wrap: balance;
  }

  .icon-nav-item strong {
    min-width: 34px;
    width: 34px;
    height: 34px;
    font-size: 12px;
    padding: 0;
  }
}

@media (max-width: 680px) {
  body {
    background: linear-gradient(180deg, #f4f8fd 0%, #eef3fa 180px, #f8fafd 100%);
  }

  .workspace {
    padding: 10px 10px 18px;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 24;
    margin: -10px -10px 10px;
    padding: 10px;
    background: rgba(247, 250, 253, 0.94);
    border-bottom: 1px solid rgba(207, 221, 239, 0.92);
    backdrop-filter: blur(14px);
  }

  .search-wrap {
    min-height: 42px;
    border-radius: 12px;
    background: #ffffff;
  }

  .search-wrap input {
    font-size: 14px;
  }

  .top-actions {
    gap: 6px;
  }

  .top-actions .icon-button:not(.mobile-menu-button),
  .top-actions > label.icon-button {
    display: none;
  }

  .mobile-menu-button {
    display: grid;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #12233b;
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(18, 35, 59, 0.18);
  }

  .sidebar {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    z-index: 30 !important;
    width: min(90vw, 360px);
    max-width: calc(100vw - 18px);
    min-height: 100dvh;
    padding: 16px 14px 22px;
    gap: 14px;
    background: linear-gradient(180deg, #11253f 0%, #162c4a 100%);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: -24px 0 44px rgba(15, 23, 42, 0.26);
    transform: translate3d(calc(100% + 36px), 0, 0) !important;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition:
      transform 0.24s ease,
      opacity 0.18s ease,
      visibility 0s linear 0.24s;
  }

  body.mobile-menu-open .sidebar {
    transform: translate3d(0, 0, 0) !important;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition:
      transform 0.24s ease,
      opacity 0.18s ease,
      visibility 0s linear 0s;
  }

  .brand {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .brand-logo {
    width: 48px;
    height: 48px;
    padding: 5px;
    border-radius: 14px;
  }

  .brand h1 {
    font-size: 15px;
    line-height: 1.05;
  }

  .brand p {
    font-size: 10px;
    line-height: 1.2;
    color: rgba(226, 232, 240, 0.74);
  }

  .icon-nav-group,
  .nav-group {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .icon-nav-item {
    grid-template-columns: 18px minmax(0, 1fr) 30px;
    min-height: 54px;
    padding: 10px 12px;
    gap: 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
  }

  .icon-nav-item.active {
    background: #ffffff;
    color: #11253f;
    box-shadow: 0 12px 24px rgba(6, 18, 36, 0.2);
  }

  .icon-nav-item.active .icon-nav-label,
  .icon-nav-item.active .icon-nav-symbol {
    color: #11253f;
  }

  .icon-nav-symbol {
    width: 18px;
    height: 18px;
  }

  .icon-nav-symbol svg {
    width: 16px;
    height: 16px;
  }

  .icon-nav-label {
    font-size: 11px;
    line-height: 1.1;
    font-weight: 800;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .icon-nav-item strong {
    min-width: 30px;
    width: 30px;
    height: 30px;
    font-size: 11px;
    background: rgba(255, 255, 255, 0.14);
  }

  .icon-nav-item.active strong {
    background: #eef4fb;
    color: #173a67;
  }

  .sidebar #newCaseBtn,
  .sidebar .sidebar-guide {
    min-height: 46px;
    border-radius: 14px;
  }

  .sidebar .sidebar-guide {
    background: rgba(255, 255, 255, 0.96);
  }

  .sidebar .sidebar-guide .sidebar-button-label,
  .sidebar #newCaseBtn .sidebar-button-label {
    font-size: 13px;
    font-weight: 800;
  }

  .sync-box {
    margin-top: 4px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
  }

  .sync-box strong {
    color: #ffffff;
    font-size: 13px;
  }

  .sync-box p {
    color: rgba(226, 232, 240, 0.72);
    font-size: 11px;
  }

  .workspace {
    min-width: 0;
    overflow-x: clip;
  }

  .list-header {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: start;
    margin-bottom: 8px;
  }

  .list-header h2 {
    font-size: 22px;
    line-height: 1.05;
  }

  .list-header p {
    font-size: 12px;
  }

  .list-header select {
    width: 100%;
    min-height: 40px;
    border-radius: 12px;
    font-size: 13px;
  }

  .mobile-queue-bar {
    top: 62px;
    gap: 6px;
    margin: 0 0 10px;
    padding-top: 0;
    background: rgba(244, 248, 253, 0.98);
  }

  .mobile-queue-tab {
    min-height: 48px;
    padding: 7px 6px;
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
  }

  .mobile-queue-tab span {
    font-size: 9px;
    line-height: 1.1;
  }

  .mobile-queue-tab strong {
    min-width: 24px;
    height: 24px;
    font-size: 10px;
  }

  .case-items {
    gap: 8px;
  }

  .case-card {
    min-height: 84px;
    padding: 12px 12px 12px 14px;
    border-radius: 16px;
    border-left-width: 4px;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.05);
  }

  .case-title {
    gap: 3px;
  }

  .case-title > span:first-child {
    font-size: 14px;
    font-weight: 900;
    line-height: 1.1;
  }

  .appointment-stamp {
    display: none;
  }

  .mobile-case-brief {
    margin-top: 6px;
    align-items: start;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .mobile-brief-place strong {
    font-size: 13px;
    line-height: 1;
  }

  .mobile-brief-place small {
    font-size: 10px;
    line-height: 1.2;
  }

  .mobile-brief-meta {
    display: grid;
    justify-items: end;
    gap: 2px;
    text-align: right;
  }

  .mobile-brief-meta small {
    color: #66758a;
    font-size: 9px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }

  .mobile-brief-meta strong {
    font-size: 15px;
    line-height: 1;
    color: #12233b;
    font-weight: 900;
  }

  .case-card:not(.active) > .case-subtitle,
  .case-card:not(.active) > .case-next,
  .case-card:not(.active) > .badge-row {
    display: none;
  }

  .case-card.active > .case-subtitle {
    margin-top: 8px;
    font-size: 11px;
  }

  .case-card.active > .case-next {
    margin-top: 8px;
    padding: 9px;
  }

  .case-card.active > .badge-row {
    margin-top: 8px;
    gap: 5px;
  }

  .badge {
    font-size: 10px;
    padding: 5px 8px;
  }

  .detail-card {
    border-radius: 16px;
  }

  .detail-head {
    padding: 14px;
  }

  .detail-head .header-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .tab {
    min-height: 52px;
    padding: 8px 6px;
    border-radius: 14px;
  }

  .tab-label {
    font-size: 10px;
    line-height: 1.1;
  }
}
}

.header-icon-action {
  width: 64px;
  min-width: 64px;
  min-height: 56px;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.header-icon-action svg {
  width: 18px;
  height: 18px;
}

.header-action-label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

@media (max-width: 720px) {
  .header-icon-action {
    width: 100%;
    min-width: 0;
    min-height: 52px;
    gap: 3px;
  }

  .header-action-label {
    font-size: 9.5px;
  }
}

.document-browser-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.document-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compact-action {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
}

.folder-row {
  background: linear-gradient(180deg, rgba(18, 35, 59, 0.02) 0%, rgba(18, 35, 59, 0.06) 100%);
}

.folder-row strong::before {
  content: "▸ ";
  color: #295ea8;
}

@media (max-width: 720px) {
  .document-browser-head {
    align-items: stretch;
    flex-direction: column;
  }

  .document-breadcrumbs {
    width: 100%;
  }

  .compact-action {
    min-height: 38px;
    font-size: 11px;
  }
}
