:root {
  --bg: #f4f6f6;
  --surface: #ffffff;
  --line: #d8e1de;
  --text: #13201d;
  --muted: #64736f;
  --strong: #08756c;
  --strong-dark: #0b4f49;
  --ink: #101d1a;
  --blue: #176a86;
  --amber: #a66b00;
  --danger: #a23b31;
  --shadow: 0 14px 34px rgba(16, 32, 29, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

body:not(.session-ready) [data-auth-panel],
body:not(.session-ready) [data-protected-panel] {
  display: none !important;
}

body:not(.session-ready) .main::before {
  display: grid;
  min-height: 100vh;
  place-items: center;
  color: var(--muted);
  content: "Oturum kontrol ediliyor...";
  font-weight: 800;
}

button,
input,
select {
  font: inherit;
}

button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: var(--strong);
  color: #fff;
  padding: 0 14px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

button:not(:disabled):hover,
.link-button:hover {
  background: var(--strong-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

button,
a,
.link-button,
.nav-link,
.quiet-button,
.quiet-link,
.link-card,
input,
select {
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease,
    opacity 140ms ease;
}

button:disabled:hover {
  background: var(--strong);
  color: #fff;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(8, 117, 108, 0.2);
  outline-offset: 2px;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 10px 11px;
}

select {
  min-width: 138px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

td:last-child,
th:last-child {
  text-align: right;
}

.shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100vh;
  border-right: 1px solid #28423d;
  background: var(--ink);
  color: #edf5f3;
  padding: 18px;
}

body:not(.is-authenticated) .shell {
  grid-template-columns: 1fr;
}

body:not(.is-authenticated) .sidebar {
  position: fixed;
  z-index: 2;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  grid-template-rows: auto;
  border-right: 0;
  border-bottom: 1px solid #28423d;
}

body:not(.is-authenticated) .nav-list,
body:not(.is-authenticated) .session-box {
  display: none;
}

body:not(.is-authenticated) .auth-layout,
body:not(.is-authenticated) .auth-card {
  padding-top: 96px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--strong);
  color: #fff;
  font-size: 22px;
  font-weight: 900;
}

.brand-block strong,
.brand-block span {
  display: block;
}

.brand-block span {
  margin-top: 2px;
  color: #a9bdb8;
  font-size: 12px;
  font-weight: 700;
}

.nav-list {
  display: grid;
  align-content: start;
  gap: 6px;
  margin-top: 30px;
}

.nav-link {
  border-radius: 6px;
  color: #c9d9d5;
  padding: 10px 11px;
  text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
  background: #203934;
  color: #fff;
}

.session-box {
  display: grid;
  gap: 10px;
  border-top: 1px solid #314b46;
  padding-top: 16px;
  color: #bfd0cc;
}

.quiet-button {
  border: 1px solid #48625d;
  background: transparent;
}

.quiet-button:hover {
  background: #203934;
}

.quiet-button.danger-action {
  border-color: #d9aca6;
  color: var(--danger);
}

.quiet-button.danger-action:hover {
  background: #fff0ef;
}

.quiet-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid #48625d;
  border-radius: 6px;
  color: var(--text);
  padding: 0 10px;
  font-weight: 800;
  text-decoration: none;
}

.quiet-link:hover {
  border-color: var(--strong);
  background: #eef9f6;
}

.main {
  min-width: 0;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(320px, 1.2fr);
  gap: 26px;
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
  padding: 42px 28px;
}

.auth-card {
  display: grid;
  gap: 16px;
  align-items: start;
  max-width: 480px;
  margin: 0 auto;
  padding: 42px 24px;
}

.auth-copy {
  display: grid;
  gap: 16px;
  padding-top: 10px;
}

.eyebrow {
  margin: 0;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

.auth-copy h1,
.topbar h1 {
  margin-bottom: 10px;
  font-size: 34px;
  line-height: 1.06;
}

.auth-copy p,
.panel p {
  color: var(--muted);
  line-height: 1.58;
}

.auth-forms,
.provision-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 16px;
}

.provision-grid {
  align-items: start;
}

.panel,
.section-band,
.preview-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  display: grid;
  gap: 13px;
  padding: 18px;
}

.preview-card {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.preview-card div {
  display: grid;
  gap: 4px;
  border-left: 3px solid var(--strong);
  padding-left: 12px;
}

.preview-card span {
  color: var(--muted);
  line-height: 1.45;
}

.panel-heading,
.section-title,
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel-heading.compact {
  margin-top: 8px;
}

.panel-heading h2,
.section-title h2 {
  margin: 0;
  font-size: 20px;
}

.panel-heading span,
.section-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.workspace {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.hidden {
  display: none !important;
}

.topbar {
  min-height: 62px;
}

.topbar-copy {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.link-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.section-band {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.summary-grid,
.dashboard-grid,
.info-grid,
.link-grid {
  display: grid;
  gap: 12px;
}

.summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.dashboard-grid {
  grid-template-columns: minmax(280px, 0.8fr) minmax(360px, 1.2fr);
  align-items: stretch;
}

.metric,
.system-card,
.info-card,
.link-card,
.action-card {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  padding: 14px;
}

.action-card {
  display: grid;
  align-content: center;
  gap: 10px;
  height: 100%;
}

.action-card strong {
  font-size: 22px;
}

.action-card p,
.highlight-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.metric.accent {
  background: #eaf7f3;
  border-color: #b8ddd3;
}

.metric span,
.system-card span,
.info-card span,
.link-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric strong,
.system-card strong {
  display: block;
  margin-top: 9px;
  font-size: 24px;
}

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

.info-card {
  display: grid;
  gap: 7px;
}

.info-card span {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.5;
}

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

.link-card {
  display: grid;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
}

.link-card:hover {
  border-color: #9ed2c7;
  background: #eef9f6;
}

.link-card strong {
  font-size: 17px;
}

.link-card span {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.companies-table {
  min-width: 860px;
}

.companies-table th:last-child,
.companies-table td:last-child {
  width: 210px;
}

.table-toolbar {
  display: flex;
  justify-content: flex-end;
}

.table-toolbar label {
  width: min(220px, 100%);
}

.status-pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  background: #eaf7f3;
  color: var(--strong-dark);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 850;
}

.status-pill.warn {
  background: #fff4db;
  color: var(--amber);
}

.status-pill.active {
  background: #e9f4fb;
  color: var(--blue);
}

.status-pill.muted {
  background: #eef1f0;
  color: var(--muted);
}

.progress-line {
  width: 132px;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5ecea;
}

.progress-line span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--strong);
}

.status-select {
  max-width: 154px;
  border-color: #b8ddd3;
  background: #fff;
  color: var(--strong-dark);
  font-weight: 800;
}

.subtext {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.table-action {
  min-height: 30px;
  padding: 0 10px;
}

.row-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  min-width: 180px;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.section-actions span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fbfa;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.company-detail-page {
  display: grid;
  gap: 12px;
}

.detail-page-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-page-bar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.company-fact-grid .metric strong {
  overflow-wrap: anywhere;
  font-size: 20px;
}

.compact-title {
  margin-top: 4px;
}

.billing-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.feature-toggle-list {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
}

.feature-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  padding: 10px;
}

.feature-toggle input {
  width: 18px;
  height: 18px;
}

.feature-toggle span,
.feature-toggle strong,
.feature-toggle small {
  display: block;
}

.feature-toggle small {
  margin-top: 3px;
  color: var(--muted);
}

.billing-projection-card {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.billing-projection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.billing-projection-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.billing-projection-head strong {
  font-size: 22px;
}

.billing-projection-lines {
  display: grid;
  gap: 8px;
}

.billing-projection-lines span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.billing-projection-lines small {
  color: var(--muted);
  font-weight: 750;
  white-space: nowrap;
}

.invoice-line-row td {
  background: #f8fbfa;
}

.invoice-line-row span {
  display: inline-flex;
  margin: 3px 8px 3px 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 5px 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.invoice-line-breakdown {
  display: grid;
  gap: 8px;
}

.invoice-line-row .invoice-line-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  border-radius: 8px;
  padding: 8px 10px;
}

.invoice-line-item strong {
  color: var(--ink);
}

.invoice-line-item small {
  color: var(--muted);
  font-weight: 750;
  white-space: nowrap;
}

.field-row,
.system-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

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

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

.stack {
  display: grid;
  gap: 16px;
}

.highlight-panel {
  border-color: #b8ddd3;
  background: #eef9f6;
}

.highlight-panel > strong {
  font-size: 24px;
}

.setup-list {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.setup-list li {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  padding: 12px;
}

.setup-list span {
  color: var(--muted);
  line-height: 1.45;
}

.notice {
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: #edf8fb;
  color: #144c5e;
  padding: 12px 14px;
  font-weight: 750;
}

.notice.error {
  border-left-color: var(--danger);
  background: #fff0ef;
  color: var(--danger);
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    grid-template-rows: auto;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-layout,
  .dashboard-grid,
  .auth-forms,
  .provision-grid,
  .metric-grid,
  .summary-grid,
  .info-grid,
  .link-grid,
  .system-grid,
  .compact-grid,
  .billing-settings-grid,
  .feature-toggle-list,
  .field-row {
    grid-template-columns: 1fr;
  }

  .workspace {
    padding: 16px;
  }

  .topbar,
  .section-title,
  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}
