/* ==========================================================================
   Design Phili Akademi — Panel Tasarım Sistemi
   Palet sitenin kendi tonlarından: mor #5a008b, turuncu #ff6400, koyu #2a2a2a
   Tipografi: Poppins (siteyle aynı)
   ========================================================================== */

:root {
    /* Marka */
    --brand:          #5a008b;
    --brand-600:      #4a0073;
    --brand-400:      #7c2fa8;
    --brand-soft:     #f4ecf8;
    --accent:         #ff6400;
    --accent-soft:    #fff2e8;

    /* Nötr */
    --ink:            #2a2a2a;
    --ink-2:          #5c5c66;
    --ink-3:          #8a8a96;
    --line:           #e8e6ec;
    --line-2:         #f2f1f5;
    --surface:        #ffffff;
    --canvas:         #faf9fb;

    /* Durum */
    --ok:             #157f4a;
    --ok-soft:        #e7f5ee;
    --warn:           #9a6700;
    --warn-soft:      #fff6e0;
    --danger:         #b42318;
    --danger-soft:    #fdecea;
    --live:           #e02424;

    --radius:         10px;
    --radius-sm:      7px;
    --shadow:         0 1px 2px rgba(42, 42, 42, .05), 0 4px 16px rgba(90, 0, 139, .05);
    --sidebar-w:      264px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --brand:      #b06ed0;
        --brand-600:  #c48ade;
        --brand-400:  #9a58bd;
        --brand-soft: #2c1c36;
        --accent:     #ff8534;
        --accent-soft:#3a2415;

        --ink:        #ececf1;
        --ink-2:      #a9a8b6;
        --ink-3:      #7e7d8c;
        --line:       #2f2d38;
        --line-2:     #262430;
        --surface:    #1c1a24;
        --canvas:     #141319;

        --ok-soft:    #16301f;
        --warn-soft:  #33280e;
        --danger-soft:#3a1a17;
        --shadow:     none;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--canvas);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p  { margin: 0; }
a  { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Kabuk ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--line-2);
}
.sidebar-brand .mark {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--brand), var(--brand-400));
    color: #fff;
    display: grid; place-items: center;
    font-weight: 700; font-size: 14px;
    flex: 0 0 32px;
}
.sidebar-brand b { font-size: 14px; font-weight: 600; display: block; line-height: 1.2; }
.sidebar-brand span { font-size: 11px; color: var(--ink-3); }

.sidebar-nav { padding: 14px 12px; flex: 1; overflow-y: auto; }
.nav-label {
    font-size: 10px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
    color: var(--ink-3); padding: 12px 10px 6px;
}
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; margin-bottom: 2px;
    border-radius: var(--radius-sm);
    color: var(--ink-2); font-weight: 500;
    text-decoration: none;
    transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--line-2); color: var(--ink); text-decoration: none; }
.nav-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-item .ico { width: 18px; text-align: center; opacity: .85; font-size: 15px; }
.nav-item .count {
    margin-left: auto; font-size: 11px; font-weight: 600;
    color: var(--ink-3); background: var(--line-2);
    padding: 1px 7px; border-radius: 20px;
}
.nav-item.active .count { background: var(--surface); color: var(--brand); }

.sidebar-foot { border-top: 1px solid var(--line-2); padding: 14px; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--brand-soft); color: var(--brand);
    display: grid; place-items: center; font-weight: 600; font-size: 12px;
    flex: 0 0 32px;
}
.user-chip .meta { min-width: 0; flex: 1; }
.user-chip .meta b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .meta span { font-size: 11px; color: var(--ink-3); }
.user-chip a { color: var(--ink-3); font-size: 16px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    display: flex; align-items: center; gap: 16px;
    padding: 18px 28px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    position: sticky; top: 0; z-index: 10;
}
.topbar .sub { color: var(--ink-3); font-size: 12px; margin-top: 1px; }
.topbar .actions { margin-left: auto; display: flex; gap: 8px; }
.menu-toggle { display: none; background: none; border: 0; font-size: 20px; color: var(--ink-2); cursor: pointer; padding: 0; }

.content { padding: 24px 28px 48px; max-width: 1240px; width: 100%; }

/* ---------- KPI ---------- */
.kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.kpi {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow);
}
.kpi .label {
    font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
    color: var(--ink-3); display: flex; align-items: center; gap: 7px;
}
.kpi .value { font-size: 27px; font-weight: 600; letter-spacing: -.02em; margin-top: 6px; line-height: 1.15; }
.kpi .foot { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.kpi.is-live { border-color: var(--live); }
.kpi.is-live .value { color: var(--live); }

/* ---------- Kart ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}
.card-head {
    display: flex; align-items: center; gap: 12px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--line-2);
}
.card-head .desc { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.card-head .actions { margin-left: auto; display: flex; gap: 8px; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }

/* ---------- Tablo ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
    text-align: left; font-weight: 600; font-size: 11px;
    letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3);
    padding: 10px 18px; border-bottom: 1px solid var(--line);
    white-space: nowrap; background: var(--canvas);
}
table.data td {
    padding: 13px 18px;
    border-bottom: 1px solid var(--line-2);
    vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--line-2); }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
table.data td .strong { font-weight: 600; }
table.data td .muted { color: var(--ink-3); font-size: 12px; }
td.row-actions { text-align: right; white-space: nowrap; }

/* ---------- Rozet ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11px; font-weight: 600;
    padding: 3px 9px; border-radius: 20px;
    white-space: nowrap;
}
.badge-live    { background: var(--danger-soft); color: var(--live); }
.badge-live::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
    background: var(--live); animation: pulse 1.6s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.badge-ok      { background: var(--ok-soft); color: var(--ok); }
.badge-wait    { background: var(--warn-soft); color: var(--warn); }
.badge-muted   { background: var(--line-2); color: var(--ink-3); }
.badge-brand   { background: var(--brand-soft); color: var(--brand); }
.badge-accent  { background: var(--accent-soft); color: var(--accent); }

/* ---------- Buton ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    font-family: inherit; font-size: 13px; font-weight: 500;
    padding: 8px 15px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--surface); color: var(--ink);
    cursor: pointer; text-decoration: none;
    transition: background .12s, border-color .12s, opacity .12s;
    white-space: nowrap;
}
.btn:hover { background: var(--line-2); text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { opacity: .9; background: var(--accent); }
.btn-danger { color: var(--danger); border-color: var(--line); background: transparent; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- Form ---------- */
.field { margin-bottom: 14px; }
.field label {
    display: block; font-size: 12px; font-weight: 600;
    color: var(--ink-2); margin-bottom: 5px;
}
.field .hint { font-size: 11px; color: var(--ink-3); margin-top: 4px; }
input[type=text], input[type=email], input[type=password],
input[type=datetime-local], select, textarea {
    width: 100%;
    font-family: inherit; font-size: 13px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--canvas);
    color: var(--ink);
    transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
    background: var(--surface);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------- Bildirim ---------- */
.alert {
    display: flex; align-items: flex-start; gap: 9px;
    padding: 11px 14px; border-radius: var(--radius-sm);
    font-size: 13px; margin-bottom: 18px;
    border: 1px solid transparent;
}
.alert-ok    { background: var(--ok-soft); color: var(--ok); border-color: rgba(21,127,74,.18); }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: rgba(180,35,24,.18); }
.alert-info  { background: var(--brand-soft); color: var(--brand); border-color: rgba(90,0,139,.15); }

/* ---------- Boş durum ---------- */
.empty { text-align: center; padding: 44px 20px; color: var(--ink-3); }
.empty .ico { font-size: 30px; opacity: .35; margin-bottom: 10px; }
.empty p { font-size: 13px; margin-bottom: 4px; color: var(--ink-2); font-weight: 500; }
.empty .sub { font-size: 12px; color: var(--ink-3); }

/* ---------- Giriş ekranı ---------- */
.auth {
    min-height: 100vh; display: grid; place-items: center; padding: 24px;
    background:
        radial-gradient(1000px 500px at 50% -10%, var(--brand-soft), transparent 70%),
        var(--canvas);
}
.auth-card {
    width: 100%; max-width: 388px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 32px;
    box-shadow: 0 10px 40px rgba(90, 0, 139, .09);
}
.auth-card .mark {
    width: 44px; height: 44px; border-radius: 11px;
    background: linear-gradient(135deg, var(--brand), var(--brand-400));
    color: #fff; display: grid; place-items: center;
    font-weight: 700; font-size: 17px; margin-bottom: 18px;
}
.auth-card h1 { font-size: 20px; margin-bottom: 4px; }
.auth-card .sub { font-size: 13px; color: var(--ink-3); margin-bottom: 22px; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 12px; color: var(--ink-3); }

/* ---------- Canlı ders ---------- */
.stage {
    background: #111014;
    border-radius: var(--radius);
    padding: 14px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 12px;
    min-height: 380px;
    align-content: start;
}
.stage video { width: 100%; border-radius: 8px; background: #000; display: block; }
.stage:empty::after {
    content: 'Yayın bekleniyor…';
    color: #6c6a75; font-size: 13px;
    grid-column: 1 / -1; place-self: center;
}
.room-bar {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2);
}
.room-bar .spacer { margin-left: auto; }
.room-bar form { display: inline; }

video.player { width: 100%; border-radius: var(--radius); background: #000; display: block; }

/* ---------- Duyarlı ---------- */
@media (max-width: 900px) {
    .sidebar {
        position: fixed; left: 0; top: 0; z-index: 50;
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: 0 0 40px rgba(0,0,0,.18);
    }
    .sidebar.open { transform: translateX(0); }
    .menu-toggle { display: block; }
    .grid-2, .form-row { grid-template-columns: 1fr; }
    .content, .topbar { padding-left: 16px; padding-right: 16px; }
}
