/* Mascha Ajans Paneli — marka paleti: flutter_application_1/lib/theme/app_palette.dart */
:root {
  --brand: #DB1470;
  --brand-d: #C3125F;
  --brand-soft: #FFF0F6;
  --brand-line: #FFB3D0;
  --plum: #2E0A2D;
  --bg: #F9F4F7;
  --card: #FFFFFF;
  --line: #E6D9E2;
  --tx: #1C121B;
  --tx2: #5C4B58;
  --tx3: #7D6A78;
  --ok: #16A34A; --ok-bg: #E9F8EF;
  --warn: #B45309; --warn-bg: #FFF6E5;
  --bad: #DC2626; --bad-bg: #FDECEC;
  --gold: #E8A400;
  --agency: #8E1477;
  --r: 16px;
  --sh: 0 1px 2px rgba(46,10,45,.05), 0 6px 20px rgba(46,10,45,.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #F84F93; --brand-d: #FF85B2; --brand-soft: #362035; --brand-line: #6B1462;
    --bg: #120912; --card: #1C0F1C; --line: #362035;
    --tx: #F9F4F7; --tx2: #CFBDCA; --tx3: #A6929F;
    --ok: #4ADE80; --ok-bg: #12301E; --warn: #FBBF24; --warn-bg: #33270C; --bad: #F87171; --bad-bg: #3A1414;
    --agency: #E07BCB; --gold: #FFC83D;
    --sh: none;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: Inter, system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--tx); font-size: 14px; line-height: 1.5; min-height: 100vh; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.ms { font-family: "Material Symbols Rounded"; font-weight: normal; font-style: normal; font-size: 22px; line-height: 1; display: inline-block; vertical-align: middle; font-variation-settings: "FILL" 0, "wght" 500; -webkit-font-smoothing: antialiased; }
.ms.sm { font-size: 18px; }
.muted { color: var(--tx3); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.dia::after { content: " 💎"; font-size: .85em; }

/* Butonlar */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-weight: 600; }
.btn:hover { border-color: var(--brand-line); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-d); }
.btn.danger { color: var(--bad); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.block { width: 100%; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .55; cursor: default; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; color: var(--tx2); }
.icon-btn:hover { background: var(--brand-soft); color: var(--brand); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Giriş */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px;
  background: radial-gradient(1200px 500px at 20% -10%, rgba(219,20,112,.18), transparent 60%), radial-gradient(900px 400px at 110% 110%, rgba(142,20,119,.16), transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 28px 22px; box-shadow: var(--sh); display: flex; flex-direction: column; gap: 14px; }
.auth-card.center { text-align: center; align-items: center; }
.auth-card h1 { font-size: 22px; letter-spacing: -.01em; }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.brand img { border-radius: 12px; }
.brand b { display: block; font-size: 18px; color: var(--brand); letter-spacing: -.01em; }
.brand span { display: block; font-size: 12px; color: var(--tx3); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; color: var(--tx2); }
.field input, .custom input, .toolbar input, .toolbar select { width: 100%; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-size: 15px; }
.field input:focus, .custom input:focus, .toolbar input:focus, .toolbar select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(219,20,112,.15); }
.pw { position: relative; display: block; }
.pw input { padding-right: 48px; }
.pw .icon-btn { position: absolute; right: 2px; top: 2px; }
.err { background: var(--bad-bg); color: var(--bad); border-radius: 10px; padding: 10px 12px; font-weight: 600; font-size: 13px; }
.big-ico { width: 64px; height: 64px; border-radius: 20px; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; }
.big-ico .ms { font-size: 34px; }

/* Üst çubuk */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.ag { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.ag-logo { width: 40px; height: 40px; border-radius: 12px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; flex: none; overflow: hidden; }
.ag-logo img { width: 100%; height: 100%; object-fit: cover; }
.ag-txt { min-width: 0; }
.ag-txt b { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-txt span { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabs { display: flex; gap: 4px; }
.tabs button { position: relative; display: flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 8px 12px; border-radius: 10px; font-weight: 600; color: var(--tx2); }
.tabs button.on { background: var(--brand-soft); color: var(--brand); }
.tabs button.on .ms { font-variation-settings: "FILL" 1, "wght" 500; }
.dot { position: absolute; top: 6px; right: 6px; min-width: 8px; height: 8px; border-radius: 99px; background: var(--brand); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 16px 16px 40px; }

/* Dönem seçici */
.period { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 16px; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; max-width: 100%; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: 13px; color: var(--tx2); }
.chips button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.custom { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.custom label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--tx3); }
.custom input { min-height: 38px; font-size: 14px; }
.period-lbl { font-size: 13px; font-weight: 600; }

/* Kartlar */
.grid { display: grid; gap: 12px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); }
.kpi { padding: 14px 16px; }
.kpi small { display: flex; align-items: center; gap: 6px; color: var(--tx3); font-weight: 600; font-size: 12px; }
.kpi b { display: block; font-size: 24px; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--tx3); margin-top: 2px; }
.kpi.hero { background: linear-gradient(135deg, #DB1470, #8E1477); border: 0; color: #fff; }
.kpi.hero small, .kpi.hero .sub { color: rgba(255,255,255,.85); }
.box { padding: 16px; }
.box h3 { font-size: 15px; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.box h3 .muted { font-weight: 600; font-size: 12px; }
.two { grid-template-columns: 1.6fr 1fr; margin-bottom: 16px; }
@media (max-width: 860px) { .two { grid-template-columns: 1fr; } }

/* Günlük grafik */
.chart { display: flex; align-items: flex-end; gap: 3px; height: 180px; padding-top: 8px; }
.chart .col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; position: relative; }
.chart .bar { background: var(--brand); border-radius: 4px 4px 0 0; min-height: 0; opacity: .9; }
.chart .bar.agp { background: var(--agency); border-radius: 0; }
.chart .col:hover .bar { opacity: 1; filter: brightness(1.08); }
.chart-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--tx3); margin-top: 6px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--tx2); margin-top: 10px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tip { position: fixed; z-index: 60; pointer-events: none; background: var(--plum); color: #fff; font-size: 12px; padding: 8px 10px; border-radius: 10px; line-height: 1.4; max-width: 220px; }

/* Kaynak dağılımı */
.src { display: flex; flex-direction: column; gap: 10px; }
.src-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: 13px; }
.src-row .track { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--brand-soft); overflow: hidden; }
.src-row .track i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.src-row .r { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.src-row .r small { display: block; font-weight: 500; color: var(--tx3); font-size: 11px; }

/* Listeler */
.ulist { display: flex; flex-direction: column; }
.urow { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.urow:first-child { border-top: 0; }
.urow .grow { flex: 1; min-width: 0; }
.urow .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.av { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; overflow: hidden; }
.av.lg { width: 56px; height: 56px; font-size: 20px; }
.live { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 6px; background: #E11D48; color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .04em; vertical-align: 1px; }
.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; background: var(--bg); color: var(--tx2); border: 1px solid var(--line); }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.empty { padding: 28px 12px; text-align: center; color: var(--tx3); }
.empty .ms { font-size: 36px; display: block; margin: 0 auto 8px; color: var(--brand-line); }

/* Yayıncı tablosu */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.toolbar .search { flex: 1 1 220px; position: relative; }
.toolbar .search .ms { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--tx3); font-size: 20px; }
.toolbar .search input { padding-left: 40px; }
.toolbar select { width: auto; min-width: 170px; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 700; color: var(--tx3); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover td { background: var(--brand-soft); }
.tbl .r { text-align: right; }
.tbl tfoot td { font-weight: 800; border-top: 2px solid var(--line); border-bottom: 0; cursor: default; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who .name { font-weight: 600; }
.who .meta { font-size: 12px; color: var(--tx3); }
.agc { color: var(--agency); font-weight: 700; }
@media (max-width: 720px) {
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tfoot { display: block; }
  .tbl tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; padding: 12px; border-bottom: 1px solid var(--line); }
  .tbl tbody tr:hover td { background: transparent; }
  .tbl td { border: 0; padding: 0; }
  .tbl td.c-who { grid-column: 1 / -1; margin-bottom: 4px; }
  .tbl td[data-l]::before { content: attr(data-l); display: block; font-size: 11px; font-weight: 600; color: var(--tx3); }
  .tbl .r { text-align: left; }
  .tbl tfoot tr { background: var(--brand-soft); border-radius: 0 0 var(--r) var(--r); }
  .tbl td.hide-sm { display: none; }
}

/* İstekler & davet */
.req-actions { display: flex; gap: 6px; flex: none; }
.invite { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 28px 16px; }
.code { font-size: 40px; font-weight: 800; letter-spacing: .14em; color: var(--brand); font-variant-numeric: tabular-nums; padding: 8px 20px; border: 2px dashed var(--brand-line); border-radius: 16px; background: var(--brand-soft); word-break: break-all; }
.invite-text { max-width: 560px; background: var(--bg); border-radius: 12px; padding: 12px 14px; color: var(--tx2); text-align: left; white-space: pre-wrap; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* Detay paneli */
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(28,18,27,.5); display: flex; justify-content: flex-end; }
.sheet-box { width: min(720px, 100%); height: 100%; background: var(--bg); display: flex; flex-direction: column; animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.sheet-hdr { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 12px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.sheet-hdr b { font-size: 16px; }
.sheet-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.prof { display: flex; align-items: center; gap: 14px; padding: 16px; }
.prof .name { font-size: 18px; font-weight: 700; }
.streams .urow { align-items: flex-start; }
.streams .r { text-align: right; flex: none; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
  .sheet { align-items: flex-end; }
  .sheet-box { height: 92vh; border-radius: 20px 20px 0 0; overflow: hidden; animation-name: up; }
  @keyframes up { from { transform: translateY(40px); opacity: 0; } }
}

.skel { background: linear-gradient(90deg, var(--line) 0%, var(--bg) 50%, var(--line) 100%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 12px; min-height: 90px; }
@keyframes sk { to { background-position: -200% 0; } }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70; background: var(--plum); color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: calc(100% - 32px); }
.toast.bad { background: var(--bad); }

/* Telefon: sekmeler alt çubukta */
@media (max-width: 720px) {
  /* backdrop-filter, sabit alt sekme çubuğu için kapsayıcı blok oluşturur → telefonda kapalı */
  .top { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--card); }
  .top-in { padding: 8px 12px; }
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--card); border-top: 1px solid var(--line); justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabs button { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 8px; flex: 1; }
  .dot { top: 4px; right: calc(50% - 18px); }
  .wrap { padding-bottom: 96px; }
  .kpi b { font-size: 20px; }
  .code { font-size: 30px; }
}
@media (max-width: 400px) { .hide-xs { display: none; } }
