/* Çözsan Metal — professional dark UI typography layer.
   The system now runs in dark mode only; this layer keeps typography, focus,
   table readability and component polish without changing business logic. */

:root {
  color-scheme: dark;
  --cozsan-font: "Segoe UI Variable Text", "Segoe UI", Inter, system-ui, -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  --cozsan-radius-sm: 12px;
  --cozsan-radius: 18px;
  --cozsan-radius-lg: 24px;
  --cozsan-focus: 0 0 0 4px rgba(45, 137, 239, .18);
  --cozsan-surface-dark: rgba(255, 255, 255, .075);
  --cozsan-border-dark: rgba(255, 255, 255, .14);
  --cozsan-shadow-dark: 0 16px 42px rgba(0, 0, 0, .30);
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-size: 16px;
}

body,
button,
input,
select,
textarea {
  font-family: var(--cozsan-font) !important;
}

body {
  font-size: 15px !important;
  line-height: 1.52;
  letter-spacing: .002em;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.18 !important;
  letter-spacing: -.018em !important;
  text-wrap: balance;
}

p, li, td, th, label, input, select, textarea, button, a {
  line-height: 1.45;
}

small, .muted, .subtle, .labor-muted {
  line-height: 1.45;
}

button,
.btn,
.btnx,
.button,
.link,
.add-project-btn,
.btn-add,
.btn-edit,
.btn-del,
.btn-ekle,
.btn-duzenle,
.btn-sil,
.labor-btn,
.submit-btn {
  font-weight: 800 !important;
  letter-spacing: .005em;
}

input,
select,
textarea {
  font-size: 14.5px !important;
  font-weight: 560;
}

input::placeholder,
textarea::placeholder {
  opacity: .78;
  font-weight: 480;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: none !important;
  box-shadow: var(--cozsan-focus) !important;
}

/* Clearer tables: readable, not cramped. */
table th {
  font-size: 12.5px !important;
  font-weight: 850 !important;
  letter-spacing: .025em !important;
  vertical-align: middle !important;
}

table td {
  font-size: 13.5px !important;
  font-weight: 520;
  vertical-align: middle !important;
}

table th,
table td {
  padding-top: 12px !important;
  padding-bottom: 12px !important;
}

.table-wrap,
.table-box,
.movement-table-wrap,
.stock-table-wrap,
.import-table-wrap {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, .55) transparent;
}

.table-wrap::-webkit-scrollbar,
.table-box::-webkit-scrollbar,
.movement-table-wrap::-webkit-scrollbar,
.stock-table-wrap::-webkit-scrollbar,
.import-table-wrap::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

.table-wrap::-webkit-scrollbar-thumb,
.table-box::-webkit-scrollbar-thumb,
.movement-table-wrap::-webkit-scrollbar-thumb,
.stock-table-wrap::-webkit-scrollbar-thumb,
.import-table-wrap::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, .45);
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
}

/* Shared theme button. The script places it in the most suitable toolbar. */
.cozsan-theme-toggle {
  appearance: none;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .15);
  color: var(--text, #eaf1ff);
  background: rgba(255, 255, 255, .075);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
  cursor: pointer;
  font-size: 12.5px !important;
  font-weight: 850 !important;
  white-space: nowrap;
  transition: transform .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.cozsan-theme-toggle:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, .13);
  border-color: rgba(255, 255, 255, .23);
}

.cozsan-theme-toggle__icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1;
}

.cozsan-theme-toggle--floating {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000000;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .22);
  backdrop-filter: blur(14px);
}

/* Slightly more consistent rounding and motion, while preserving the layout. */
.site-header,
.header,
.panel,
.glass,
.card,
.modern-card,
.stat,
.project-card,
.task-card,
.detail-box,
.box,
.stock-filter,
.stock-hero,
.stock-notice,
.offer-card,
.login-card,
.hero,
.container > form {
  transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

/* ============================================================
   LIGHT MODE
   ============================================================ */
html[data-theme="light"] {
  color-scheme: light;

  --bg0: #edf2f7;
  --bg1: #f8fafc;
  --bg-1: #eef3f8;
  --bg-2: #f7f9fc;
  --bg-3: #e8eef5;

  --text: #182536;
  --muted: rgba(39, 55, 72, .68);
  --stroke: rgba(25, 46, 67, .13);
  --line: rgba(25, 46, 67, .11);
  --line-strong: rgba(25, 46, 67, .18);
  --glass: rgba(255, 255, 255, .88);
  --glass-soft: rgba(255, 255, 255, .68);
  --shadow: 0 20px 55px rgba(32, 55, 77, .11);
  --shadow2: 0 10px 28px rgba(32, 55, 77, .08);
  --danger-bg: rgba(220, 38, 38, .08);
  --danger-line: rgba(220, 38, 38, .22);
  --danger-text: #991b1b;
}

html[data-theme="light"] body {
  color: #182536 !important;
  background:
    radial-gradient(900px 520px at 5% -5%, rgba(45, 137, 239, .10), transparent 62%),
    radial-gradient(820px 520px at 100% 8%, rgba(138, 92, 255, .08), transparent 60%),
    linear-gradient(180deg, #f8fafc 0%, #eef3f7 100%) !important;
}

html[data-theme="light"] body::before {
  opacity: .035 !important;
}

html[data-theme="light"] a {
  color: inherit;
}

html[data-theme="light"] :where(
  .site-header,
  .header,
  .panel,
  .glass,
  .modern-card,
  .stat,
  .project-card,
  .task-card,
  .detail-box,
  .box,
  .card,
  .meta-card,
  .stock-filter,
  .stock-hero,
  .stock-notice,
  .movement-card,
  .offer-card,
  .sheet,
  .comments,
  .comment-box,
  .import-wrap,
  .labor-stage,
  .labor-stat,
  .distribution-chart-card,
  .actual-labor-chart-card,
  .distribution-field-box,
  .login-card,
  .hero,
  .feature,
  .auth-card
) {
  color: #182536 !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(250, 252, 254, .94)) !important;
  border-color: rgba(36, 56, 76, .13) !important;
  box-shadow: 0 14px 36px rgba(31, 49, 68, .075) !important;
}

html[data-theme="light"] :where(.site-header, .header) {
  background: rgba(255, 255, 255, .92) !important;
  backdrop-filter: blur(18px) saturate(1.08) !important;
}

html[data-theme="light"] :where(
  .title span,
  .h-title span,
  .brand-text span,
  .userpill .meta small,
  .user-pill .meta small,
  .usertext small,
  .panel-head small,
  .panel-head .muted,
  .muted,
  .subtle,
  .labor-muted,
  .hero-copy,
  .form-header p,
  .feature span,
  .panel-note,
  .notif-item small,
  .footer-muted
) {
  color: rgba(47, 63, 80, .69) !important;
}

html[data-theme="light"] :where(
  h1, h2, h3, h4, h5, h6,
  .title b,
  .h-title b,
  .brand-text strong,
  .userpill .meta strong,
  .user-pill .meta strong,
  .usertext strong,
  .card-title,
  .project-title,
  .task-title,
  .offer-title,
  .offer-firma
) {
  color: #152235 !important;
}

html[data-theme="light"] :where(
  .btn,
  .btnx,
  .button,
  .link,
  .back,
  .icon-btn,
  .add-project-btn,
  .btn-add,
  .btn-edit,
  .labor-btn,
  .cozsan-theme-toggle
) {
  color: #203146 !important;
  background: linear-gradient(180deg, #ffffff, #f3f6f9) !important;
  border-color: rgba(39, 60, 81, .15) !important;
  box-shadow: 0 6px 16px rgba(30, 50, 70, .06) !important;
}

html[data-theme="light"] :where(.btn-primary, .btnx-primary, .submit-btn, .btn-ekle, .stock-save) {
  color: #ffffff !important;
  background: linear-gradient(135deg, #276fcb, #2d89ef) !important;
  border-color: rgba(37, 99, 180, .38) !important;
  box-shadow: 0 10px 24px rgba(45, 137, 239, .20) !important;
}

html[data-theme="light"] :where(.btn-danger, .btnx-danger, .btn-del, .btn-sil, .link.del, .danger) {
  color: #a51f2d !important;
  background: rgba(220, 38, 38, .075) !important;
  border-color: rgba(220, 38, 38, .20) !important;
  box-shadow: none !important;
}

html[data-theme="light"] :where(.btn-stock) {
  color: #155f4a !important;
  background: linear-gradient(135deg, rgba(45, 137, 239, .10), rgba(46, 204, 113, .11)) !important;
  border-color: rgba(42, 133, 113, .20) !important;
}

html[data-theme="light"] :where(.userpill, .user-pill, .userline, .chip, .meta-chip, .pill, .badge, .top-pill, .mini-stat) {
  color: #26384b !important;
  background: rgba(238, 243, 248, .88) !important;
  border-color: rgba(39, 60, 81, .12) !important;
}

html[data-theme="light"] :where(.avatar, .logo, .h-badge, .footer-badge, .card-icon) {
  border-color: rgba(39, 60, 81, .13) !important;
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  color: #17263a !important;
  background: #ffffff !important;
  border-color: rgba(46, 66, 87, .19) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 1px 2px rgba(29, 48, 67, .03) !important;
}

html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
  color: #7c8997 !important;
}

html[data-theme="light"] input[readonly],
html[data-theme="light"] input:disabled,
html[data-theme="light"] select:disabled,
html[data-theme="light"] textarea:disabled {
  background: #edf2f6 !important;
  color: #687786 !important;
}

html[data-theme="light"] option {
  color: #17263a;
  background: #ffffff;
}

html[data-theme="light"] :where(.table-wrap, .table-box, .stock-table-wrap, .import-table, .materials-section) {
  background: #ffffff !important;
  border-color: rgba(38, 58, 78, .13) !important;
  box-shadow: 0 8px 22px rgba(31, 49, 68, .05) !important;
}

html[data-theme="light"] table {
  color: #1f3044 !important;
  background: #ffffff !important;
}

html[data-theme="light"] table th {
  color: #526273 !important;
  background: linear-gradient(180deg, #f7f9fb, #eef3f7) !important;
  border-color: rgba(44, 65, 86, .12) !important;
}

html[data-theme="light"] table td {
  color: #26384a !important;
  border-color: rgba(44, 65, 86, .09) !important;
}

html[data-theme="light"] table tbody tr:nth-child(even) td {
  background: #fbfcfd !important;
}

html[data-theme="light"] table tbody tr:hover td {
  background: #f3f8fc !important;
}

html[data-theme="light"] :where(.task-status, .badge, .status, .stock-batch-chip) {
  box-shadow: none !important;
}

html[data-theme="light"] #notifDropdown,
html[data-theme="light"] .stock-modal,
html[data-theme="light"] .card-overlay .overlay-inner {
  color: #17263a !important;
  background: rgba(255, 255, 255, .98) !important;
  border-color: rgba(39, 60, 81, .15) !important;
  box-shadow: 0 24px 55px rgba(31, 49, 68, .16) !important;
}

html[data-theme="light"] .notif-item {
  color: #223449 !important;
  border-color: rgba(39, 60, 81, .09) !important;
}

html[data-theme="light"] .notif-item:hover {
  background: #f3f7fa !important;
}

html[data-theme="light"] .main-footer {
  color: #314357 !important;
  background: rgba(255, 255, 255, .88) !important;
  border-color: rgba(39, 60, 81, .13) !important;
  box-shadow: 0 12px 30px rgba(31, 49, 68, .08) !important;
}

html[data-theme="light"] .login-card,
html[data-theme="light"] .hero {
  backdrop-filter: blur(14px) !important;
}

html[data-theme="light"] .logo-box {
  background: #ffffff !important;
  border-color: rgba(39, 60, 81, .14) !important;
}

html[data-theme="light"] .top-pill {
  color: #805200 !important;
  background: rgba(242, 179, 64, .13) !important;
  border-color: rgba(190, 128, 20, .22) !important;
}

html[data-theme="light"] .notice-box {
  color: #1d5d9b !important;
  background: rgba(45, 137, 239, .08) !important;
  border-color: rgba(45, 137, 239, .22) !important;
}

html[data-theme="light"] .error-box,
html[data-theme="light"] .error,
html[data-theme="light"] .hata {
  color: #9f1d2b !important;
  background: rgba(220, 38, 38, .075) !important;
  border-color: rgba(220, 38, 38, .20) !important;
}

html[data-theme="light"] .cozsan-theme-toggle {
  color: #26394d !important;
  background: linear-gradient(180deg, #ffffff, #f4f7fa) !important;
  border-color: rgba(39, 60, 81, .16) !important;
  box-shadow: 0 6px 18px rgba(31, 49, 68, .07) !important;
}

/* Access denied page used by the central authorization layer. */
.cozsan-error-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.cozsan-error-card {
  width: min(520px, 100%);
  padding: 34px;
  text-align: center;
  border-radius: 24px;
  background: rgba(255, 255, 255, .075);
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .30);
}

.cozsan-error-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #ffced3;
  background: rgba(255, 71, 87, .14);
  border: 1px solid rgba(255, 71, 87, .26);
  font-size: 24px;
  font-weight: 900;
}

.cozsan-primary-link {
  display: inline-flex;
  margin-top: 12px;
  padding: 11px 16px;
  border-radius: 12px;
  color: #ffffff;
  background: #2d89ef;
  font-weight: 800;
}

html[data-theme="light"] .cozsan-error-card {
  color: #1a2a3c;
  background: #ffffff;
  border-color: rgba(39, 60, 81, .13);
  box-shadow: 0 22px 50px rgba(31, 49, 68, .12);
}

@media (max-width: 720px) {
  body { font-size: 14.5px !important; }
  table th { font-size: 12px !important; }
  table td { font-size: 13px !important; }
  .cozsan-theme-toggle__label { display: none; }
  .cozsan-theme-toggle { min-width: 42px; padding: 9px 11px; }
}

@media print {
  .cozsan-theme-toggle { display: none !important; }
}

/* ============================================================
   ADMIN USER FORMS — unified with the project visual language
   ============================================================ */
body.admin-form-page {
  min-height: 100vh;
  margin: 0;
  padding: 28px 18px 48px;
  color: var(--text, #eaf1ff);
  background:
    radial-gradient(1050px 620px at 8% -4%, rgba(45, 137, 239, .30), transparent 62%),
    radial-gradient(880px 610px at 96% 8%, rgba(138, 92, 255, .24), transparent 60%),
    linear-gradient(180deg, #070b16, #0b1530);
}

.admin-form-shell {
  width: min(760px, 100%);
  margin: 0 auto;
}

.admin-form-toolbar {
  min-height: 48px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-back {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 9px 14px;
  border-radius: 999px;
  color: rgba(234, 241, 255, .92);
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .13);
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
  transition: transform .18s ease, background-color .18s ease, border-color .18s ease;
}

.admin-back:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .20);
}

.admin-form-card {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 4vw, 38px);
  border-radius: 26px;
  color: #eaf1ff;
  background: linear-gradient(145deg, rgba(255, 255, 255, .115), rgba(255, 255, 255, .045));
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .34);
  backdrop-filter: blur(18px);
}

.admin-form-card::before {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  top: -150px;
  right: -100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45, 137, 239, .18), transparent 68%);
  pointer-events: none;
}

.admin-form-head,
.admin-form,
.admin-form-message,
.admin-security-note {
  position: relative;
  z-index: 1;
}

.admin-form-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  color: #bcd9ff;
  background: rgba(45, 137, 239, .12);
  border: 1px solid rgba(45, 137, 239, .24);
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.admin-form-head h1 {
  margin: 17px 0 8px;
  color: #ffffff;
  font-size: clamp(28px, 5vw, 38px);
  font-weight: 900;
}

.admin-form-head p {
  max-width: 610px;
  margin: 0;
  color: rgba(234, 241, 255, .70);
  font-size: 14px;
  line-height: 1.65;
}

.admin-security-note {
  margin: 20px 0 0;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 15px;
  border-radius: 15px;
  color: #d5eaff;
  background: rgba(45, 137, 239, .10);
  border: 1px solid rgba(45, 137, 239, .20);
  font-size: 12.5px;
  line-height: 1.5;
}

.admin-security-note strong {
  display: block;
  margin-bottom: 2px;
  color: #f0f7ff;
}

.admin-form-message {
  margin: 18px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  color: #ffd4d8;
  background: rgba(255, 71, 87, .13);
  border: 1px solid rgba(255, 71, 87, .28);
  font-size: 13px;
  font-weight: 800;
}

.admin-form {
  margin-top: 23px;
  display: grid;
  gap: 16px;
}

.admin-field {
  display: grid;
  gap: 7px;
}

.admin-field label {
  color: rgba(234, 241, 255, .90);
  font-size: 12.5px;
  font-weight: 850;
}

.admin-field small {
  color: rgba(234, 241, 255, .57);
  font-size: 11px;
  line-height: 1.45;
}

.admin-field input,
.admin-field select {
  min-height: 50px;
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  color: #f7fbff;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03);
}

.admin-field input:hover,
.admin-field select:hover {
  border-color: rgba(255, 255, 255, .23);
}

.admin-field input:focus,
.admin-field select:focus {
  border-color: rgba(45, 137, 239, .62) !important;
  box-shadow: 0 0 0 4px rgba(45, 137, 239, .16) !important;
}

.admin-field select option {
  color: #17263a;
  background: #ffffff;
}

.admin-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 5px;
}

.admin-submit {
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid rgba(45, 137, 239, .42);
  border-radius: 14px;
  color: #ffffff;
  background: linear-gradient(135deg, #236fc8, #2d89ef);
  box-shadow: 0 12px 26px rgba(45, 137, 239, .22);
  font-size: 13.5px;
  font-weight: 900;
  cursor: pointer;
}

.admin-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(45, 137, 239, .28);
}

html[data-theme="light"] body.admin-form-page {
  color: #182536;
  background:
    radial-gradient(900px 520px at 5% -5%, rgba(45, 137, 239, .11), transparent 62%),
    radial-gradient(820px 520px at 100% 8%, rgba(138, 92, 255, .08), transparent 60%),
    linear-gradient(180deg, #f8fafc 0%, #eef3f7 100%) !important;
}

html[data-theme="light"] .admin-back {
  color: #26394d;
  background: linear-gradient(180deg, #ffffff, #f4f7fa);
  border-color: rgba(39, 60, 81, .15);
  box-shadow: 0 6px 18px rgba(31, 49, 68, .06);
}

html[data-theme="light"] .admin-form-card {
  color: #182536;
  background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(249, 252, 254, .96));
  border-color: rgba(36, 56, 76, .13);
  box-shadow: 0 24px 60px rgba(31, 49, 68, .10);
}

html[data-theme="light"] .admin-form-head h1 {
  color: #152235;
}

html[data-theme="light"] .admin-form-head p,
html[data-theme="light"] .admin-field small {
  color: rgba(47, 63, 80, .68);
}

html[data-theme="light"] .admin-form-eyebrow {
  color: #1f5f9f;
  background: rgba(45, 137, 239, .08);
  border-color: rgba(45, 137, 239, .18);
}

html[data-theme="light"] .admin-security-note {
  color: #315b83;
  background: rgba(45, 137, 239, .07);
  border-color: rgba(45, 137, 239, .17);
}

html[data-theme="light"] .admin-security-note strong {
  color: #1f4f7b;
}

html[data-theme="light"] .admin-field label {
  color: #34485b;
}

html[data-theme="light"] .admin-field input,
html[data-theme="light"] .admin-field select {
  color: #17263a !important;
  background: #ffffff !important;
  border-color: rgba(46, 66, 87, .18) !important;
}

@media (max-width: 620px) {
  body.admin-form-page { padding: 16px 12px 32px; }
  .admin-form-card { padding: 22px 17px; border-radius: 21px; }
  .admin-form-toolbar { margin-bottom: 10px; }
  .admin-form-actions { display: grid; }
  .admin-submit { width: 100%; }
}

/* ============================================================
   LIGHT MODE CONTRAST PASS v20260827d
   Keeps the existing layout; fixes pale/white text and white logos.
   ============================================================ */
html[data-theme="light"] {
  --cozsan-light-text: #17263a;
  --cozsan-light-heading: #102033;
  --cozsan-light-body: #27384b;
  --cozsan-light-muted: #667587;
  --cozsan-light-faint: #7a8897;
  --cozsan-light-border: rgba(33, 53, 74, .14);
}

/* Dashboard/header: all primary labels must have strong contrast. */
html[data-theme="light"] :where(
  .brand .title b,
  .h-title b,
  .stat .label b,
  .stat .value,
  .modern-card h3,
  .panel-head b,
  .footer-inner b,
  .userpill .meta strong,
  .user-pill .meta strong
) {
  color: var(--cozsan-light-heading) !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

html[data-theme="light"] :where(
  .brand .title span,
  .h-title span,
  .stat .label span,
  .modern-card p,
  .panel-head small,
  .footer-muted,
  .userpill .meta small,
  .user-pill .meta small,
  .muted,
  .subtle,
  .labor-muted,
  .stock-hero p,
  .stock-table-title small,
  .empty-stock
) {
  color: var(--cozsan-light-muted) !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

html[data-theme="light"] :where(
  .mini .chip,
  .badge,
  .chip,
  .pill,
  .meta-chip,
  .top-pill,
  .mini-stat,
  .userpill,
  .user-pill
) {
  color: #24364a !important;
  opacity: 1 !important;
}

/* Main tables: prevent page-local white rgba rules from winning. */
html[data-theme="light"] :where(.container, .app-shell) table th {
  color: #526274 !important;
  opacity: 1 !important;
  text-shadow: none !important;
}
html[data-theme="light"] :where(.container, .app-shell) table td {
  color: #26384b !important;
  opacity: 1 !important;
  text-shadow: none !important;
}
html[data-theme="light"] :where(.container, .app-shell) table td :where(strong,b) {
  color: #17283b !important;
}
html[data-theme="light"] :where(.container, .app-shell) table td small {
  color: #687789 !important;
  opacity: 1 !important;
}

/* Common legacy page copy that was hard-coded for the dark background. */
html[data-theme="light"] :where(
  .project-title,
  .project-company,
  .task-title,
  .task-name,
  .offer-title,
  .offer-firma,
  .card-title,
  .card-text b,
  .sirket-card,
  .malzeme-list li,
  .report-person-name-link
) {
  color: var(--cozsan-light-text) !important;
  opacity: 1 !important;
}
html[data-theme="light"] :where(
  .project-meta,
  .project-sub,
  .task-meta,
  .card-text,
  .offer-meta,
  .panel-note,
  .field label,
  .movement-extra-note
) {
  color: var(--cozsan-light-muted) !important;
  opacity: 1 !important;
}

/* Footer: it was still using white text intended for dark mode. */
html[data-theme="light"] .main-footer {
  background: rgba(255,255,255,.94) !important;
  border-color: var(--cozsan-light-border) !important;
}
html[data-theme="light"] .footer-inner {
  color: #34475a !important;
  opacity: 1 !important;
}
html[data-theme="light"] .footer-dot {
  background: #9aabba !important;
  opacity: 1 !important;
}

/* The supplied Çözsan logo asset is white-only. Recolor only logo assets,
   never project/product photographs. */
html[data-theme="light"] :where(
  .brand .logo.logo-icon,
  .h-badge.logo-icon,
  .footer-badge.logo-icon,
  .logo-box
) {
  background: linear-gradient(135deg, #eaf2ff, #eef0ff) !important;
  border-color: rgba(45, 91, 150, .17) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9) !important;
}
html[data-theme="light"] :where(
  .brand .logo.logo-icon img,
  .h-badge.logo-icon img,
  .footer-badge.logo-icon img,
  .logo-box img
) {
  filter: brightness(0) saturate(100%) invert(18%) sepia(18%) saturate(1450%) hue-rotate(176deg) brightness(88%) contrast(91%) !important;
  opacity: .96 !important;
}

/* Do not wash out real project/product photos in light mode. */
html[data-theme="light"] :where(
  .project-card img,
  .project-image img,
  .task-card img,
  .offer-card img,
  .preview img,
  .image-preview img,
  .product-image,
  .project-img
) {
  filter: none !important;
  opacity: 1 !important;
}

/* Keep semantic colored buttons/statuses readable after generic overrides. */
html[data-theme="light"] :where(.btn-primary,.btnx-primary,.submit-btn,.btn-ekle,.stock-save,.filter-btn) {
  color: #fff !important;
}
html[data-theme="light"] :where(.btn-danger,.btnx-danger,.btn-del,.btn-sil,.link.del,.danger) {
  color: #a51f2d !important;
}
html[data-theme="light"] :where(.badge.ok,.status.ok,.qty-pill) {
  color: #17633d !important;
}
html[data-theme="light"] :where(.badge.wait,.status.wait) {
  color: #765a00 !important;
}
html[data-theme="light"] :where(.badge.late,.status.late) {
  color: #9f2330 !important;
}

/* Inputs/selects on older pages often hard-code a dark fill. */
html[data-theme="light"] :where(.container,.app-shell) input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="light"] :where(.container,.app-shell) select,
html[data-theme="light"] :where(.container,.app-shell) textarea {
  color: #17263a !important;
  background: #fff !important;
  border-color: rgba(39, 60, 81, .20) !important;
}
html[data-theme="light"] :where(.container,.app-shell) select option {
  color: #17263a !important;
  background: #fff !important;
}
html[data-theme="light"] .stock-batch-history-toggle {
  color: #245d99 !important;
  background: #eef6ff !important;
  border-color: #cbdff5 !important;
}
html[data-theme="light"] .stock-batch-history {
  background: #f7fafc !important;
  border-color: #dce5ec !important;
}
html[data-theme="light"] .stock-batch-history-row {
  border-bottom-color: #e4eaf0 !important;
  color: #26384b !important;
}
html[data-theme="light"] .stock-batch-history-row .batch-index {
  color: #526273 !important;
  background: #e8eef4 !important;
}
html[data-theme="light"] .stock-batch-history-row .batch-qty { color: #17633d !important; }
html[data-theme="light"] .stock-batch-history-row .batch-date { color: #34485d !important; }
html[data-theme="light"] .stock-batch-history-row .batch-supplier { color: #687789 !important; }
html[data-theme="light"] .stock-batch-btn {
  color: #17633d !important;
  background: #edf9f2 !important;
  border-color: #bce2cb !important;
}

/* ============================================================
   LIGHT MODE COMPLETE TASK-DETAIL FIX v20260827e
   Explicitly fixes page-local dark components in gorev_detay.php.
   ============================================================ */
html[data-theme="light"] .labor-wrap {
  color: #17263a !important;
  background: linear-gradient(180deg,#ffffff 0%,#f8fbfd 100%) !important;
  border-color: #d7e2ea !important;
  box-shadow: 0 14px 34px rgba(31,49,68,.08) !important;
}
html[data-theme="light"] .labor-wrap h1,
html[data-theme="light"] .labor-wrap h2,
html[data-theme="light"] .labor-wrap h3,
html[data-theme="light"] .labor-wrap h4,
html[data-theme="light"] .labor-wrap strong {
  color: #152235 !important;
}
html[data-theme="light"] .labor-wrap .labor-muted {
  color: #687789 !important;
  opacity: 1 !important;
}
html[data-theme="light"] .labor-wrap .labor-stat {
  color: #17263a !important;
  background: linear-gradient(180deg,#ffffff,#f3f7fa) !important;
  border-color: #d3dfe8 !important;
  box-shadow: 0 5px 14px rgba(31,49,68,.055) !important;
}
html[data-theme="light"] .labor-wrap .labor-add-stage input,
html[data-theme="light"] .labor-wrap .labor-table input {
  color: #17263a !important;
  background: #ffffff !important;
  border-color: #cdd9e2 !important;
}
html[data-theme="light"] .labor-wrap .labor-add-stage input::placeholder,
html[data-theme="light"] .labor-wrap .labor-table input::placeholder {
  color: #8a98a7 !important;
  opacity: 1 !important;
}
html[data-theme="light"] .labor-wrap .labor-stage {
  color: #17263a !important;
  background: #ffffff !important;
  border-color: #d5e0e8 !important;
  box-shadow: 0 8px 22px rgba(31,49,68,.06) !important;
}
html[data-theme="light"] .labor-wrap .labor-stage-title {
  color: #17263a !important;
  background: #f3f7fa !important;
  border-bottom-color: #dbe4eb !important;
}
html[data-theme="light"] .labor-wrap .labor-table {
  color: #26384b !important;
  background: #ffffff !important;
}
html[data-theme="light"] .labor-wrap .labor-table thead th {
  color: #526274 !important;
  background: #eef3f7 !important;
  border-color: #dbe4eb !important;
}
html[data-theme="light"] .labor-wrap .labor-table td {
  color: #26384b !important;
  background: #ffffff !important;
  border-color: #e5ebf0 !important;
}
html[data-theme="light"] .labor-wrap .labor-table tbody tr:nth-child(even) td {
  background: #fafcfe !important;
}
html[data-theme="light"] .labor-wrap .labor-table tbody tr:hover td {
  background: #f2f7fb !important;
}
html[data-theme="light"] .labor-wrap .labor-entry-form td,
html[data-theme="light"] .labor-wrap .labor-data-row.is-editing td {
  background: #eef6ff !important;
}

/* Keep action buttons semantic and readable in light mode. */
html[data-theme="light"] .labor-wrap .labor-btn {
  color: #ffffff !important;
  background: #2d89ef !important;
  border-color: #2476cf !important;
  box-shadow: 0 6px 14px rgba(45,137,239,.18) !important;
}
html[data-theme="light"] .labor-wrap .labor-btn.edit {
  color: #3e2d00 !important;
  background: #f6b52f !important;
  border-color: #dea21f !important;
}
html[data-theme="light"] .labor-wrap .labor-btn.danger {
  color: #ffffff !important;
  background: #dc3545 !important;
  border-color: #c62f3e !important;
}
html[data-theme="light"] .labor-wrap .labor-btn.cancel {
  color: #ffffff !important;
  background: #64748b !important;
  border-color: #55657a !important;
}

/* Materials section and print button in task detail. */
html[data-theme="light"] .materials-head .print-btn,
html[data-theme="light"] .print-btn {
  color: #1f5f9f !important;
  background: #eaf4ff !important;
  border-color: #9ec9f6 !important;
  box-shadow: 0 5px 14px rgba(45,137,239,.08) !important;
  opacity: 1 !important;
}
html[data-theme="light"] .materials-head .print-btn:hover,
html[data-theme="light"] .print-btn:hover {
  color: #174d82 !important;
  background: #dceeff !important;
  border-color: #78b4ee !important;
}

/* Task-detail notices and inline dark legacy elements. */
html[data-theme="light"] .stock-notice {
  color: #315b83 !important;
  background: #eef7ff !important;
  border-color: #cbdff1 !important;
}
html[data-theme="light"] .stock-notice.old {
  color: #765a00 !important;
  background: #fff8df !important;
  border-color: #ecd785 !important;
}
html[data-theme="light"] .stock-notice.error {
  color: #9c2834 !important;
  background: #fff0f2 !important;
  border-color: #efc2c8 !important;
}
html[data-theme="light"] .stock-notice.success {
  color: #17633d !important;
  background: #eefaf3 !important;
  border-color: #bfe2cd !important;
}
html[data-theme="light"] .duplicate-note {
  color: #735800 !important;
  background: #fff5c8 !important;
  border-color: #e7cf6d !important;
}
html[data-theme="light"] .import-conflict-box {
  color: #4c3678 !important;
  background: #f6f0ff !important;
  border-color: #d5c2f3 !important;
}
html[data-theme="light"] .import-conflict-title { color:#51357d !important; }

/* Stock batch modal was still dark in light mode. */
html[data-theme="light"] .stock-modal-backdrop {
  background: rgba(25,39,54,.42) !important;
}
html[data-theme="light"] .stock-modal {
  color: #17263a !important;
  background: #ffffff !important;
  border-color: #d7e1e9 !important;
  box-shadow: 0 28px 70px rgba(31,49,68,.20) !important;
}
html[data-theme="light"] .stock-form-grid label { color:#34485b !important; }
html[data-theme="light"] .stock-form-grid input,
html[data-theme="light"] .stock-form-grid select,
html[data-theme="light"] .stock-form-grid textarea {
  color:#17263a !important;
  background:#ffffff !important;
  border-color:#cfdbe4 !important;
}
html[data-theme="light"] .stock-cancel {
  color:#34485b !important;
  background:#eef2f6 !important;
  border:1px solid #d4dee6 !important;
}

/* Ensure disabled controls stay legible instead of almost disappearing. */
html[data-theme="light"] button:disabled,
html[data-theme="light"] .btn:disabled,
html[data-theme="light"] input:disabled,
html[data-theme="light"] select:disabled {
  opacity: .62 !important;
}
