/* =====================================================================
   KURYELOJİ — layout.css
   Üst çubuk, sol menü, içerik alanı, bilgi paneli ve profil menüsü.
   ===================================================================== */

/* ---------- Üst çubuk ---------- */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 50;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px 0 14px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 14px; }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 42px; height: 42px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    transition: background .15s;
}
.icon-btn:hover { background: var(--bg); }
.icon-btn-sm { width: 32px; height: 32px; border-radius: 8px; color: var(--muted); }

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
    display: grid; place-items: center;
    width: 38px; height: 38px;
    border-radius: 11px;
    background: var(--brand);
    color: #fff;
}
.brand-mark .icon { width: 22px; height: 22px; }
.brand-name { font-size: 20px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }

/* ---------- Sol menü ---------- */
.sidebar {
    position: fixed;
    top: var(--topbar-h);
    bottom: 0; left: 0;
    z-index: 40;
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    background: var(--ink);
    color: #D5E3E6;
    transition: transform .25s ease;
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.sidebar-footer { padding: 14px; border-top: 1px solid rgba(255, 255, 255, .08); }

.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: inherit;
    font-size: 14.5px;
    font-weight: 500;
    text-align: left;
    transition: background .15s, color .15s;
}
.menu-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.menu-text { flex: 1; }
.menu-caret { width: 16px; height: 16px; transition: transform .2s; opacity: .7; }

.menu > .menu-item + .menu-item { margin-top: 2px; }

/* Aktif sayfa */
.menu-item.is-active > .menu-link { color: #fff; }
.menu-item:not(.has-sub).is-active > .menu-link {
    background: var(--brand);
    box-shadow: 0 4px 14px rgba(255, 107, 44, .35);
}

/* Alt menü: yumuşak açılma */
.menu-sub {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .25s ease;
}
.menu-sub-inner { overflow: hidden; }
.menu-item.is-open > .menu-sub { grid-template-rows: 1fr; }
.menu-item.is-open > .menu-toggle .menu-caret { transform: rotate(180deg); }
.menu-item.has-sub.is-open > .menu-toggle { background: rgba(255, 255, 255, .06); color: #fff; }

.menu-nested {
    margin: 4px 0 6px 18px;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, .12);
}
.menu-nested .menu-link { padding: 8px 10px; font-size: 14px; gap: 10px; }
.menu-nested .icon { width: 17px; height: 17px; }
.menu-nested .menu-item.is-active > .menu-link {
    background: rgba(255, 107, 44, .18);
    color: #FFB08C;
    box-shadow: none;
}

/* Çıkış satırı */
.menu-item.is-danger { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .08); }
.menu-item.is-danger .menu-link:hover { background: rgba(220, 74, 90, .18); color: #FF9AA5; }

/* ---------- Ana alan ---------- */
.main {
    min-height: 100vh;
    margin-left: var(--sidebar-w);
    padding-top: var(--topbar-h);
    display: flex;
    flex-direction: column;
    transition: margin-left .25s ease;
}
.content { flex: 1; padding: 28px 32px 20px; width: 100%; max-width: 1560px; }

.footer {
    display: flex;
    justify-content: space-between;
    padding: 14px 32px 20px;
    color: var(--muted);
    font-size: 12.5px;
}

/* Menü kapalıyken */
html.sidebar-closed .sidebar { transform: translateX(-100%); }
html.sidebar-closed .main    { margin-left: 0; }

/* ---------- Sayfa başlığı ---------- */
.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}
.page-header p { margin-top: 4px; color: var(--muted); }
.page-actions { display: flex; gap: 10px; }

/* ---------- Bilgi paneli (sağ üst) ---------- */
.info-panel {
    display: flex;
    align-items: center;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--bg);
}
.info-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 14px 5px 6px;
    border-radius: 10px;
}
.info-chip + .info-chip { border-left: 1px solid var(--line); border-radius: 0; margin-left: 4px; padding-left: 14px; }
.info-icon {
    display: grid; place-items: center;
    width: 32px; height: 32px;
    border-radius: 9px;
    background: #fff;
    color: var(--muted);
}
.info-icon .icon { width: 18px; height: 18px; }
.info-text { display: flex; flex-direction: column; line-height: 1.15; }
.info-text small { color: var(--muted); font-size: 11.5px; }
.info-text strong { font-size: 14px; }

.info-chip.is-on     .info-icon { background: var(--green-soft); color: var(--green); }
.info-chip.is-on     strong     { color: var(--green); }
.info-chip.is-off    .info-icon { background: #E9EDF0;           color: #83949C; }
.info-chip.is-off    strong     { color: var(--muted); }
.info-chip.is-credit .info-icon { background: var(--amber-soft); color: var(--amber); }
.info-chip.is-low    .info-icon { background: var(--red-soft);   color: var(--red); }
.info-chip.is-low    strong     { color: var(--red); }

/* ---------- Profil ---------- */
.profile { position: relative; }
.profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 10px 5px 5px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    transition: background .15s;
}
.profile-btn:hover { background: var(--bg); }
.profile-short { display: flex; flex-direction: column; text-align: left; line-height: 1.15; }
.profile-short strong { font-size: 13.5px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-short small { color: var(--muted); }

.avatar {
    display: grid; place-items: center;
    width: 36px; height: 36px;
    border-radius: 10px;
    background: var(--ink);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .02em;
}
.avatar-lg { width: 52px; height: 52px; border-radius: 14px; font-size: 18px; }

.profile-panel { right: 0; width: 320px; padding: 0; }
.profile-head { display: flex; align-items: center; gap: 14px; padding: 18px; border-bottom: 1px solid var(--line); }
.profile-head strong { display: block; margin-bottom: 4px; font-size: 15px; }
.profile-info { margin: 0; padding: 14px 18px; display: grid; gap: 12px; }
.profile-info dt { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.profile-info dt .icon { width: 14px; height: 14px; }
.profile-info dd { margin: 2px 0 0; font-weight: 600; word-break: break-all; }
.profile-actions { padding: 8px; border-top: 1px solid var(--line); }
