/* ERAH kurumsal renkleri (erah.aero): siyah ve altın */
:root {
  --black: #000001;
  --gold: #b6985a;
  --primary: #b6985a;
  --primary-dark: #9a7d43;
  --primary-soft: #f5efe2;
  --primary-text: #7a6232;     /* açık zeminde altın tonlu metin (kontrast için koyulaştırılmış) */
  --on-primary: #000001;       /* altın zemin üstünde metin: siyah */
  --accent: #b6985a;
  --success: #2b8a3e;
  --danger: #d63031;
  --warning: #e67700;
  --bg: #f6f4ef;
  --card: #ffffff;
  --text: #1b1b1b;
  --muted: #6f6a5e;
  --border: #e7e2d6;
  --sidebar: #000001;
  --sidebar-text: #cfc7b4;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(20, 16, 8, .06), 0 4px 12px rgba(20, 16, 8, .04);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--primary-text); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- Butonlar ve formlar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: #fff; color: var(--text);
  padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 500;
  white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn:hover { background: #f7f3ea; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 600; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-accent { background: var(--black); border-color: var(--black); color: var(--gold); }
.btn-accent:hover { background: #1c1a16; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #237032; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: #fff0f0; border-color: #ffc9c9; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-block { width: 100%; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: 13px; }
.field .hint { color: var(--muted); font-size: 12px; }
.input, select.input, textarea.input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea.input { min-height: 90px; resize: vertical; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }

/* ---------- Giriş ekranı ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-hero {
  background: radial-gradient(120% 90% at 85% 110%, rgba(182, 152, 90, .28) 0%, rgba(182, 152, 90, 0) 55%),
    linear-gradient(160deg, #000001 0%, #0d0c0a 60%, #17140e 100%);
  color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden; border-right: 3px solid var(--gold);
}
.login-hero .hero-logo { width: 190px; height: auto; display: block; }
.login-hero h1 { font-size: 36px; margin: 18px 0 14px; max-width: 470px; color: #fff; }
.login-hero h1 em { font-style: normal; color: var(--gold); }
.login-hero p { color: #cfc7b4; font-size: 16px; max-width: 440px; }
.login-hero ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.login-hero li { display: flex; gap: 10px; align-items: center; color: #ece6d8; }
.login-hero li span { width: 30px; height: 30px; border-radius: 8px; background: rgba(182, 152, 90, .16); color: var(--gold); display: grid; place-items: center; }
.login-form { display: grid; place-items: center; padding: 40px 24px; background: #fff; }
.login-card { width: 100%; max-width: 380px; }
.login-card .card-logo { height: 84px; width: auto; display: block; margin: 0 0 22px; }
.login-card h2 { font-size: 26px; margin-bottom: 6px; }
.login-card .sub { color: var(--muted); margin-bottom: 26px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 19px; letter-spacing: .01em; }
.brand img { height: 42px; width: auto; display: block; }
.brand .brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand .brand-text small { font-size: 10px; font-weight: 600; letter-spacing: .18em; color: var(--gold); text-transform: uppercase; }
.brand b { color: var(--gold); }
.alert { padding: 10px 12px; border-radius: 8px; background: #fff0f0; color: var(--danger); border: 1px solid #ffc9c9; margin-bottom: 14px; }
.alert-info { background: var(--primary-soft); color: var(--primary-text); border-color: #e6d9bb; }

/* ---------- Ana yerleşim ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; background: var(--sidebar); color: var(--sidebar-text); flex-shrink: 0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar { border-right: 1px solid #1f1c16; }
.sidebar .brand { color: #fff; padding: 18px 18px 20px; margin-bottom: 8px; border-bottom: 1px solid rgba(182, 152, 90, .22); }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 12px; color: var(--sidebar-text);
  padding: 10px 12px; border-radius: 8px; font-weight: 500;
}
.nav a:hover { background: rgba(182, 152, 90, .1); color: #fff; }
.nav a.active { background: var(--gold); color: var(--on-primary); font-weight: 600; }
.nav svg, .icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav .section { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #8a826f; padding: 16px 12px 6px; }
.sidebar-user { padding: 14px 16px; border-top: 1px solid rgba(182, 152, 90, .22); display: flex; align-items: center; gap: 10px; }
.sidebar-user .meta { flex: 1; min-width: 0; }
.sidebar-user .meta div:first-child { color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .meta div:last-child { font-size: 12px; }
.sidebar-user button { background: none; border: none; color: var(--sidebar-text); cursor: pointer; padding: 6px; border-radius: 6px; }
.sidebar-user button:hover { background: rgba(182, 152, 90, .14); color: var(--gold); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; background: #fff; border-bottom: 1px solid var(--border); box-shadow: inset 0 -2px 0 rgba(182, 152, 90, .35);
  display: flex; align-items: center; justify-content: space-between; padding: 0 28px;
  position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 18px; }
.menu-btn { display: none; }
.content { padding: 28px; max-width: 1280px; width: 100%; margin: 0 auto; }

.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--gold); color: var(--on-primary);
  display: grid; place-items: center; font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }

/* ---------- Kartlar ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head h3 { font-size: 15px; }
.card-body { padding: 20px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h2 { font-size: 22px; }
.page-head p { color: var(--muted); margin: 4px 0 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { padding: 18px 20px; display: flex; align-items: center; gap: 14px; }
.stat .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; }
.stat .ic svg { width: 22px; height: 22px; }
.stat .num { font-size: 24px; font-weight: 700; }
.stat .lbl { color: var(--muted); font-size: 13px; }

.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }

.welcome {
  background: radial-gradient(90% 140% at 100% 0%, rgba(182, 152, 90, .35) 0%, rgba(182, 152, 90, 0) 60%), linear-gradient(120deg, #000001, #1a1712);
  color: #fff; border: none; border-left: 4px solid var(--gold);
  padding: 24px 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  margin-bottom: 24px; flex-wrap: wrap;
}
.welcome h2 { font-size: 22px; margin-bottom: 4px; }
.welcome p { margin: 0; color: #cfc7b4; }

.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: none; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; }
.list-item .meta { color: var(--muted); font-size: 13px; }
.date-box {
  width: 54px; text-align: center; border-radius: 10px; background: var(--black);
  color: var(--gold); padding: 6px 0; flex-shrink: 0;
}
.date-box .d { font-size: 20px; font-weight: 700; line-height: 1.1; }
.date-box .m { font-size: 11px; text-transform: uppercase; font-weight: 600; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #f0ede6; color: var(--muted); }
.badge-live { background: #ffe3e3; color: var(--danger); }
.badge-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); animation: pulse 1.2s infinite; }
.badge-ders { background: var(--primary-soft); color: var(--primary-text); }
.badge-toplanti { background: #1b1b1b; color: var(--gold); }
.badge-ended { background: #f0ede6; color: var(--muted); }
.badge-admin { background: #f3d9fa; color: #9c36b5; }
.badge-egitmen { background: #d3f9d8; color: var(--success); }
.badge-ogrenci { background: var(--primary-soft); color: var(--primary-text); }
@keyframes pulse { 50% { opacity: .3; } }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty svg { width: 42px; height: 42px; opacity: .4; margin-bottom: 8px; }

/* ---------- Kurslar ---------- */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.course-card { overflow: hidden; cursor: pointer; transition: transform .15s, box-shadow .15s; display: flex; flex-direction: column; }
.course-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(16,24,40,.1); }
.course-cover { height: 96px; position: relative; padding: 16px; color: #fff; display: flex; align-items: flex-end; }
.course-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,.18)); }
.course-cover h3 { font-size: 17px; position: relative; z-index: 1; }
.course-card .body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.course-card .desc { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 38px; }
.course-card .foot { display: flex; gap: 14px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.course-card .foot span { display: flex; align-items: center; gap: 4px; }
.course-card .foot svg { width: 14px; height: 14px; }

.course-header { color: #fff; padding: 26px 28px; border-radius: var(--radius); margin-bottom: 20px; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.course-header h2 { font-size: 24px; }
.course-header p { margin: 6px 0 0; opacity: .9; max-width: 700px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 16px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.active { color: var(--text); border-color: var(--gold); }
.tabs a:hover { color: var(--text); }

/* ---------- Tablo ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--border); background: #faf8f3; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.user-cell { display: flex; align-items: center; gap: 10px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.chip { padding: 6px 14px; border-radius: 99px; border: 1px solid var(--border); background: #fff; cursor: pointer; font-weight: 500; }
.chip.active { background: var(--black); border-color: var(--black); color: var(--gold); }

.announcement { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.announcement:last-child { border-bottom: none; }
.announcement .head { display: flex; justify-content: space-between; gap: 10px; }
.announcement h4 { font-size: 15px; }
.announcement .meta { color: var(--muted); font-size: 12px; margin: 2px 0 8px; }
.announcement .text { white-space: pre-wrap; }

.file-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0; }

/* ---------- Takvim ---------- */
.cal-head { display: flex; align-items: center; gap: 10px; }
.cal-head h3 { min-width: 170px; text-align: center; font-size: 17px; }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); }
.calendar .dow { padding: 10px; font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; border-bottom: 1px solid var(--border); text-transform: uppercase; }
.calendar .day { min-height: 110px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px; display: flex; flex-direction: column; gap: 3px; }
.calendar .day:nth-child(7n) { border-right: none; }
.calendar .day.other { background: #faf8f3; color: #bdb6a6; }
.calendar .day .n { font-weight: 600; font-size: 13px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.calendar .day.today .n { background: var(--gold); color: var(--on-primary); }
.cal-ev { font-size: 12px; padding: 2px 6px; border-radius: 5px; color: #fff; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 1, .55); display: grid; place-items: center; z-index: 50; padding: 20px; animation: fade .15s; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 520px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); animation: pop .18s; }
.modal.wide { max-width: 820px; }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; box-shadow: inset 0 -2px 0 rgba(182, 152, 90, .35); }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.x-btn { background: none; border: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; border-radius: 6px; }
.x-btn:hover { background: #f7f3ea; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }

.pick-list { max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; }
.pick-list label { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.pick-list label:last-child { border-bottom: none; }
.pick-list label:hover { background: #faf8f3; }

/* Connect seçici sekmeleri ve paylaşım satırları */
.seg { display: inline-flex; background: #f0ede6; border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: none; background: transparent; padding: 6px 12px; border-radius: 7px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
.seg button.active { background: var(--black); color: var(--gold); }
.share-row { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.share-row:last-child { border-bottom: none; }
.share-row .grow { flex: 1; min-width: 0; }
.icon-inline { width: 14px; height: 14px; vertical-align: -2px; }

/* ---------- Bildirimler ---------- */
#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--black); color: #fff; border-left: 3px solid var(--gold); padding: 12px 16px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: 360px; animation: pop .2s; }
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }

.muted { color: var(--muted); }
.mt { margin-top: 20px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--gold); border-radius: 50%; animation: spin .7s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Mobil ---------- */
@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .content { padding: 16px; }
  .calendar .day { min-height: 70px; }
  .cal-ev { font-size: 10px; padding: 1px 4px; }
  .row { flex-direction: column; gap: 0; }
}

/* ---------- Gruplar ---------- */
.tree-toggle { width: 28px; min-width: 28px; justify-content: center; padding: 2px 0; font-weight: 700; display: inline-flex; }
.list-item .meta .icon { width: 14px; height: 14px; vertical-align: -2px; }

/* ---------- Depolama ---------- */
.disk + .disk { margin-top: 16px; }
.disk-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; margin-bottom: 6px; }
.disk-bar { height: 10px; background: #efebe2; border-radius: 6px; overflow: hidden; }
.disk-bar span { display: block; height: 100%; border-radius: 6px; }
