/* =====================================================================
   LACİVERT MEDİKAL — Yönetim Paneli Tasarımı
   ===================================================================== */
:root {
    --navy-900: #0a1c44; --navy-800: #0f2557; --navy-700: #16337a; --navy-600: #1e419b;
    --brand: #16337a; --brand-dark: #0f2557; --accent: #17b6c4; --accent-dark: #0f8f9b;
    --ink: #10233f; --body: #3f4d63; --muted: #6b7a92; --line: #e3e9f2;
    --bg: #f4f7fc; --card: #fff;
    --ok: #0d7a4f; --ok-bg: #e7f8f0; --err: #b32338; --err-bg: #fdeaec; --warn: #a86a00; --warn-bg: #fdf3e2;
    --radius: 14px; --radius-sm: 10px; --shadow-sm: 0 2px 10px rgba(15,37,87,.06); --shadow: 0 10px 30px rgba(15,37,87,.10);
    --sidebar-w: 264px;
    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-head: "Poppins", var(--font);
}
* , *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--body); line-height: 1.6; -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
h1,h2,h3,h4 { font-family: var(--font-head); color: var(--ink); line-height: 1.25; }
input, select, textarea, button { font-family: inherit; font-size: 1rem; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(135deg, var(--navy-900), var(--navy-600)); }
.login-card { background: #fff; border-radius: 20px; box-shadow: 0 30px 70px rgba(0,0,0,.3); width: 100%; max-width: 420px; padding: 44px 38px; }
.login-brand { text-align: center; margin-bottom: 30px; }
.login-brand .mark { width: 62px; height: 62px; border-radius: 16px; background: linear-gradient(135deg, var(--navy-700), var(--accent)); display: grid; place-items: center; color: #fff; margin: 0 auto 16px; }
.login-brand .mark svg { width: 34px; height: 34px; }
.login-brand h1 { font-size: 1.5rem; margin-bottom: 4px; }
.login-brand p { color: var(--muted); font-size: .92rem; }

/* ---------- Layout shell ---------- */
.admin { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar { background: var(--navy-900); color: #b9c6e0; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow-y: auto; }
.sidebar-brand { padding: 22px 22px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-brand .mark { width: 42px; height: 42px; border-radius: 11px; background: linear-gradient(135deg, var(--navy-600), var(--accent)); display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.sidebar-brand .mark svg { width: 24px; height: 24px; }
.sidebar-brand strong { color: #fff; font-family: var(--font-head); font-size: 1.12rem; display: block; line-height: 1.1; }
.sidebar-brand small { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.sidebar-nav { padding: 16px 12px; flex: 1; }
.sidebar-nav .nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: #64769c; padding: 16px 14px 8px; }
.sidebar-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; color: #b9c6e0; font-weight: 500; font-size: .94rem; margin-bottom: 2px; transition: all .18s; position: relative; }
.sidebar-nav a svg { width: 19px; height: 19px; flex-shrink: 0; opacity: .85; }
.sidebar-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar-nav a.active { background: linear-gradient(90deg, var(--navy-600), rgba(30,65,155,.5)); color: #fff; }
.sidebar-nav a.active svg { opacity: 1; color: var(--accent); }
.sidebar-nav a .badge { margin-left: auto; background: var(--accent); color: #062a2e; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 100px; }
.sidebar-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-foot a.viewsite { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 10px; color: #b9c6e0; font-size: .9rem; }
.sidebar-foot a.viewsite:hover { background: rgba(255,255,255,.07); color: #fff; }

/* ---------- Topbar ---------- */
.admin-main { display: flex; flex-direction: column; min-width: 0; }
.topbar-admin { background: #fff; border-bottom: 1px solid var(--line); padding: 0 28px; height: 68px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; }
.topbar-admin .page-title h1 { font-size: 1.25rem; }
.topbar-admin .page-title p { font-size: .84rem; color: var(--muted); }
.topbar-admin .tb-actions { display: flex; align-items: center; gap: 14px; }
.sidebar-toggle { display: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; align-items: center; justify-content: center; color: var(--ink); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 6px; border: 1px solid var(--line); border-radius: 100px; }
.user-chip .avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--navy-700), var(--accent)); color: #fff; display: grid; place-items: center; font-weight: 700; font-family: var(--font-head); font-size: .9rem; }
.user-chip span { font-size: .9rem; font-weight: 600; color: var(--ink); }

/* ---------- Content ---------- */
.content { padding: 28px; flex: 1; }
.content-narrow { max-width: 960px; }

/* ---------- Stat cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 28px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; align-items: center; gap: 16px; box-shadow: var(--shadow-sm); }
.stat-card .ic { width: 52px; height: 52px; border-radius: 13px; display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.stat-card .ic svg { width: 26px; height: 26px; }
.stat-card .n { font-family: var(--font-head); font-size: 1.9rem; font-weight: 700; color: var(--ink); line-height: 1; }
.stat-card .l { font-size: .86rem; color: var(--muted); }

/* ---------- Card ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 24px; }
.card-head { padding: 20px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.card-head h2 { font-size: 1.12rem; }
.card-head p { font-size: .84rem; color: var(--muted); }
.card-body { padding: 24px; }
.card-body.p0 { padding: 0; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--font-head); font-weight: 600; font-size: .92rem; padding: 11px 20px; border-radius: 10px; border: 1.5px solid transparent; cursor: pointer; transition: all .2s; white-space: nowrap; line-height: 1; }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-accent { background: var(--accent); color: #062a2e; }
.btn-accent:hover { background: var(--accent-dark); color: #fff; }
.btn-outline { background: #fff; color: var(--body); border-color: var(--line); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-danger { background: var(--err-bg); color: var(--err); }
.btn-danger:hover { background: var(--err); color: #fff; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-sm { padding: 8px 14px; font-size: .85rem; }
.btn-icon { padding: 9px; width: 38px; height: 38px; }
.btn-icon.btn-sm { width: 34px; height: 34px; padding: 7px; }
.btn-block { width: 100%; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th { text-align: left; padding: 14px 20px; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--line); background: #fafbfe; font-weight: 600; white-space: nowrap; }
table.data td { padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: .92rem; vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: #fafbfe; }
table.data .thumb { width: 52px; height: 52px; border-radius: 9px; object-fit: cover; background: var(--bg); border: 1px solid var(--line); }
table.data .row-title { font-weight: 600; color: var(--ink); font-family: var(--font-head); }
.row-actions { display: flex; gap: 7px; justify-content: flex-end; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; font-weight: 600; padding: 4px 11px; border-radius: 100px; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-off { background: #eef1f6; color: var(--muted); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-accent { background: rgba(23,182,196,.12); color: var(--accent-dark); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.form-group { margin-bottom: 20px; }
.form-group.full { grid-column: 1 / -1; }
label { display: block; font-family: var(--font-head); font-weight: 600; font-size: .88rem; color: var(--ink); margin-bottom: 7px; }
label .req { color: var(--err); }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=url], input[type=date], input[type=datetime-local], input[type=color], select, textarea {
    width: 100%; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; transition: border-color .18s, box-shadow .18s;
}
input[type=color] { height: 46px; padding: 5px; cursor: pointer; }
textarea { resize: vertical; min-height: 120px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(22,51,122,.1); }
.form-hint { font-size: .8rem; color: var(--muted); margin-top: 6px; }
.form-actions { display: flex; gap: 12px; padding-top: 8px; }
.checkbox { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--brand); }
.checkbox label { margin: 0; cursor: pointer; }

/* image upload preview */
.img-upload { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.img-preview { width: 120px; height: 120px; border-radius: 12px; border: 1.5px dashed var(--line); object-fit: cover; background: var(--bg); }
.img-upload .up-fields { flex: 1; min-width: 220px; }
input[type=file] { width: 100%; padding: 10px; border: 1.5px dashed var(--line); border-radius: 10px; background: var(--bg); cursor: pointer; }

/* ---------- Alerts ---------- */
.alert { padding: 13px 18px; border-radius: 11px; margin-bottom: 18px; font-size: .92rem; display: flex; gap: 10px; align-items: flex-start; }
.alert svg { width: 19px; height: 19px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--ok-bg); color: var(--ok); }
.alert-error { background: var(--err-bg); color: var(--err); }
.alert-info { background: #e8f1fd; color: #1a56a8; }

/* ---------- Settings tabs ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: none; padding: 12px 18px; font-family: var(--font-head); font-weight: 600; font-size: .92rem; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Media grid ---------- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.media-item { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.media-item .m-img { aspect-ratio: 1; background: var(--bg); }
.media-item .m-img img { width: 100%; height: 100%; object-fit: cover; }
.media-item .m-foot { padding: 8px 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.media-item .m-foot span { font-size: .76rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-path { cursor: pointer; }

/* ---------- Empty ---------- */
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty svg { width: 54px; height: 54px; color: var(--line); margin: 0 auto 14px; }
.empty h3 { color: var(--ink); margin-bottom: 6px; }

/* ---------- Utilities ---------- */
.flex { display: flex; } .items-center { align-items: center; } .gap-2 { gap: 8px; } .gap-3 { gap: 14px; }
.between { justify-content: space-between; } .wrap { flex-wrap: wrap; }
.mt-2 { margin-top: 10px; } .mb-0 { margin-bottom: 0; } .muted { color: var(--muted); font-size: .9rem; }
.text-right { text-align: right; }
@media (max-width: 640px) { .hide-mobile { display: none !important; } }

/* ---------- Responsive ---------- */
.sidebar-backdrop { display: none; }
@media (max-width: 1024px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) {
    .admin { grid-template-columns: 1fr; }
    .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w); z-index: 100; transform: translateX(-100%); transition: transform .3s; }
    .sidebar.open { transform: none; }
    .sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(10,28,68,.5); z-index: 90; }
    .sidebar-toggle { display: flex; }
    .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) { .stat-grid { grid-template-columns: 1fr; } .content { padding: 18px; } .topbar-admin { padding: 0 16px; } }
