/* T6LHAX Admin Panel — rol temali, animasyonlu arayuz */
:root {
  --bg: #101216;
  --panel: #171a20;
  --card: #1e222b;
  --line: #2a2f3a;
  --text: #e8eaf0;
  --muted: #9aa0ae;
  --accent: #ff8c1a;
  --green: #35c26e;
  --red: #e5484d;
  --yellow: #e8b53a;
}
body[data-theme="green"] {
  --bg: #0c1411;
  --panel: #111c16;
  --card: #15241b;
  --line: #24402f;
  --text: #e6f2ea;
  --muted: #8fae9c;
  --accent: #35c26e;
}
body[data-theme="red"] {
  --bg: #150f10;
  --panel: #1e1415;
  --card: #281a1b;
  --line: #422728;
  --text: #f3e8e8;
  --muted: #b29494;
  --accent: #ff5a5a;
}
body[data-theme="light"] {
  --bg: #e9ecf1;
  --panel: #ffffff;
  --card: #ffffff;
  --line: #d4d9e1;
  --text: #1a1d23;
  --muted: #5d6675;
  --accent: #f07d0a;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 14px;
  transition: background-color .5s ease, color .5s ease;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -1;
  background:
    radial-gradient(600px 400px at 15% 10%, rgba(255,140,26,.07), transparent 60%),
    radial-gradient(700px 500px at 85% 90%, rgba(53,194,110,.06), transparent 60%);
}
body[data-theme="light"]::before {
  background:
    radial-gradient(600px 400px at 15% 10%, rgba(240,125,10,.10), transparent 60%),
    radial-gradient(700px 500px at 85% 90%, rgba(53,120,194,.08), transparent 60%);
}
body[data-theme="green"]::before {
  background:
    radial-gradient(600px 400px at 15% 10%, rgba(53,194,110,.12), transparent 60%),
    radial-gradient(700px 500px at 85% 90%, rgba(53,194,110,.07), transparent 60%);
}
body[data-theme="red"]::before {
  background:
    radial-gradient(600px 400px at 15% 10%, rgba(255,90,90,.12), transparent 60%),
    radial-gradient(700px 500px at 85% 90%, rgba(255,90,90,.07), transparent 60%);
}
.api-status {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted); padding: 2px 6px;
}
.api-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex-shrink: 0; }

.chan-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chan-tabs button {
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
  font-weight: 600; box-shadow: none;
}
.chan-tabs button:hover { transform: none; box-shadow: none; border-color: var(--accent); }
.chan-tabs button.active { background: var(--accent); color: #141414; border-color: var(--accent); }

.hidden { display: none !important; }
.center-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 18px; margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  transition: background-color .5s ease, border-color .5s ease, transform .18s ease, box-shadow .18s ease;
}
.login-card { width: 350px; max-width: 100%; text-align: center; }
.login-logo {
  font-size: 34px; font-weight: 900; letter-spacing: 4px;
  background: linear-gradient(90deg, var(--accent), #ffd28a, var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 4px;
}

h1, h2, h3 { margin: 0 0 12px 0; }
h2 {
  font-size: 22px; padding-bottom: 8px; margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  animation: slideRight .4s ease;
}
@keyframes slideRight { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
.muted { color: var(--muted); }
.err { color: var(--red); min-height: 18px; }
.ok { color: var(--green); }
label { display: block; margin: 10px 0; }
input, select, textarea {
  width: 100%; margin-top: 4px; padding: 9px 10px;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
button {
  background: var(--accent); color: #141414; border: 0; border-radius: 6px;
  padding: 9px 14px; font-weight: 700; cursor: pointer;
  transition: transform .12s ease, filter .15s ease, box-shadow .15s ease;
}
button:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.3); }
button:active { transform: translateY(0) scale(.98); }
button:disabled { opacity: .55; cursor: wait; transform: none; }
button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); box-shadow: none; }
button.danger { background: var(--red); color: #fff; }
button.small { padding: 5px 9px; font-size: 12px; margin: 1px 4px 1px 0; }

#app-view { display: flex; min-height: 100vh; }
#sidebar {
  width: 224px; flex-shrink: 0; background: var(--panel);
  border-right: 1px solid var(--line); padding: 16px 12px;
  display: flex; flex-direction: column; gap: 10px;
  position: sticky; top: 0; height: 100vh;
  transition: background-color .5s ease;
}
.brand {
  font-weight: 900; font-size: 22px; padding: 2px 6px; letter-spacing: 5px;
  background: linear-gradient(90deg, var(--text), var(--accent), var(--text));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
/* ikonlar renksiz (gri ton) */
.e { filter: grayscale(1) brightness(1.25); display: inline-block; }
.user-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px; animation: fadeUp .4s ease;
}
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), #ffd28a);
  color: #141414; font-weight: 900; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
}
.user-card .nm { font-weight: 700; font-size: 13px; word-break: break-all; }
.role-badge {
  display: inline-block; font-size: 11px; font-weight: 800; margin-top: 2px;
  padding: 1px 8px; border-radius: 20px; letter-spacing: .4px;
}
.role-owner { background: rgba(255,140,26,.2); color: var(--accent); }
.role-admin { background: rgba(229,72,77,.2); color: var(--red); }
.role-support { background: rgba(53,194,110,.2); color: var(--green); }
.role-founder { background: linear-gradient(90deg, #8a6d1a, #b98a1f); color: #fff; }

#nav { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
#nav button {
  background: transparent; color: var(--text); text-align: left; font-weight: 600;
  border-left: 3px solid transparent; border-radius: 0 6px 6px 0;
  box-shadow: none;
}
#nav button:hover { background: var(--card); transform: none; box-shadow: none; }
#nav button.active { background: var(--card); border-left-color: var(--accent); }
.side-foot { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }

.main-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#content { flex: 1; padding: 20px; max-width: 1120px; width: 100%; margin: 0 auto; }
.page-foot {
  text-align: center; padding: 14px; color: var(--muted); font-size: 12px;
  letter-spacing: 3px; font-weight: 700; border-top: 1px solid var(--line);
}

.anim-in > * { animation: fadeUp .35s ease both; }
.anim-in > *:nth-child(2) { animation-delay: .05s; }
.anim-in > *:nth-child(3) { animation-delay: .1s; }
.anim-in > *:nth-child(4) { animation-delay: .15s; }
.anim-in > *:nth-child(5) { animation-delay: .2s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; position: relative; overflow: hidden; }
.stat::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(var(--accent), transparent);
}
.stat:hover { transform: translateY(-2px); }
.stat .n { font-size: 28px; font-weight: 900; }
.stat .l { color: var(--muted); font-size: 12px; }

.announce {
  border: 1px solid var(--accent); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 14%, transparent), transparent);
  animation: fadeUp .4s ease;
}
.announce h4 { margin: 0 0 4px 0; }
.announce .dt { font-size: 11px; color: var(--muted); }
.announce.inactive { opacity: .55; border-style: dashed; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
tbody tr { transition: background-color .15s; }
tbody tr:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
th { color: var(--muted); font-weight: 700; background: var(--panel); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.pill.active { background: rgba(53,194,110,.18); color: var(--green); }
.pill.unused { background: rgba(154,160,174,.18); color: var(--muted); }
.pill.expired { background: rgba(232,181,58,.22); color: var(--yellow); }
.pill.revoked { background: rgba(229,72,77,.2); color: var(--red); }
.pill.true { background: rgba(53,194,110,.18); color: var(--green); }
.pill.false { background: rgba(229,72,77,.18); color: var(--red); }
.mono { font-family: Consolas, monospace; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 160px; }
.keybox {
  background: var(--panel); border: 1px dashed var(--accent); border-radius: 6px;
  padding: 10px; margin: 8px 0; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  animation: fadeUp .3s ease;
}
.keybox .mono { font-size: 15px; font-weight: 700; }
.warn { background: rgba(232,181,58,.1); border: 1px solid var(--yellow); border-radius: 6px; padding: 10px; margin-bottom: 12px; }
.info { background: rgba(53,194,110,.08); border: 1px solid var(--line); border-radius: 6px; padding: 10px; margin-bottom: 12px; }
.loading { padding: 18px; text-align: center; color: var(--muted); }

#toast-root { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 9999; }
.toast {
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: 8px; padding: 10px 14px; min-width: 220px; max-width: 340px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
  animation: toastIn .3s ease;
}
.toast.ok { border-left-color: var(--green); }
.toast.err { border-left-color: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
.toast.out { opacity: 0; transform: translateX(30px); transition: all .3s ease; }

#modal-root {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(0,0,0,.6); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--card); border: 1px solid var(--accent); border-radius: 12px;
  padding: 22px; max-width: 480px; width: 100%; text-align: center;
  animation: modalIn .25s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }
.modal .bigkey { font-family: Consolas, monospace; font-size: 19px; font-weight: 800; letter-spacing: 1px; margin: 12px 0; word-break: break-all; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--panel); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

@media (max-width: 760px) {
  #app-view { flex-direction: column; }
  #sidebar { width: 100%; height: auto; position: static; border-right: 0; border-bottom: 1px solid var(--line); }
  #nav { flex-direction: row; flex-wrap: wrap; }
  #nav button { border-left: 0; border-bottom: 3px solid transparent; border-radius: 6px 6px 0 0; }
  #nav button.active { border-bottom-color: var(--accent); }
  #content { padding: 12px; }
}
