/* MyTV Web Konsol — docs/ui_design_system.md
   Renkler orijinal sistemden: #050857 IMGS/mytv_blue.png, #FFB519 ve #F1F5F8
   page_styles.php içinde zaten vardı. */

:root {
    --navy:    #050857;
    --accent:  #FFB519;
    --bg:      #F1F5F8;
    --surface: #FFFFFF;
    --line:    #E3E8EF;
    --row:     #F2F5F9;
    --ink:     #1B2430;
    --muted:   #6B7685;
    --ok:      #16794C;
    --warn:    #B7791F;
    --err:     #C0362C;
    --sidebar-w: 262px;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", sans-serif;
}

a { color: var(--navy); text-decoration: none; }
a:hover { color: #0A1080; }

.num { font-variant-numeric: tabular-nums; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}

/* ── Kabuk ── */
.shell { display: flex; min-height: 100vh; }
.main  { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { padding: 1.5rem; flex: 1; }

/* ── Sidebar / accordion ── */
.sidebar {
    width: var(--sidebar-w); flex-shrink: 0; background: var(--navy);
    display: flex; flex-direction: column;
}
.sidebar__brand {
    padding: 1.1rem .9rem; border-bottom: 1px solid rgba(255,255,255,.1);
    display: flex; align-items: center; gap: .6rem;
}
.sidebar__mark {
    width: 30px; height: 30px; border-radius: 7px; background: var(--accent); color: var(--navy);
    display: flex; align-items: center; justify-content: center; font-size: .68rem; font-weight: 800;
}
.sidebar__name { font-size: .95rem; font-weight: 800; color: #fff; line-height: 1.15; }
.sidebar__sub  { font-size: .66rem; color: rgba(255,255,255,.5); }
.sidebar__nav  { flex: 1; padding: .5rem 0; overflow-y: auto; }
.sidebar__foot {
    border-top: 1px solid rgba(255,255,255,.1); padding: .75rem .9rem;
    font-size: .84rem; color: #fff; font-weight: 600;
}
.sidebar__foot span { display: block; font-size: .72rem; color: rgba(255,255,255,.5); font-weight: 400; }

.menu__item {
    display: flex; align-items: center; gap: .6rem; width: 100%;
    padding: .58rem .9rem; border: 0; border-left: 3px solid transparent;
    background: transparent; color: rgba(255,255,255,.86);
    font: inherit; font-size: .87rem; text-align: left; cursor: pointer;
}
.menu__item:hover { background: rgba(255,255,255,.07); color: #fff; }
.menu__item[aria-current="page"],
.menu__item.is-active {
    background: rgba(255,255,255,.10); border-left-color: var(--accent);
    color: #fff; font-weight: 600;
}
.menu__label { flex: 1; }
.menu__chevron { display: flex; color: rgba(255,255,255,.45); transition: transform .18s ease; }
.menu__item[aria-expanded="true"] .menu__chevron { transform: rotate(180deg); }

.menu__sub { padding: .15rem 0 .35rem; }
.menu__sub[hidden] { display: none; }
.menu__link {
    display: block; padding: .42rem .9rem .42rem 2.55rem; font-size: .82rem;
    border-left: 3px solid transparent; color: rgba(255,255,255,.62);
}
.menu__link:hover { color: #fff; background: rgba(255,255,255,.06); }
.menu__link[aria-current="page"] {
    border-left-color: var(--accent); background: rgba(255,255,255,.10);
    color: #fff; font-weight: 600;
}

/* ── Topbar ── */
.topbar {
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: .65rem 1.5rem; display: flex; align-items: center; gap: 1rem;
}
.topbar__crumb { font-size: .82rem; color: var(--muted); }
.topbar__spacer { flex: 1; }
.topbar__search {
    display: flex; align-items: center; gap: .5rem; min-width: 200px;
    border: 1px solid var(--line); border-radius: 6px; padding: .35rem .65rem;
    color: var(--muted); font-size: .8rem;
}
.topbar__avatar {
    width: 31px; height: 31px; border-radius: 50%; background: var(--navy); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700;
}
.topbar__user { line-height: 1.2; font-size: .8rem; font-weight: 600; }
.topbar__role { font-size: .7rem; color: var(--muted); font-weight: 400; }
.sidebar-toggle { display: none; background: var(--navy); color: #fff; border: 0; border-radius: 6px; padding: .4rem .55rem; cursor: pointer; }

/* ── Başlıklar ── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.page-title { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.page-sub   { font-size: .82rem; color: var(--muted); margin-top: .25rem; }
.section-label {
    font-size: .74rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
    color: var(--muted); margin-bottom: .7rem;
}

/* ── Kart ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.card--pad { padding: 1.1rem 1.15rem; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.15rem .7rem; }
.card__title { font-size: .95rem; font-weight: 700; }

.grid { display: grid; gap: 1rem; }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

/* ── Sayı kartı ── */
.stat__value { font-size: 1.85rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.stat__label { font-size: .8rem; color: var(--muted); margin-top: .35rem; }
.stat__note  { font-size: .74rem; color: var(--muted); margin-top: .2rem; }
.stat--ok   .stat__value { color: var(--ok); }
.stat--warn .stat__value { color: var(--warn); }
.stat--err  .stat__value { color: var(--err); }

/* ── Modül kartı (legacy admin.php satırlarının karşılığı) ── */
.module { display: flex; align-items: flex-start; gap: .85rem; padding: 1rem 1.1rem; }
.module:hover { border-color: #CFD8E5; }
.module__icon {
    width: 38px; height: 38px; border-radius: 9px; background: #EEF1F8; color: var(--navy);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.module__title { display: block; font-size: .9rem; font-weight: 700; color: var(--navy); }
.module__desc  { display: block; font-size: .78rem; color: var(--muted); line-height: 1.4; margin-top: .15rem; }

/* ── Tablo ── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: left; font-size: .72rem; font-weight: 600; letter-spacing: .04em;
    text-transform: uppercase; color: var(--muted);
    padding: .45rem .75rem; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: .5rem .75rem; border-bottom: 1px solid var(--row); font-size: .85rem; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: #FAFCFE; }
.table .is-right { text-align: right; }

/* ── Rozet ── */
.badge {
    display: inline-block; font-size: .72rem; font-weight: 600;
    padding: .15em .55em; border-radius: 4px; white-space: nowrap;
}
.badge--ok   { background: #E7F4EE; color: var(--ok); }
.badge--warn { background: #FDF3DF; color: var(--warn); }
.badge--err  { background: #FBEAE8; color: var(--err); }
.badge--off  { background: #EEF1F5; color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: .4rem; }

/* ── Buton ── */
.btn {
    display: inline-flex; align-items: center; gap: .4rem; border-radius: 6px;
    padding: .45rem .95rem; font: inherit; font-size: .84rem; font-weight: 600;
    cursor: pointer; border: 1px solid transparent;
}
.btn--primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn--primary:hover { background: #0A1080; color: #fff; }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: #CFD8E5; }

/* ── Form ── */
.field { margin-bottom: .9rem; }
.field__label { display: block; font-size: .78rem; font-weight: 600; color: var(--muted); margin-bottom: .3rem; }
.field__input {
    width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: .55rem .7rem;
    font: inherit; font-size: .88rem; background: var(--surface); color: var(--ink);
}
.field__input:focus { outline: 2px solid rgba(5,8,87,.25); outline-offset: 1px; border-color: var(--navy); }
.alert { border-radius: 6px; padding: .6rem .8rem; font-size: .82rem; margin-bottom: .9rem; }
.alert--err { background: #FBEAE8; color: var(--err); }

/* ── Giriş ekranı ── */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.auth__card { width: 100%; max-width: 380px; }
.auth__brand { display: flex; align-items: center; gap: .6rem; justify-content: center; margin-bottom: 1.25rem; }

/* ── Hata sayfası ── */
.errorpage { min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 1.5rem; }
.errorpage__code { font-size: 3rem; font-weight: 800; color: var(--navy); letter-spacing: -.03em; }

/* ── Duyarlılık ── */
@media (max-width: 1200px) {
    .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid--2-1 { grid-template-columns: minmax(0, 1fr); }
    .sidebar {
        position: fixed; inset: 0 auto 0 0; z-index: 40;
        transform: translateX(-100%); transition: transform .22s ease;
    }
    .sidebar.is-open { transform: translateX(0); }
    .sidebar-toggle { display: inline-flex; }
}
@media (max-width: 720px) {
    .grid--4, .grid--3 { grid-template-columns: minmax(0, 1fr); }
    .content { padding: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
    .sidebar, .menu__chevron { transition: none; }
}
