/* ==========================================================
   Samet Keçici · Admin Panel CSS
========================================================== */
:root {
    --bg: #0a0c14;
    --bg-2: #11141e;
    --bg-3: #181c29;
    --line: #232838;
    --line-2: #2c3245;
    --text: #eaecf3;
    --muted: #8c92a6;
    --muted-2: #5d6378;
    --accent: #FFC857;
    --accent-2: #21D4FD;
    --ok: #39d98a;
    --warn: #ffb84d;
    --err: #ff5b6a;
    --grad: linear-gradient(135deg, #FFC857 0%, #ff9d6c 100%);
    --r: 12px; --r-lg: 18px;
    --shadow: 0 30px 60px -25px rgba(0,0,0,.65);
    --side-w: 240px;
    --side-w-c: 76px;
    --ease: cubic-bezier(.22,1,.36,1);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg); color: var(--text);
    min-height: 100vh; -webkit-font-smoothing: antialiased;
    line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
button { background: none; border: 0; cursor: pointer; padding: 0; color: inherit; font: inherit; }
input, select, textarea {
    font: inherit; color: inherit; -webkit-appearance: none; appearance: none;
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; }

.hidden { display: none !important; }

/* ============== LOGIN ============== */
.login-screen {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(900px 600px at 70% 20%, rgba(255,200,87,.08), transparent 60%) var(--bg);
    padding: 24px;
}
.login-card {
    width: 100%; max-width: 420px;
    background: var(--bg-2); border: 1px solid var(--line);
    border-radius: var(--r-lg); padding: 36px;
    box-shadow: var(--shadow);
}
.login-brand { display: flex; gap: 14px; align-items: center; margin-bottom: 28px; }
.brand-mark {
    width: 44px; height: 44px; border-radius: 12px;
    background: var(--grad); color: #1a1300;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-family: 'Space Grotesk', sans-serif;
}
.login-brand h1 { margin: 0; font-size: 20px; font-family: 'Space Grotesk', sans-serif; }
.login-brand p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
#login-form label { display: block; margin-bottom: 14px; }
#login-form span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
#login-form input {
    width: 100%; padding: 12px 14px; background: var(--bg);
    border: 1px solid var(--line); border-radius: 10px; outline: none;
    transition: border-color .2s;
}
#login-form input:focus { border-color: var(--accent); }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 20px; border-radius: 10px; font-weight: 600; font-size: 14px;
    transition: transform .15s, background .2s, color .2s, border .2s, box-shadow .2s;
    border: 1px solid transparent;
}
.btn-primary { background: var(--grad); color: #1a1300; width: 100%; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 30px -10px rgba(255,200,87,.5); }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { background: var(--bg-3); border-color: var(--accent); }
.btn-danger { background: rgba(255,91,106,.12); color: #ffb1b8; border-color: rgba(255,91,106,.3); }
.btn-danger:hover { background: rgba(255,91,106,.2); }
.btn-sm { padding: 7px 12px; font-size: 12px; }
.form-status { margin-top: 12px; font-size: 13px; min-height: 18px; text-align: center; }
.form-status.ok { color: var(--ok); }
.form-status.err { color: var(--err); }
.login-foot { text-align: center; margin-top: 22px; font-size: 13px; color: var(--muted); }
.login-foot a { color: var(--accent); }

/* ============== APP LAYOUT ============== */
.app { display: flex; min-height: 100vh; }

.side {
    width: var(--side-w); background: var(--bg-2); border-right: 1px solid var(--line);
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
    transition: width .3s var(--ease);
}
.side.collapsed { width: var(--side-w-c); }
.side.collapsed .brand-text, .side.collapsed .side-nav span, .side.collapsed .ghost-link span:not(.brand-mark), .side.collapsed .badge { display: none; }
.side.collapsed .side-nav a, .side.collapsed .ghost-link { justify-content: center; padding: 12px; }
.side.collapsed .side-toggle { transform: rotate(180deg); }

.side-brand {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px; border-bottom: 1px solid var(--line);
}
.brand { display: flex; gap: 10px; align-items: center; font-family: 'Space Grotesk', sans-serif; font-weight: 700; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; font-size: 13px; }
.side-toggle {
    width: 26px; height: 26px; border-radius: 6px; background: var(--bg-3); color: var(--muted); font-size: 14px;
    transition: transform .25s;
}
.side-toggle:hover { color: var(--text); background: var(--line); }

.side-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.side-nav a {
    display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px;
    color: var(--muted); font-size: 14px; font-weight: 500; transition: all .2s;
    position: relative;
}
.side-nav a:hover { color: var(--text); background: var(--bg-3); }
.side-nav a.active { color: var(--accent); background: rgba(255,200,87,.08); }
.side-nav a.active::before {
    content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px;
    background: var(--accent);
}
.side-nav i { font-style: normal; font-size: 16px; min-width: 20px; text-align: center; }
.badge {
    margin-left: auto; background: var(--err); color: #fff; font-size: 10px;
    padding: 2px 7px; border-radius: 999px; font-weight: 700;
}

.side-foot { padding: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.ghost-link {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px;
    color: var(--muted); font-size: 13px; transition: all .2s;
}
.ghost-link:hover { color: var(--text); background: var(--bg-3); }

/* ============== TOPBAR ============== */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; gap: 16px;
    padding: 16px 28px;
    background: rgba(10,12,20,.85); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.burger { display: none; font-size: 22px; }
.top h2 { margin: 0; font-family: 'Space Grotesk', sans-serif; font-size: 18px; font-weight: 700; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.usr { color: var(--muted); font-size: 13px; }
.usr::before { content: '◉ '; color: var(--ok); }

@media (max-width: 900px) {
    .side {
        position: fixed; top: 0; left: 0; bottom: 0; transform: translateX(-100%);
        z-index: 100; transition: transform .3s var(--ease); width: 240px;
    }
    .side.open { transform: translateX(0); box-shadow: 30px 0 60px rgba(0,0,0,.5); }
    .burger { display: block; }
    .side.collapsed { width: 240px; }
    .side.collapsed .brand-text, .side.collapsed .side-nav span, .side.collapsed .ghost-link span { display: inline; }
}

/* ============== VIEW ============== */
.view { padding: 28px; }
@media (max-width: 700px) { .view { padding: 20px 16px; } }

.loader { text-align: center; padding: 60px; color: var(--muted); }

/* ============== CARDS / KPI ============== */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi {
    background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r);
    padding: 20px; position: relative; overflow: hidden;
    transition: transform .25s, border-color .2s;
}
.kpi:hover { transform: translateY(-2px); border-color: var(--line-2); }
.kpi small { color: var(--muted); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; }
.kpi b { display: block; font-family: 'Space Grotesk', sans-serif; font-size: 32px; font-weight: 700; margin: 6px 0 2px; }
.kpi .delta { font-size: 12px; color: var(--ok); }
.kpi .ic { position: absolute; right: 16px; top: 16px; opacity: .25; font-size: 30px; }
.kpi.warn b { color: var(--warn); }
.kpi.err b { color: var(--err); }

.card {
    background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r);
    padding: 22px; margin-bottom: 18px;
}
.card h3 { margin: 0 0 14px; font-family: 'Space Grotesk', sans-serif; font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card h3 small { color: var(--muted); font-size: 12px; font-weight: 400; }

.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } }

/* ============== TABLE ============== */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-2); }
table.tbl { width: 100%; border-collapse: collapse; min-width: 600px; }
.tbl th, .tbl td { padding: 13px 14px; text-align: left; font-size: 13px; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--muted); font-weight: 600; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; background: var(--bg-3); position: sticky; top: 0; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: rgba(255,255,255,.02); }
.tbl .actions { display: flex; gap: 6px; }
.tbl img.thumb { width: 48px; height: 32px; border-radius: 6px; object-fit: cover; }
.tag {
    display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
    background: rgba(255,255,255,.06); color: var(--muted);
}
.tag.ok { background: rgba(57,217,138,.15); color: #82e9b8; }
.tag.warn { background: rgba(255,184,77,.15); color: #ffd494; }
.tag.err { background: rgba(255,91,106,.15); color: #ffadb4; }
.tag.gold { background: rgba(255,200,87,.15); color: var(--accent); }

/* ============== TOOLBAR ============== */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input[type="search"] {
    flex: 1; min-width: 180px; padding: 10px 14px; background: var(--bg-2);
    border: 1px solid var(--line); border-radius: 10px; outline: none; font-size: 13px;
}
.toolbar input[type="search"]:focus { border-color: var(--accent); }

/* ============== FORM (modal) ============== */
.modal {
    position: fixed; inset: 0; z-index: 1000;
    display: none; align-items: flex-start; justify-content: center;
    padding: 40px 20px; overflow-y: auto;
}
.modal.show { display: flex; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(6px); }
.modal-card {
    position: relative; width: 100%; max-width: 720px;
    background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg);
    padding: 28px; box-shadow: var(--shadow);
    margin: auto;
}
.modal-card h3 { margin: 0 0 22px; font-family: 'Space Grotesk', sans-serif; font-size: 22px; font-weight: 700; }
.modal-card .close { position: absolute; top: 14px; right: 18px; font-size: 26px; color: var(--muted); }
.modal-card .close:hover { color: var(--text); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.form-row.full { grid-template-columns: 1fr; }
label.field { display: block; }
label.field span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
label.field input, label.field textarea, label.field select {
    width: 100%; padding: 11px 13px; background: var(--bg);
    border: 1px solid var(--line); border-radius: 10px; outline: none;
    font-size: 14px; transition: border-color .2s;
}
label.field input:focus, label.field textarea:focus, label.field select:focus { border-color: var(--accent); }
label.field textarea { min-height: 80px; resize: vertical; font-family: inherit; }
label.check { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; cursor: pointer; }
label.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }

.preview-box {
    margin-top: 8px; padding: 12px; background: var(--bg);
    border: 1px dashed var(--line-2); border-radius: 10px;
    display: flex; gap: 12px; align-items: center;
}
.preview-box img { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; background: var(--bg-3); }
.preview-box small { color: var(--muted); font-size: 12px; }
.preview-box b { display: block; font-size: 13px; }

/* Repeater rows for skills/services/testimonials */
.repeater { display: flex; flex-direction: column; gap: 10px; }
.repeater-row {
    display: grid; grid-template-columns: 30px 1fr; gap: 10px;
    background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px;
}
.repeater-row .handle { color: var(--muted-2); cursor: grab; align-self: center; text-align: center; font-size: 18px; }
.repeater-fields { display: grid; grid-template-columns: 2fr 1fr 1fr 32px; gap: 8px; align-items: center; }
.repeater-fields input, .repeater-fields select, .repeater-fields textarea {
    padding: 9px 10px; background: var(--bg-2); border: 1px solid var(--line);
    border-radius: 8px; outline: none; font-size: 13px; width: 100%;
}
.repeater-fields textarea { grid-column: 1/-1; }
.repeater-fields .del { color: var(--err); font-size: 18px; }

/* ============== TOAST ============== */
.toast {
    position: fixed; bottom: 24px; right: 24px; z-index: 1100;
    background: var(--bg-3); border: 1px solid var(--accent); color: var(--text);
    padding: 13px 22px; border-radius: 10px; font-size: 14px; font-weight: 500;
    opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s;
    transform: translateY(20px);
    box-shadow: var(--shadow); max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.err { border-color: var(--err); }
.toast.ok { border-color: var(--ok); }

/* ============== DASHBOARD bits ============== */
.list-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.list-row:last-child { border-bottom: 0; }
.list-row .pl { color: var(--text); }
.list-row .pl small { display: block; color: var(--muted); font-size: 11px; }
.list-row .v { color: var(--accent); font-weight: 700; font-family: 'Space Grotesk', sans-serif; }

/* Empty */
.empty {
    text-align: center; padding: 80px 20px; color: var(--muted);
    border: 1px dashed var(--line); border-radius: var(--r);
}
.empty .ic { font-size: 48px; margin-bottom: 14px; opacity: .5; }
.empty h4 { margin: 0 0 6px; color: var(--text); font-size: 18px; }
.empty p { margin: 0 0 18px; }

.chart-wrap { position: relative; height: 280px; }
.dn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 700px) { .dn-grid { grid-template-columns: 1fr; } }
