/* ============================================================
 *  Tema: "Midnight Aurora"
 *  Koyu lacivert taban, sicak altin/amber aksan, cam efektli paneller.
 *  Bootstrap 5 uzeri, override + custom.
 * ============================================================ */

:root {
  --bg-0:      #0a0e1a;
  --bg-1:      #0f1525;
  --surface:   #151c30;
  --surface-2: #1c2540;
  --line:      #283250;
  --txt:       #e8ecf5;
  --txt-dim:   #97a0bd;
  --gold:      #e7b75f;
  --gold-2:    #f4d089;
  --amber:     #d98a3d;
  --violet:    #6d6af0;
  --green:     #4ec98a;
  --red:       #f0606e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 700px at 85% -10%, rgba(109,106,240,.18), transparent 60%),
    radial-gradient(900px 600px at 0% 110%, rgba(231,183,95,.12), transparent 55%),
    var(--bg-0);
  color: var(--txt);
  font-family: 'Sora', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1,h2,h3,h4,h5,.brand-font {
  font-family: 'Fraunces', Georgia, serif;
  letter-spacing: -.01em;
}

/* grain overlay */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 9999;
}

/* ---------- Auth layout ---------- */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.auth-card {
  width: 100%;
  max-width: 430px;
  background: linear-gradient(160deg, rgba(28,37,64,.85), rgba(15,21,37,.92));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 2.6rem 2.4rem;
  backdrop-filter: blur(16px);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.7),
              inset 0 1px 0 rgba(255,255,255,.05);
  animation: rise .6s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(22px) scale(.98); }
}

.brand {
  display: flex; align-items: center; gap: .65rem;
  margin-bottom: 1.8rem;
}
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--gold), var(--amber));
  color: #1a1206; font-weight: 800; font-size: 1.3rem;
  box-shadow: 0 8px 24px -6px rgba(231,183,95,.5);
}
.brand-name { font-size: 1.25rem; font-weight: 600; }
.brand-name span { color: var(--gold); }

.auth-title { font-size: 1.75rem; margin: 0 0 .25rem; }
.auth-sub { color: var(--txt-dim); font-size: .92rem; margin-bottom: 1.8rem; }

/* ---------- Form fields ---------- */
.field { margin-bottom: 1.15rem; }
.field label {
  display: block; font-size: .8rem; font-weight: 500;
  color: var(--txt-dim); margin-bottom: .4rem;
  text-transform: uppercase; letter-spacing: .06em;
}
.field input {
  width: 100%;
  background: var(--bg-1);
  border: 1px solid var(--line);
  color: var(--txt);
  border-radius: 12px;
  padding: .8rem 1rem;
  font-size: .98rem;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input:focus {
  outline: none;
  border-color: var(--gold);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(231,183,95,.13);
}
.field input::placeholder { color: #5a648a; }

/* ---------- Buttons ---------- */
.btn-gold {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: .85rem 1rem;
  font-weight: 600;
  font-size: 1rem;
  color: #1a1206;
  background: linear-gradient(135deg, var(--gold-2), var(--amber));
  cursor: pointer;
  transition: transform .15s, box-shadow .2s, filter .2s;
  box-shadow: 0 12px 30px -10px rgba(231,183,95,.6);
}
.btn-gold:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn-gold:active { transform: translateY(0); }
.btn-gold:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.switch-line {
  margin-top: 1.5rem; text-align: center;
  color: var(--txt-dim); font-size: .9rem;
}
.switch-line a { color: var(--gold); text-decoration: none; font-weight: 500; }
.switch-line a:hover { text-decoration: underline; }

.hint {
  margin-top: 1.4rem; padding: .7rem .9rem;
  background: rgba(109,106,240,.1);
  border: 1px solid rgba(109,106,240,.25);
  border-radius: 10px;
  font-size: .8rem; color: var(--txt-dim);
}
.hint code { color: var(--gold-2); }

/* ---------- Dashboard / Admin shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 248px;
  background: linear-gradient(180deg, var(--surface), var(--bg-1));
  border-right: 1px solid var(--line);
  padding: 1.6rem 1.1rem;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
}
.side-link {
  display: flex; align-items: center; gap: .7rem;
  padding: .7rem .9rem; border-radius: 11px;
  color: var(--txt-dim); text-decoration: none;
  font-size: .93rem; font-weight: 500;
  margin-bottom: .25rem; cursor: pointer;
  transition: background .15s, color .15s;
}
.side-link:hover { background: var(--surface-2); color: var(--txt); }
.side-link.active {
  background: linear-gradient(135deg, rgba(231,183,95,.16), rgba(217,138,61,.08));
  color: var(--gold-2);
  box-shadow: inset 2px 0 0 var(--gold);
}

.main { flex: 1; padding: 2.2rem 2.6rem; min-width: 0; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 2rem;
}
.page-title { font-size: 1.9rem; margin: 0; }
.page-sub { color: var(--txt-dim); font-size: .9rem; }

/* stat cards */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr));
  gap: 1.1rem; margin-bottom: 2rem;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.3rem 1.4rem;
  position: relative; overflow: hidden;
}
.stat::before {
  content: ""; position: absolute; right: -20px; top: -20px;
  width: 80px; height: 80px; border-radius: 50%;
  background: radial-gradient(circle, rgba(231,183,95,.18), transparent 70%);
}
.stat-num { font-family:'Fraunces',serif; font-size: 2.1rem; font-weight: 600; line-height: 1; }
.stat-label { color: var(--txt-dim); font-size: .82rem; margin-top: .4rem; text-transform: uppercase; letter-spacing: .05em; }

/* panel + table */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.panel-head {
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  flex-wrap: wrap;
}
.panel-head h3 { margin: 0; font-size: 1.15rem; }

.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; padding: .85rem 1.4rem;
  font-size: .76rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--txt-dim); border-bottom: 1px solid var(--line);
}
.tbl td { padding: .85rem 1.4rem; border-bottom: 1px solid rgba(40,50,80,.5); font-size: .92rem; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: rgba(28,37,64,.4); }

.badge-soft { padding: .25rem .6rem; border-radius: 8px; font-size: .76rem; font-weight: 600; }
.b-admin  { background: rgba(231,183,95,.15); color: var(--gold-2); }
.b-user   { background: rgba(109,106,240,.15); color: #a5a3f7; }
.b-active { background: rgba(78,201,138,.15); color: var(--green); }
.b-banned { background: rgba(240,96,110,.15); color: var(--red); }

.search-input {
  background: var(--bg-1); border: 1px solid var(--line); color: var(--txt);
  border-radius: 10px; padding: .55rem .9rem; font-size: .9rem; min-width: 220px;
}
.search-input:focus { outline: none; border-color: var(--gold); }

.icon-btn {
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--txt-dim); border-radius: 8px; padding: .35rem .6rem;
  cursor: pointer; font-size: .8rem; transition: all .15s;
}
.icon-btn:hover { color: var(--txt); border-color: var(--gold); }
.icon-btn.danger:hover { color: var(--red); border-color: var(--red); }

.avatar {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--violet), #4845c4);
  display: grid; place-items: center; font-weight: 700; color: #fff; font-size: .85rem;
}
.user-cell { display: flex; align-items: center; gap: .7rem; }

.divider { flex: 1; }

/* responsive */
@media (max-width: 820px) {
  .sidebar { position: fixed; left: -260px; z-index: 50; transition: left .25s; }
  .sidebar.open { left: 0; }
  .main { padding: 1.4rem 1.2rem; }
  .menu-toggle { display: inline-flex !important; }
}
.menu-toggle { display: none; }

/* ---------- Plan kartlari ---------- */
.plan-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr));
  gap: 1.2rem;
}
.plan-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.6rem 1.5rem;
  position: relative;
  display: flex; flex-direction: column;
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.plan-card:hover { transform: translateY(-4px); border-color: var(--gold); box-shadow: 0 18px 40px -16px rgba(231,183,95,.3); }
.plan-card.current { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.plan-card.trial-card::after {
  content: "TRIAL"; position: absolute; top: 1.2rem; right: 1.2rem;
  font-size: .68rem; letter-spacing: .1em; font-weight: 700;
  color: var(--violet); background: rgba(109,106,240,.14);
  padding: .2rem .5rem; border-radius: 6px;
}
.plan-name { font-family:'Fraunces',serif; font-size: 1.4rem; margin: 0 0 .2rem; }
.plan-price { font-size: 2rem; font-weight: 600; color: var(--gold-2); font-family:'Fraunces',serif; }
.plan-price small { font-size: .85rem; color: var(--txt-dim); font-weight: 400; font-family:'Sora',sans-serif; }
.plan-feats { list-style: none; padding: 0; margin: 1.1rem 0 1.4rem; flex: 1; }
.plan-feats li { padding: .35rem 0; color: var(--txt-dim); font-size: .9rem; display: flex; gap: .5rem; }
.plan-feats li::before { content: "✓"; color: var(--green); font-weight: 700; }
.plan-cta {
  border: none; border-radius: 11px; padding: .7rem 1rem; font-weight: 600;
  cursor: pointer; font-size: .92rem; width: 100%;
  background: linear-gradient(135deg, var(--gold-2), var(--amber)); color: #1a1206;
  transition: filter .2s;
}
.plan-cta:hover { filter: brightness(1.06); }
.plan-cta.is-current { background: var(--surface-2); color: var(--txt-dim); cursor: default; }
.plan-cta:disabled { opacity: .5; cursor: not-allowed; }

/* current plan ozet kutusu */
.plan-summary {
  background: linear-gradient(135deg, rgba(231,183,95,.1), rgba(217,138,61,.04));
  border: 1px solid rgba(231,183,95,.3);
  border-radius: 16px; padding: 1.3rem 1.5rem;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  flex-wrap: wrap; margin-bottom: 1.6rem;
}
.plan-summary .ps-name { font-family:'Fraunces',serif; font-size: 1.3rem; color: var(--gold-2); }
.plan-summary .ps-meta { color: var(--txt-dim); font-size: .88rem; }

/* ---------- Proxy ---------- */
.proxy-row {
  display: flex; align-items: center; gap: 1rem;
  padding: .9rem 1.2rem; border-bottom: 1px solid rgba(40,50,80,.5);
}
.proxy-row:last-child { border-bottom: none; }
.proxy-code {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  background: var(--bg-1); border: 1px solid var(--line);
  padding: .4rem .7rem; border-radius: 8px; font-size: .85rem;
  color: var(--gold-2); flex: 1; overflow-x: auto; white-space: nowrap;
}
.proxy-label { color: var(--txt-dim); font-size: .82rem; min-width: 90px; }
.limit-pill {
  display: inline-block; padding: .25rem .7rem; border-radius: 8px;
  font-size: .82rem; font-weight: 600;
  background: rgba(109,106,240,.14); color: #a5a3f7;
}

/* form helpers */
.form-row { display: grid; grid-template-columns: 1fr auto; gap: .8rem; align-items: end; }
.mono-input { font-family: ui-monospace, monospace; }
textarea.field-input {
  width: 100%; background: var(--bg-1); border: 1px solid var(--line);
  color: var(--txt); border-radius: 12px; padding: .8rem 1rem;
  font-size: .95rem; resize: vertical; min-height: 80px;
}
textarea.field-input:focus { outline: none; border-color: var(--gold); }

/* modal (admin plan) */
.modal-veil {
  position: fixed; inset: 0; background: rgba(5,8,16,.7);
  backdrop-filter: blur(4px); display: none; place-items: center; z-index: 1090; padding: 1rem;
}
.modal-veil.show { display: grid; }
.modal-box {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; padding: 1.8rem; width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
}
.modal-box h3 { margin: 0 0 1.2rem; font-size: 1.3rem; }

/* ---------- Placeholder / coming soon ---------- */
.soon-wrap {
  display: grid; place-items: center; text-align: center;
  padding: 4rem 2rem; min-height: 340px;
}
.soon-icon {
  width: 72px; height: 72px; border-radius: 20px;
  display: grid; place-items: center; font-size: 2rem;
  background: linear-gradient(135deg, rgba(231,183,95,.16), rgba(109,106,240,.12));
  border: 1px solid var(--line); margin-bottom: 1.2rem;
}
.soon-title { font-family:'Fraunces',serif; font-size: 1.6rem; margin: 0 0 .5rem; }
.soon-text { color: var(--txt-dim); max-width: 380px; font-size: .95rem; line-height: 1.6; }
.soon-pill {
  margin-top: 1.2rem; display: inline-block; padding: .35rem .9rem;
  border-radius: 20px; font-size: .78rem; font-weight: 600; letter-spacing: .05em;
  background: rgba(109,106,240,.14); color: #a5a3f7;
}

/* plan kalan sure */
.expiry-bar { margin-top: .6rem; }
.expiry-track { height: 6px; border-radius: 4px; background: var(--bg-1); overflow: hidden; }
.expiry-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--gold-2), var(--amber)); }
.expiry-fill.low { background: linear-gradient(90deg, var(--red), #ff8a94); }
.expiry-text { font-size: .8rem; color: var(--txt-dim); margin-top: .35rem; }

/* settings number stepper */
.stepper { display: flex; align-items: center; gap: .6rem; }
.stepper input {
  width: 90px; text-align: center;
  background: var(--bg-1); border: 1px solid var(--line); color: var(--txt);
  border-radius: 10px; padding: .6rem; font-size: 1rem;
}
.stepper button {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--txt);
  font-size: 1.2rem; cursor: pointer; transition: all .15s;
}
.stepper button:hover { border-color: var(--gold); color: var(--gold-2); }

/* ============================================================
 *  UI Modal (tarayici alert/confirm yerine) - akici animasyon
 * ============================================================ */
.ui-modal-veil {
  position: fixed; inset: 0; z-index: 2000;
  display: grid; place-items: center; padding: 1rem;
  background: rgba(5,8,16,.55);
  backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .18s ease;
}
.ui-modal-veil.show { opacity: 1; }
.ui-modal {
  width: 100%; max-width: 400px;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: 18px; padding: 1.6rem 1.7rem;
  box-shadow: 0 30px 70px -20px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.04);
  transform: translateY(14px) scale(.96);
  opacity: 0; transition: transform .2s cubic-bezier(.2,.8,.2,1), opacity .2s ease;
}
.ui-modal-veil.show .ui-modal { transform: translateY(0) scale(1); opacity: 1; }
.ui-modal-title {
  font-family: 'Fraunces', serif; font-size: 1.3rem; font-weight: 600;
  margin-bottom: .6rem; color: var(--txt);
}
.ui-modal-body { color: var(--txt-dim); font-size: .96rem; line-height: 1.55; margin-bottom: 1.5rem; }
.ui-modal-actions { display: flex; gap: .7rem; justify-content: flex-end; }
.ui-btn {
  border: none; border-radius: 11px; padding: .65rem 1.3rem;
  font-size: .92rem; font-weight: 600; cursor: pointer;
  font-family: 'Sora', sans-serif; transition: filter .15s, transform .12s, border-color .15s;
}
.ui-btn:active { transform: translateY(1px); }
.ui-btn-primary { background: linear-gradient(135deg, var(--gold-2), var(--amber)); color: #1a1206; }
.ui-btn-primary:hover { filter: brightness(1.06); }
.ui-btn-danger { background: linear-gradient(135deg, var(--red), #ff7b87); color: #2a0508; }
.ui-btn-danger:hover { filter: brightness(1.06); }
.ui-btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--txt-dim); }
.ui-btn-ghost:hover { color: var(--txt); border-color: var(--txt-dim); }

/* ============================================================
 *  Islem butonlari hizalama duzeltmesi (Trial'da silme yok sorunu)
 * ============================================================ */
.row-actions {
  display: inline-flex; gap: .4rem; justify-content: flex-end;
  align-items: center; min-width: 168px;   /* sabit genislik -> hizalama korunur */
}
.row-actions .icon-btn { white-space: nowrap; }
.row-actions .spacer { width: 34px; display: inline-block; }  /* silme yoksa bos yer tutucu */
