/* ============================================
   DOKÜMAN TAKİP SİSTEMİ - ANA STİL DOSYASI
   Palet: Lacivert #16233D, Teal #0E9C94, Kırık beyaz #F6F7F9,
          Kayrak gri #46536B, Amber uyarı #E0A430, Kiremit hata #C4483A
   Tipografi: Sora (başlık) + Inter (gövde) + JetBrains Mono (meta/veri)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --navy: #16233D;
    --navy-soft: #1F3155;
    --teal: #0E9C94;
    --teal-dark: #0B7C76;
    --bg: #F6F7F9;
    --panel: #FFFFFF;
    --slate: #46536B;
    --slate-light: #8592A8;
    --border: #E3E7EE;
    --amber: #E0A430;
    --red: #C4483A;
    --green: #2E8B57;
    --radius: 10px;
    --shadow-stack: 0 1px 2px rgba(22,35,61,0.06), 0 6px 16px rgba(22,35,61,0.07);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--navy);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    letter-spacing: -0.01em;
}

a { color: var(--teal-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 32px 24px 80px;
}

/* ---------- NAVBAR ---------- */
.navbar {
    background: var(--navy);
    color: #fff;
}
.navbar-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.brand {
    color: #fff;
    font-size: 1.15rem;
}
.brand:hover { text-decoration: none; opacity: 0.9; }
.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 0.9rem;
}
.nav-links a { color: #CBD5E1; }
.nav-links a:hover { color: #fff; }
.welcome-text {
    color: #CBD5E1;
    font-size: 0.86rem;
}
.welcome-text strong {
    color: #fff;
    font-weight: 600;
}
.live-clock {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--teal);
    padding: 5px 10px;
    background: rgba(255,255,255,0.06);
    border-radius: 6px;
    letter-spacing: 0.02em;
}
.user-info {
    color: var(--teal);
    font-weight: 600;
    padding: 6px 14px;
    background: rgba(14,156,148,0.15);
    border-radius: 999px;
    font-size: 0.85rem;
}

/* ---------- AUTH SAYFALARI ---------- */
.auth-wrap {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
    background: var(--panel);
}

/* Sol marka paneli */
.auth-brand {
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, var(--navy) 0%, var(--navy-soft) 55%, var(--teal-dark) 130%);
    padding: 48px 44px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
}
.auth-brand-watermark {
    position: absolute;
    right: -70px;
    bottom: -60px;
    width: 340px;
    height: auto;
    opacity: 0.1;
    transform: rotate(-6deg);
    pointer-events: none;
}
.auth-brand-top {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}
.auth-brand-top img {
    width: 34px;
    height: auto;
    flex-shrink: 0;
}
.auth-brand-top span {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}
.auth-brand-mid {
    position: relative;
    z-index: 1;
    margin: 40px 0;
}
.auth-brand-eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.6);
    margin: 0 0 14px;
}
.auth-brand-mid h2 {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 1.7rem;
    line-height: 1.3;
    margin: 0 0 16px;
    max-width: 320px;
}
.auth-brand-mid p {
    color: rgba(255,255,255,0.72);
    font-size: 0.92rem;
    line-height: 1.6;
    max-width: 300px;
    margin: 0 0 26px;
}
.auth-feature-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.auth-feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.86rem;
    color: rgba(255,255,255,0.85);
}
.auth-feature-list svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--teal);
}
.auth-brand-foot {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.55);
}
.auth-brand-foot .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--teal);
    flex-shrink: 0;
}

/* Sağ form paneli */
.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.auth-mobile-brand {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
}
.auth-mobile-brand img { width: 30px; height: auto; }
.auth-mobile-brand span {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--navy);
}
.auth-card {
    background: var(--panel);
    width: 100%;
    max-width: 380px;
    padding: 0;
}
@media (max-width: 900px) {
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
    .auth-mobile-brand { display: flex; }
}
.auth-card h1 {
    font-size: 1.5rem;
    margin: 0 0 6px;
}
.auth-card .sub {
    color: var(--slate);
    font-size: 0.92rem;
    margin: 0 0 28px;
}
.auth-tabs {
    display: flex;
    background: var(--bg);
    border-radius: 999px;
    padding: 4px;
    margin-bottom: 28px;
}
.auth-tabs a {
    flex: 1;
    text-align: center;
    padding: 9px 0;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--slate);
}
.auth-tabs a.active {
    background: var(--panel);
    color: var(--navy);
    box-shadow: 0 1px 3px rgba(22,35,61,0.12);
}

/* ---------- FORM ---------- */
label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--slate);
    margin-bottom: 6px;
}
input[type=text], input[type=email], input[type=password], input[type=file], select, textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #FBFCFD;
    margin-bottom: 18px;
    color: var(--navy);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(14,156,148,0.15);
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 20px;
    background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { box-shadow: 0 6px 18px rgba(14,156,148,0.35); transform: translateY(-1px); }
.btn.secondary {
    background: var(--panel);
    color: var(--navy);
    border: 1px solid var(--border);
}
.btn.secondary:hover { box-shadow: none; border-color: var(--slate-light); }
.btn.small { width: auto; padding: 8px 16px; font-size: 0.85rem; }
.btn.danger { background: var(--red); }
.btn.info {
    background: var(--panel);
    color: var(--navy);
    border: 1px solid rgba(22, 35, 61, 0.22);
}
.btn.info:hover { background: rgba(22, 35, 61, 0.06); box-shadow: none; border-color: var(--navy); }
.btn.accent {
    background: rgba(14, 156, 148, 0.12);
    color: var(--teal-dark);
    border: 1px solid rgba(14, 156, 148, 0.3);
}
.btn.accent:hover {
    background: var(--teal);
    color: #fff;
    box-shadow: 0 6px 16px rgba(14, 156, 148, 0.3);
    border-color: var(--teal);
}

/* ---------- ALERT / FLASH ---------- */
.alert {
    padding: 13px 18px;
    border-radius: 8px;
    margin-bottom: 22px;
    font-size: 0.9rem;
    border-left: 4px solid transparent;
}
.alert-success { background: #EAF6EE; color: var(--green); border-color: var(--green); }
.alert-error { background: #FBEBE9; color: var(--red); border-color: var(--red); }
.alert-info { background: #EAF6F5; color: var(--teal-dark); border-color: var(--teal); }

/* ---------- SAYFA BAŞLIĞI ---------- */
.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 14px;
}
.page-head h1 { font-size: 1.6rem; margin: 0 0 4px; }
.page-head p { color: var(--slate); margin: 0; font-size: 0.92rem; }
.eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--teal-dark);
    margin: 0 0 8px;
}

/* ---------- ÖZET KUTULARI ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 32px;
}
.stat-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow-stack);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.stat-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--slate);
}
.stat-value {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 1.9rem;
    color: var(--navy);
    line-height: 1;
}
.stat-value--accent { color: var(--teal-dark); }
.stat-value-total {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    font-size: 1.1rem;
    color: var(--slate-light);
}
.stat-hint {
    font-size: 0.76rem;
    color: var(--slate-light);
}
@media (max-width: 640px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- KATEGORİ KARTLARI (klasör metaforu, kağıt yığını gölgesi) ---------- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 18px;
}
.category-card {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 20px;
    box-shadow: var(--shadow-stack);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.category-card::before {
    /* kağıt yığını hissi: kartın arkasında iki ince kenar */
    content: "";
    position: absolute;
    inset: 6px -6px -6px 6px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    z-index: -1;
    opacity: 0.7;
}
.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(22,35,61,0.12);
}
.category-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(14,156,148,0.12);
    color: var(--teal-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 14px;
}
.category-card h3 {
    margin: 0 0 6px;
    font-size: 1.02rem;
}
.category-card p {
    margin: 0 0 14px;
    font-size: 0.83rem;
    color: var(--slate);
    line-height: 1.4;
}
.category-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: var(--slate-light);
}

/* ---------- DÖKÜMAN ARAMA/FİLTRE ---------- */
.doc-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.doc-search {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 12px;
}
.doc-search svg { color: var(--slate-light); flex-shrink: 0; }
.doc-search input {
    border: none;
    margin: 0;
    padding: 10px 0;
    background: transparent;
}
.doc-search input:focus { box-shadow: none; }
#docTypeFilter {
    width: auto;
    margin: 0;
    padding: 10px 14px;
    min-width: 150px;
}

/* ---------- DÖKÜMAN LİSTESİ ---------- */
.doc-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.doc-row {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 18px;
    transition: background 0.12s ease, border-color 0.12s ease;
}
.doc-row--pdf { background: rgba(196, 72, 58, 0.045); border-color: rgba(196, 72, 58, 0.18); }
.doc-row--doc { background: rgba(46, 108, 189, 0.045); border-color: rgba(46, 108, 189, 0.18); }
.doc-row--xls { background: rgba(46, 139, 87, 0.045); border-color: rgba(46, 139, 87, 0.18); }
.doc-row--ppt { background: rgba(224, 164, 48, 0.06); border-color: rgba(224, 164, 48, 0.22); }
.doc-row--img { background: rgba(139, 92, 200, 0.045); border-color: rgba(139, 92, 200, 0.18); }
.doc-row:hover { box-shadow: var(--shadow-stack); }
.doc-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.doc-icon--pdf  { background: rgba(196, 72, 58, 0.12); }
.doc-icon--doc  { background: rgba(46, 108, 189, 0.12); }
.doc-icon--xls  { background: rgba(46, 139, 87, 0.12); }
.doc-icon--ppt  { background: rgba(224, 164, 48, 0.15); }
.doc-icon--img  { background: rgba(139, 92, 200, 0.12); }
.doc-meta { flex: 1; min-width: 0; }
.doc-title {
    font-weight: 600;
    font-size: 0.94rem;
    margin: 0 0 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.doc-filename {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--slate-light);
    margin: 0 0 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.doc-sub {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.74rem;
    color: var(--slate-light);
}
.doc-type-badge {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 999px;
}
.doc-type-badge--pdf  { background: rgba(196, 72, 58, 0.12);  color: var(--red); }
.doc-type-badge--doc  { background: rgba(46, 108, 189, 0.12); color: #2E6CBD; }
.doc-type-badge--xls  { background: rgba(46, 139, 87, 0.12);  color: var(--green); }
.doc-type-badge--ppt  { background: rgba(224, 164, 48, 0.15); color: #A5750F; }
.doc-type-badge--img  { background: rgba(139, 92, 200, 0.12); color: #8B5CC8; }
.doc-actions { display: flex; gap: 8px; flex-shrink: 0; }
.doc-actions a, .doc-actions button {
    font-size: 0.82rem;
    padding: 7px 13px;
}

/* ---------- YÖNETİM PANELİ ---------- */
.admin-table-wrap {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-stack);
    overflow-x: auto;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    white-space: nowrap;
}
.admin-table th {
    text-align: left;
    padding: 12px 16px;
    background: var(--bg);
    color: var(--slate);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}
.admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--navy);
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-firma-adi { font-weight: 700; }
.admin-badge {
    margin-left: 8px;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(14, 156, 148, 0.15);
    color: var(--teal-dark);
}

/* ---------- BOŞ DURUM ---------- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--slate);
}
.empty-state .icon { font-size: 2.2rem; margin-bottom: 12px; }
.empty-state h3 { margin: 0 0 6px; color: var(--navy); }
.empty-state p { margin: 0; font-size: 0.9rem; }

/* ---------- UPLOAD KUTUSU ---------- */
.upload-box {
    background: var(--panel);
    border: 1px dashed var(--teal);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 28px;
}
.upload-box h3 { margin: 0 0 16px; font-size: 1rem; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--teal-dark);
    background: rgba(14, 156, 148, 0.13);
    border: 1px solid rgba(14, 156, 148, 0.3);
    padding: 8px 16px;
    border-radius: 999px;
    margin-bottom: 18px;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.back-link:hover {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
    text-decoration: none;
    transform: translateX(-2px);
}

/* ---------- UYGULAMA LAYOUT: SOL MENÜ + ANA ALAN ---------- */
.app-layout {
    display: flex;
    align-items: flex-start;
    min-height: calc(100vh - 65px);
}
.sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--navy);
    padding: 24px 18px;
    min-height: calc(100vh - 65px);
}
.year-form { margin-bottom: 20px; }
.year-select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0 0 20px;
}
.year-select option { color: #16233D; }
.dept-list { display: flex; flex-direction: column; gap: 8px; }
.dept-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    color: #CBD5E1;
    border: none;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease;
}
.menu-icon {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    display: block;
}
.dept-btn:hover { background: rgba(255,255,255,0.12); text-decoration: none; color: #fff; }
.dept-btn.active {
    background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
    color: #fff;
}
.main-content { flex: 1; padding: 32px; min-width: 0; }

/* ---------- ALT MENÜ LİSTESİ (bölüm seçilince ortada görünen) ---------- */
.subcat-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
@media (max-width: 720px) {
    .subcat-list { grid-template-columns: 1fr; }
}
.subcat-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-radius: 10px;
    background: rgba(14, 156, 148, 0.13);
    border: 1px solid var(--border);
    box-shadow: none;
    text-align: left;
    font-weight: 700;
    font-size: 0.98rem;
    color: var(--navy);
    text-decoration: none;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
    min-width: 0;
}
.subcat-btn > span:nth-child(2) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.subcat-btn:hover {
    background: var(--panel);
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(22,35,61,0.12);
    text-decoration: none;
}
.subcat-btn .subcat-icon {
    width: 34px; height: 34px;
    border-radius: 8px;
    background: rgba(14,156,148,0.15);
    color: var(--teal-dark);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.subcat-btn .subcat-icon .menu-icon { width: 18px; height: 18px; }
.subcat-btn .subcat-count {
    margin-left: auto;
    flex-shrink: 0;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 0.78rem;
    color: var(--slate-light);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 860px) {
    .app-layout { flex-direction: column; }
    .sidebar { width: 100%; min-height: auto; }
    .dept-list { flex-direction: row; flex-wrap: wrap; }
    .dept-btn { width: auto; }
    .main-content { padding: 20px; }
}
@media (max-width: 640px) {
    .navbar-inner { flex-direction: column; gap: 10px; align-items: flex-start; }
    .doc-row { flex-wrap: wrap; }
    .doc-actions { width: 100%; justify-content: flex-start; }
}

/* Erişilebilirlik: klavye odak göstergesi */
a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 2px;
}
