/* ==========================================================================
   admin.css — Yönetim paneli stilleri
   Archival Codex renk paletini paylaşır; fonksiyonel, kompakt admin arayüzü.
   ========================================================================== */

/* --- Reset & Temel --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

.admin-body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: #1A1A1A;
    color: #E8E1D4;
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* --- Shell Layout --- */
.admin-shell {
    display: flex;
    min-height: 100vh;
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.admin-sidebar {
    width: 250px;
    background: #141414;
    border-right: 1px solid rgba(232, 225, 212, 0.08);
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
    transition: transform 0.25s ease;
}

.admin-sidebar__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 20px;
    border-bottom: 1px solid rgba(232, 225, 212, 0.08);
}

.admin-sidebar__monogram {
    font-family: Georgia, serif;
    font-size: 28px;
    font-weight: 400;
    color: #6E1F2A;
    line-height: 1;
}

.admin-sidebar__title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #E8E1D4;
}

/* --- Nav --- */
.admin-nav {
    flex: 1;
    padding: 8px 12px 16px;
    overflow-y: auto;
}

/* Grup başlıkları */
.admin-nav__group {
    margin-block-start: 12px;
}

.admin-nav__group:first-child {
    margin-block-start: 0;
}

.admin-nav__section {
    display: block;
    padding: 10px 14px 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #6D6B63;
    opacity: 0.7;
}

.admin-nav__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 4px;
    color: #9B978E;
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 2px;
    transition: background 0.15s, color 0.15s;
    position: relative;
}

.admin-nav__link:hover {
    background: rgba(232, 225, 212, 0.05);
    color: #E8E1D4;
}

.admin-nav__link.is-active {
    background: rgba(110, 31, 42, 0.18);
    color: #E8E1D4;
}

.admin-nav__link.is-active::before {
    content: '';
    position: absolute;
    left: 0; top: 6px; bottom: 6px;
    width: 3px;
    background: #6E1F2A;
    border-radius: 0 2px 2px 0;
}

.admin-nav__icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6E1F2A;
    flex-shrink: 0;
}

.admin-nav__icon svg {
    display: block;
}

.admin-nav__link.is-active .admin-nav__icon { color: #8A3040; }

.admin-nav__label { flex: 1; }

.admin-nav__badge {
    background: #6E1F2A;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* --- Sidebar Footer --- */
.admin-sidebar__foot {
    padding: 16px 12px;
    border-top: 1px solid rgba(232, 225, 212, 0.08);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-sidebar__site-link,
.admin-sidebar__logout {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s;
}

.admin-sidebar__site-link { color: #9B978E; }
.admin-sidebar__site-link:hover { background: rgba(232, 225, 212, 0.05); color: #E8E1D4; }

.admin-sidebar__logout { color: #8B2020; }
.admin-sidebar__logout:hover { background: rgba(139, 32, 32, 0.15); }

/* ==========================================================================
   MAIN AREA
   ========================================================================== */
.admin-main {
    flex: 1;
    margin-left: 250px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* --- Topbar --- */
.admin-topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 28px;
    background: #1A1A1A;
    border-bottom: 1px solid rgba(232, 225, 212, 0.08);
    position: sticky;
    top: 0;
    z-index: 50;
}

.admin-topbar__toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.admin-topbar__toggle span {
    width: 22px;
    height: 2px;
    background: #E8E1D4;
}

.admin-topbar__title {
    font-family: Georgia, serif;
    font-size: 22px;
    font-weight: 400;
    color: #E8E1D4;
    flex: 1;
}

.admin-topbar__user {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.admin-topbar__user-name { font-weight: 600; color: #E8E1D4; font-size: 13px; }
.admin-topbar__user-role {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #6E1F2A;
    font-weight: 600;
}

/* ==========================================================================
   CONTENT
   ========================================================================== */
.admin-content {
    flex: 1;
    padding: 28px;
    background: #F2EFE8;
    color: #171714;
    overflow-y: auto;
}

/* --- Flash Mesajlar --- */
.admin-flash {
    padding: 14px 28px;
    border-left: 3px solid;
    font-size: 13.5px;
    font-weight: 500;
}

.admin-flash--success { background: #3A6B4A; color: #fff; border-color: #4a8a5e; }
.admin-flash--error   { background: #8B2020; color: #fff; border-color: #a52a2a; }
.admin-flash--info    { background: #2A2A28; color: #E8E1D4; border-color: #6E1F2A; }

/* ==========================================================================
   GENERIC UI PRIMITIVES
   ========================================================================== */

/* --- Sayfa başlık satırı (başlık + aksiyon butonu) --- */
.page-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.page-bar__title {
    font-family: Georgia, serif;
    font-size: 26px;
    font-weight: 400;
    color: #1A1A1A;
}

/* --- Butonlar --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    text-decoration: none;
}

.btn--primary { background: #6E1F2A; color: #fff; }
.btn--primary:hover { background: #8A3040; }

.btn--ghost { background: transparent; color: #1A1A1A; border-color: rgba(26,26,26,0.2); }
.btn--ghost:hover { background: rgba(26,26,26,0.05); border-color: #1A1A1A; }

.btn--danger { background: transparent; color: #8B2020; border-color: rgba(139,32,32,0.4); }
.btn--danger:hover { background: #8B2020; color: #fff; }

.btn--sm { padding: 6px 12px; font-size: 12px; }

/* --- Kart --- */
.card {
    background: #fff;
    border: 1px solid rgba(26,26,26,0.08);
    border-radius: 6px;
    padding: 24px;
    margin-bottom: 20px;
}

.card__title {
    font-family: Georgia, serif;
    font-size: 18px;
    font-weight: 400;
    color: #1A1A1A;
    margin-bottom: 4px;
}

.card__subtitle {
    font-size: 12.5px;
    color: #6D6B63;
    margin-bottom: 20px;
}

/* ==========================================================================
   DASHBOARD İSTATİSTİK KARTLARI
   ========================================================================== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.stat-card {
    background: #1A1A1A;
    color: #E8E1D4;
    padding: 24px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-card__value {
    font-family: Georgia, serif;
    font-size: 42px;
    font-weight: 300;
    line-height: 1;
    color: #E8E1D4;
}

.stat-card__label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #9B978E;
    font-weight: 500;
}

.stat-card__accent { color: #8A3040; }

/* ==========================================================================
   TABLO
   ========================================================================== */
.table-wrap {
    background: #fff;
    border: 1px solid rgba(26,26,26,0.08);
    border-radius: 6px;
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.data-table thead { background: #1A1A1A; color: #E8E1D4; }

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #9B978E;
}

.data-table td {
    padding: 14px 16px;
    border-top: 1px solid rgba(26,26,26,0.06);
    color: #171714;
}

.data-table tbody tr:hover { background: rgba(110, 31, 42, 0.03); }

.data-table__ref {
    display: inline-block;
    font-family: Georgia, serif;
    color: #6E1F2A;
    font-weight: 600;
    margin-right: 8px;
}

.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.badge--active { background: rgba(58,107,74,0.15); color: #3A6B4A; }
.badge--passive { background: rgba(139,32,32,0.12); color: #8B2020; }
.badge--unread { background: #6E1F2A; color: #fff; }
.badge--read { background: rgba(26,26,26,0.08); color: #6D6B63; }

.row-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ==========================================================================
   FORMLAR
   ========================================================================== */
.form-group { margin-bottom: 20px; }

.form-group__label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6D6B63;
    margin-bottom: 6px;
}

.form-group__hint {
    font-size: 12px;
    color: #9B978E;
    margin-top: 4px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(26,26,26,0.18);
    border-radius: 4px;
    background: #fff;
    color: #171714;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: #6E1F2A;
    box-shadow: 0 0 0 3px rgba(110,31,42,0.12);
}

textarea.form-control { resize: vertical; min-height: 80px; line-height: 1.6; }
select.form-control { cursor: pointer; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid rgba(26,26,26,0.08);
    margin-top: 20px;
}

/* --- Checkbox/Radio --- */
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
}

.checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #6E1F2A;
    cursor: pointer;
}

/* ==========================================================================
   LOGIN SAYFASI
   ========================================================================== */
.login-body { min-height: 100vh; background: #1A1A1A; display: flex; align-items: center; justify-content: center; padding: 20px; }

.login-card {
    width: 100%;
    max-width: 400px;
    background: #141414;
    border: 1px solid rgba(232,225,212,0.1);
    border-radius: 8px;
    padding: 40px;
}

.login-card__brand {
    text-align: center;
    margin-bottom: 32px;
}

.login-card__monogram {
    font-family: Georgia, serif;
    font-size: 56px;
    color: #6E1F2A;
    line-height: 1;
}

.login-card__title {
    font-family: Georgia, serif;
    font-size: 24px;
    color: #E8E1D4;
    margin-top: 12px;
    font-weight: 400;
}

.login-card__subtitle {
    font-size: 12px;
    color: #9B978E;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-top: 6px;
}

.login-card .form-group__label { color: #9B978E; }
.login-card .form-control { background: #1A1A1A; border-color: rgba(232,225,212,0.15); color: #E8E1D4; }
.login-card .form-control:focus { border-color: #6E1F2A; }

.login-error {
    background: rgba(139,32,32,0.15);
    border: 1px solid rgba(139,32,32,0.4);
    color: #ff8a8a;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 20px;
}

.login-card .btn--primary {
    width: 100%;
    justify-content: center;
    padding: 13px;
    font-size: 14px;
}

.login-card__hint {
    text-align: center;
    font-size: 12px;
    color: #6D6B63;
    margin-top: 24px;
}

/* ==========================================================================
   MESAJ DETAYI
   ========================================================================== */
.message-detail dl {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 10px 20px;
    margin-bottom: 24px;
}

.message-detail dt {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #6D6B63;
    font-weight: 600;
    padding-top: 2px;
}

.message-detail dd { color: #171714; font-weight: 500; word-break: break-word; }

.message-detail__body {
    background: #f7f5f0;
    border-left: 3px solid #6E1F2A;
    padding: 18px 22px;
    border-radius: 0 4px 4px 0;
    line-height: 1.7;
    white-space: pre-wrap;
    color: #171714;
}

/* --- Boş durum --- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6D6B63;
}
.empty-state__icon { font-size: 48px; color: #6E1F2A; opacity: 0.5; margin-bottom: 16px; }
.empty-state__title { font-family: Georgia, serif; font-size: 22px; color: #1A1A1A; margin-bottom: 6px; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    .admin-sidebar.is-open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .admin-topbar__toggle { display: flex; }
    .form-grid { grid-template-columns: 1fr; }
    .page-bar { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 600px) {
    .admin-content { padding: 16px; }
    .stat-grid { grid-template-columns: 1fr; }
    .data-table { font-size: 12px; }
    .data-table th, .data-table td { padding: 10px 8px; }
    .row-actions { flex-direction: column; }
}

/* ==========================================================================
   TAB SİSTEMİ (dosya detayı için)
   ========================================================================== */
.tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 2px solid rgba(26,26,26,0.08);
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-bar__tab {
    padding: 12px 18px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #6D6B63;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}

.tab-bar__tab:hover { color: #1A1A1A; }

.tab-bar__tab.is-active {
    color: #6E1F2A;
    border-bottom-color: #6E1F2A;
}

.tab-content { display: none; }
.tab-content.is-active { display: block; }

/* ==========================================================================
   TİMELİNE (safahat için)
   ========================================================================== */
.timeline-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border-inline-start: 2px solid rgba(110,31,42,0.2);
    padding-inline-start: 20px;
}

.timeline-item {
    position: relative;
    padding-block: 8px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    inset-inline-start: -26px;
    inset-block-start: 14px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #6E1F2A;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px rgba(110,31,42,0.2);
}

.timeline-item__date {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6E1F2A;
    font-weight: 600;
}

.timeline-item__body {
    margin-block-start: 2px;
}

.timeline-item__body strong {
    font-size: 14px;
    color: #1A1A1A;
}

@media (max-width: 600px) {
    .tab-bar__tab { padding: 10px 12px; font-size: 12px; }
}
