@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700&family=Roboto+Mono:wght@400;500&display=swap');

:root,
[data-bs-theme="dark"] {
    --crm-ink: #060a14;
    --crm-navy: #0a1020;
    --crm-navy-2: #111b33;
    --crm-navy-3: #172443;
    --crm-paper: #f4f7ff;
    --crm-haze: #aab7d2;
    --crm-muted: #71809f;
    --crm-volt: #2e7bff;
    --crm-volt-bright: #70a8ff;
    --crm-line: rgba(157, 181, 224, .14);
    --crm-line-strong: rgba(111, 168, 255, .34);
    --bs-body-bg: var(--crm-ink);
    --bs-body-color: var(--crm-paper);
    --bs-secondary-color: var(--crm-haze);
    --bs-secondary-bg: var(--crm-navy-2);
    --bs-tertiary-bg: var(--crm-navy);
    --bs-border-color: var(--crm-line);
    --bs-primary: var(--crm-volt);
    --bs-primary-rgb: 46, 123, 255;
    --bs-link-color: var(--crm-volt-bright);
    --bs-link-hover-color: #9bc0ff;
}

body.crm-body { min-height: 100vh; background: var(--crm-ink); color: var(--crm-paper); font-family: "DM Sans", sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6, .navbar-brand { font-family: "Manrope", sans-serif; letter-spacing: -.025em; }
.skip-link { position: fixed; top: -80px; left: 18px; z-index: 1100; padding: .7rem 1rem; border-radius: .5rem; background: #fff; color: #060a14; }
.skip-link:focus { top: 12px; }

.crm-app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.crm-sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 1.35rem 1rem 1rem; border-right: 1px solid var(--crm-line); background: linear-gradient(180deg,var(--crm-navy),var(--crm-ink)); }
.crm-sidebar > .crm-brand { padding: .35rem .65rem 1.5rem; }
.side-nav { display: grid; gap: .25rem; }
.side-nav a { display: flex; align-items: center; gap: .7rem; padding: .68rem .72rem; border: 1px solid transparent; border-radius: .65rem; color: var(--crm-haze); font-size: .89rem; transition: .2s; }
.side-nav a:hover { background: rgba(255,255,255,.025); color: var(--crm-paper); }
.side-nav a.active { border-color: rgba(46,123,255,.22); background: rgba(46,123,255,.12); color: #fff; }
.side-icon { display: grid; flex: 0 0 auto; place-items: center; width: 27px; height: 27px; border: 1px solid var(--crm-line); border-radius: .45rem; color: var(--crm-volt-bright); transition: border-color .2s, color .2s; }
.side-icon svg { width: 15px; height: 15px; }
/* Aktif ve hover durumunda ikon kutusu da metinle birlikte öne çıkar. */
.side-nav a:hover .side-icon { border-color: rgba(255,255,255,.14); }
.side-nav a.active .side-icon { border-color: rgba(46,123,255,.4); color: #fff; }
.side-label { margin: 1.25rem .72rem .45rem; color: var(--crm-muted); font: 500 .62rem/1 "Roboto Mono",monospace; letter-spacing: .13em; text-transform: uppercase; }
.side-user { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: auto; padding: 1rem .65rem 0; border-top: 1px solid var(--crm-line); }
.side-user small,.side-user span { display: block; max-width: 125px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user small { color: var(--crm-muted); font: .6rem/1.4 "Roboto Mono",monospace; text-transform: uppercase; }
.side-user span { color: var(--crm-haze); font-size: .72rem; }
.crm-workspace { min-width: 0; }
.crm-mobilebar { display: none; }
.crm-public-head { display: flex; align-items: center; min-height: 72px; padding-inline: clamp(1.2rem,4vw,3rem); border-bottom: 1px solid var(--crm-line); background: var(--crm-navy); }
.crm-login-main { min-height: calc(100vh - 72px); }
.crm-brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--crm-paper) !important; font-size: 1rem; font-weight: 700; }
.crm-brand-mark { display: grid; width: 25px; gap: 3px; transform: skewX(-12deg); }
.crm-brand-mark i { display: block; height: 5px; border-radius: 2px; background: var(--crm-volt); }
.crm-brand-mark i:nth-child(2) { opacity: .68; }
.crm-brand-mark i:nth-child(3) { opacity: .35; }
.crm-product { margin-left: .15rem; padding: .34rem .52rem; border: 1px solid rgba(46,123,255,.3); border-radius: 999px; background: rgba(46,123,255,.12); color: var(--crm-volt-bright); font: 500 .64rem/1 "Roboto Mono", monospace; letter-spacing: .1em; }
.crm-links { margin-left: clamp(1rem, 4vw, 4rem); gap: .4rem; }
.crm-links .nav-link { position: relative; padding: .75rem .85rem !important; color: var(--crm-haze); font-size: .9rem; }
.crm-links .nav-link:hover, .crm-links .nav-link.active { color: var(--crm-paper); }
.crm-links .nav-link.active::after { position: absolute; right: .8rem; bottom: .15rem; left: .8rem; height: 2px; border-radius: 2px; background: var(--crm-volt); content: ""; }
.crm-user .navbar-text { color: var(--crm-haze); }

.crm-main { width: 100%; max-width: 1600px; min-height: 100vh; margin-inline: auto; padding: clamp(1.4rem,3vw,2.5rem); }
.crm-main > .d-flex:first-child h1 { font-size: clamp(1.55rem, 2.4vw, 2.15rem) !important; font-weight: 700; }
.page-head { display:flex; align-items:flex-end; justify-content:space-between; gap:1rem; margin-bottom:1.4rem; }
.page-head .page-kicker { color:var(--crm-volt-bright); font:500 .64rem/1 "Roboto Mono",monospace; letter-spacing:.12em; text-transform:uppercase; margin-bottom:.5rem; }
.page-head h1 { margin:0; font-size:clamp(1.55rem,2.5vw,2.2rem); }
.money { font-family:"Roboto Mono",monospace; white-space:nowrap; }
.document-total { font:700 clamp(1.5rem,3vw,2.2rem)/1 "Manrope",sans-serif; }
.flow-note { border-left:2px solid var(--crm-volt); padding-left:1rem; color:var(--crm-haze); }

.card, .stat-card { overflow: hidden; border: 1px solid var(--crm-line); border-radius: .9rem; background: linear-gradient(145deg, var(--crm-navy-2), rgba(10,16,32,.86)); box-shadow: 0 18px 50px -38px #000 !important; }
.card-header { min-height: 52px; padding: .9rem 1.1rem; border-bottom-color: var(--crm-line); background: rgba(255,255,255,.018) !important; }
.stat-card { position: relative; padding: 1.15rem !important; transition: transform .2s, border-color .2s; }
.stat-card::before { position: absolute; top: 0; right: 1.1rem; left: 1.1rem; height: 1px; background: linear-gradient(90deg,transparent,var(--crm-volt),transparent); opacity: .55; content: ""; }
a:hover .stat-card { transform: translateY(-3px); border-color: var(--crm-line-strong); }
.stat-card .stat-value { color: var(--crm-paper); font: 700 2rem/1.1 "Manrope", sans-serif; }
.stat-card .stat-label { margin-top: .4rem; color: var(--crm-muted); font: .66rem/1.4 "Roboto Mono", monospace; letter-spacing: .06em; text-transform: uppercase; }

.btn { border-radius: 999px; font-weight: 600; }
.btn-primary { --bs-btn-bg: var(--crm-volt); --bs-btn-border-color: var(--crm-volt); --bs-btn-hover-bg: #4389ff; --bs-btn-hover-border-color: #4389ff; }
.btn-outline-secondary, .btn-outline-primary, .btn-outline-light { --bs-btn-color: var(--crm-haze); --bs-btn-border-color: var(--crm-line-strong); --bs-btn-hover-bg: rgba(46,123,255,.12); --bs-btn-hover-border-color: var(--crm-volt-bright); --bs-btn-hover-color: var(--crm-paper); }
.form-control, .form-select { border-color: var(--crm-line); border-radius: .65rem; background-color: var(--crm-navy); color: var(--crm-paper); }
.form-control:focus, .form-select:focus { border-color: var(--crm-volt); background-color: var(--crm-navy); color: var(--crm-paper); box-shadow: 0 0 0 .2rem rgba(46,123,255,.13); }
.form-label { color: var(--crm-muted); font-family: "Roboto Mono", monospace; letter-spacing: .045em; }
.form-check-input { border-color: var(--crm-line-strong); background-color: var(--crm-navy); }

.table-wrap { overflow-x: auto; }
.table { --bs-table-bg: transparent; --bs-table-color: var(--crm-paper); --bs-table-border-color: var(--crm-line); --bs-table-hover-bg: rgba(46,123,255,.055); --bs-table-hover-color: var(--crm-paper); }
.table > thead { --bs-table-bg: rgba(255,255,255,.025); --bs-table-color: var(--crm-haze); }
.table > thead th { padding-top: .85rem; padding-bottom: .85rem; border-bottom-width: 1px; font: 500 .67rem/1.2 "Roboto Mono", monospace; letter-spacing: .055em; text-transform: uppercase; white-space: nowrap; }
.table > tbody td { padding-top: .78rem; padding-bottom: .78rem; }
.list-group-item { border-color: var(--crm-line); background: transparent; color: var(--crm-paper); }
.list-group-item-action:hover { background: rgba(46,123,255,.06); color: var(--crm-paper); }

.badge { border-radius: 999px; font-weight: 600; }
.bg-purple { background-color: #714dcc !important; color: #fff; }
.bg-teal { background-color: #32cfa0 !important; color: #06281f; }
.score-pill { min-width: 3rem; display: inline-block; text-align: center; }
.evidence-text { color: var(--crm-haze); font-size: .875rem; white-space: pre-wrap; }
.source-url { word-break: break-all; font-size: .875rem; }
.timeline { list-style: none; padding-left: 0; margin: 0; border-left: 1px solid var(--crm-line-strong); }
.timeline > li { position: relative; padding: .25rem 0 1.15rem 1.25rem; }
.timeline > li::before { position: absolute; top: .58rem; left: -.34rem; width: .65rem; height: .65rem; border: 2px solid var(--crm-navy); border-radius: 50%; background: var(--crm-volt); content: ""; }
.alert { border-radius: .75rem; }
code { color: var(--crm-volt-bright); }

@media (max-width: 991.98px) {
    .crm-app { grid-template-columns:1fr; }
    .crm-sidebar { display:none; }
    .crm-mobilebar { position:sticky; top:0; z-index:900; display:flex; align-items:center; justify-content:space-between; min-height:66px; padding-inline:1rem; border-bottom:1px solid var(--crm-line); background:rgba(6,10,20,.94); backdrop-filter:blur(16px); }
    .offcanvas { background:var(--crm-navy); }
}
@media (max-width: 620px) {
    .crm-footer { flex-direction: column; }
    .crm-brand > span:nth-child(2) { max-width: 135px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
/* Sales document helpers */
.empty-state {
  padding: 3rem 1.5rem;
  color: var(--bs-secondary-color);
  text-align: center;
}

.print-only { display: none; }

@media print {
  .crm-sidebar, .crm-mobilebar, .document-actions, .toast-container { display: none !important; }
  .crm-workspace { margin: 0 !important; padding: 0 !important; }
  .print-only { display: block; }
  .card { border: 0 !important; box-shadow: none !important; }
  body { background: white !important; }
}
