/* ============================================
   Pterodactyl Manager — Orange & Light Theme
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --orange-50:#fff7ed; --orange-100:#ffedd5; --orange-200:#fed7aa;
  --orange-300:#fdba74; --orange-400:#fb923c; --orange-500:#f97316;
  --orange-600:#ea580c; --orange-700:#c2410c; --orange-800:#9a3412;
  --bg:#fffaf5; --surface:#ffffff; --surface-2:#fff4ea;
  --border:#fde2c8; --border-strong:#fbc89a;
  --text:#1f1410; --text-muted:#7a5a48; --text-soft:#9a7560;
  --primary:var(--orange-500); --primary-hover:var(--orange-600);
  --primary-soft:var(--orange-100);
  --success:#16a34a; --warning:#d97706; --danger:#dc2626; --info:#0284c7;
  --radius:12px; --radius-sm:8px; --radius-lg:18px;
  --shadow-sm:0 1px 2px rgba(234,88,12,.06);
  --shadow:0 4px 16px rgba(234,88,12,.08), 0 1px 3px rgba(0,0,0,.04);
  --shadow-lg:0 20px 40px -12px rgba(234,88,12,.18);
  --font:'Plus Jakarta Sans',system-ui,-apple-system,sans-serif;
  --mono:'JetBrains Mono',ui-monospace,monospace;
  --gradient:linear-gradient(135deg,var(--orange-400),var(--orange-600));
  --gradient-soft:linear-gradient(135deg,#fff4ea,#ffe6d0);
}

*,*::before,*::after{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:var(--font);
  background:var(--bg);
  background-image:
    radial-gradient(circle at 0% 0%, #ffe6d0 0, transparent 40%),
    radial-gradient(circle at 100% 0%, #ffe0b8 0, transparent 35%);
  background-attachment:fixed;
  color:var(--text);
  line-height:1.55; min-height:100vh;
  -webkit-font-smoothing:antialiased;
}

a{color:var(--primary-hover);text-decoration:none}
a:hover{text-decoration:underline}
h1,h2,h3,h4{margin:0 0 .4em;font-weight:700;letter-spacing:-0.02em;line-height:1.2}
h1{font-size:1.9rem;font-weight:800}
h2{font-size:1.4rem}
h3{font-size:1.1rem}
p{margin:0 0 1em}
code,pre,.mono{font-family:var(--mono);font-size:.88em}
pre{background:#1f1410;color:#fde2c8;padding:14px 16px;border-radius:var(--radius);overflow:auto;max-height:480px}

/* ===== Layout ===== */
.app{display:flex;min-height:100vh}
.sidebar{
  width:260px;background:var(--surface);border-right:1px solid var(--border);
  padding:22px 14px;position:sticky;top:0;height:100vh;overflow-y:auto;
  display:flex;flex-direction:column;gap:6px;flex-shrink:0;
}
.sidebar .brand{display:flex;align-items:center;gap:10px;padding:6px 10px 18px;border-bottom:1px solid var(--border);margin-bottom:10px}
.sidebar .brand-logo{width:36px;height:36px;border-radius:10px;background:var(--gradient);display:grid;place-items:center;color:#fff;font-weight:800;box-shadow:var(--shadow)}
.sidebar .brand-name{font-weight:800;font-size:1.05rem;letter-spacing:-0.01em}
.sidebar .brand-sub{font-size:.72rem;color:var(--text-soft);text-transform:uppercase;letter-spacing:.1em}
.nav-link{
  display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:var(--radius-sm);
  color:var(--text-muted);font-weight:500;font-size:.93rem;transition:.15s;cursor:pointer;
}
.nav-link:hover{background:var(--surface-2);color:var(--orange-700);text-decoration:none}
.nav-link.active{background:var(--primary-soft);color:var(--orange-700);font-weight:600}
.nav-link .icon{width:18px;height:18px;flex-shrink:0}
.sidebar .nav-section{font-size:.7rem;text-transform:uppercase;letter-spacing:.12em;color:var(--text-soft);padding:14px 12px 4px;font-weight:700}
.sidebar .user-card{margin-top:auto;padding:12px;background:var(--surface-2);border-radius:var(--radius);border:1px solid var(--border)}

.main{flex:1;min-width:0;display:flex;flex-direction:column}
.topbar{
  display:flex;align-items:center;justify-content:space-between;gap:16px;
  padding:18px 32px;background:rgba(255,255,255,.7);backdrop-filter:blur(14px);
  border-bottom:1px solid var(--border);position:sticky;top:0;z-index:30;
}
.topbar .page-title{font-size:1.25rem;font-weight:700;margin:0}
.topbar .actions{display:flex;gap:10px;align-items:center}
.content{padding:28px 32px;max-width:1400px;width:100%;margin:0 auto}

/* ===== Cards ===== */
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);padding:22px;margin-bottom:20px}
.card-header{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:16px}
.card-header h2,.card-header h3{margin:0}
.card-sub{color:var(--text-muted);font-size:.9rem}

.grid{display:grid;gap:18px}
.grid-2{grid-template-columns:repeat(auto-fit,minmax(280px,1fr))}
.grid-3{grid-template-columns:repeat(auto-fit,minmax(240px,1fr))}
.grid-4{grid-template-columns:repeat(auto-fit,minmax(200px,1fr))}

/* ===== Stat cards ===== */
.stat{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:20px;position:relative;overflow:hidden;transition:.2s}
.stat:hover{transform:translateY(-2px);box-shadow:var(--shadow)}
.stat .label{font-size:.78rem;text-transform:uppercase;letter-spacing:.08em;color:var(--text-soft);font-weight:600}
.stat .value{font-size:2rem;font-weight:800;margin-top:6px;letter-spacing:-.02em}
.stat .delta{font-size:.85rem;color:var(--text-muted);margin-top:4px}
.stat .icon-wrap{position:absolute;top:18px;right:18px;width:42px;height:42px;border-radius:12px;background:var(--primary-soft);color:var(--orange-600);display:grid;place-items:center}
.stat.accent{background:var(--gradient);color:#fff;border:none}
.stat.accent .label,.stat.accent .delta{color:rgba(255,255,255,.85)}
.stat.accent .icon-wrap{background:rgba(255,255,255,.2);color:#fff}

/* ===== Buttons ===== */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  padding:10px 18px;border-radius:var(--radius-sm);font-family:inherit;
  font-weight:600;font-size:.92rem;cursor:pointer;border:1px solid transparent;
  transition:.15s;white-space:nowrap;text-decoration:none;
}
.btn:hover{text-decoration:none}
.btn-primary{background:var(--gradient);color:#fff;box-shadow:0 4px 12px rgba(234,88,12,.25)}
.btn-primary:hover{box-shadow:0 6px 20px rgba(234,88,12,.4);transform:translateY(-1px)}
.btn-secondary{background:var(--surface);color:var(--text);border-color:var(--border-strong)}
.btn-secondary:hover{background:var(--surface-2)}
.btn-ghost{background:transparent;color:var(--text-muted)}
.btn-ghost:hover{background:var(--surface-2);color:var(--text)}
.btn-danger{background:#fee2e2;color:#b91c1c;border-color:#fecaca}
.btn-danger:hover{background:#fecaca}
.btn-sm{padding:6px 12px;font-size:.82rem}
.btn-lg{padding:14px 24px;font-size:1rem}
.btn-block{width:100%}
.btn[disabled]{opacity:.5;cursor:not-allowed;pointer-events:none}

/* ===== Forms ===== */
.field{margin-bottom:14px;display:flex;flex-direction:column;gap:6px}
.field label{font-size:.85rem;font-weight:600;color:var(--text)}
.field .hint{font-size:.78rem;color:var(--text-soft)}
.input,.select,.textarea{
  width:100%;padding:11px 14px;font-family:inherit;font-size:.94rem;
  background:var(--surface);border:1px solid var(--border-strong);
  border-radius:var(--radius-sm);color:var(--text);transition:.15s;
}
.input:focus,.select:focus,.textarea:focus{
  outline:none;border-color:var(--primary);box-shadow:0 0 0 3px rgba(249,115,22,.15);
}
.textarea{resize:vertical;min-height:90px;font-family:var(--mono);font-size:.85rem}
.field-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px}

/* ===== Tables ===== */
.table-wrap{overflow-x:auto;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface)}
table.data{width:100%;border-collapse:collapse;font-size:.92rem}
table.data th{
  text-align:left;padding:14px 16px;background:var(--surface-2);
  color:var(--text-muted);font-weight:600;font-size:.78rem;
  text-transform:uppercase;letter-spacing:.06em;border-bottom:1px solid var(--border);
}
table.data td{padding:14px 16px;border-bottom:1px solid var(--border);vertical-align:middle}
table.data tr:last-child td{border-bottom:none}
table.data tr:hover td{background:#fffaf3}

/* ===== Badges ===== */
.badge{display:inline-flex;align-items:center;gap:5px;padding:3px 10px;border-radius:999px;font-size:.74rem;font-weight:600;background:var(--primary-soft);color:var(--orange-700);text-transform:uppercase;letter-spacing:.04em}
.badge.success{background:#dcfce7;color:#166534}
.badge.danger{background:#fee2e2;color:#991b1b}
.badge.warning{background:#fef3c7;color:#92400e}
.badge.info{background:#dbeafe;color:#1e40af}
.badge.muted{background:#f1ece6;color:#6b5347}
.dot{width:8px;height:8px;border-radius:50%;background:currentColor;display:inline-block}

/* ===== Modal ===== */
.modal-backdrop{
  position:fixed;inset:0;background:rgba(31,20,16,.45);backdrop-filter:blur(4px);
  display:none;align-items:center;justify-content:center;z-index:100;padding:20px;
  animation:fade .2s;
}
.modal-backdrop.open{display:flex}
.modal{
  background:var(--surface);border-radius:var(--radius-lg);box-shadow:var(--shadow-lg);
  width:100%;max-width:560px;max-height:90vh;overflow-y:auto;
  animation:pop .25s cubic-bezier(.2,.9,.3,1.2);
}
.modal-lg{max-width:780px}
.modal-header{padding:20px 24px;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:center;gap:12px}
.modal-header h3{margin:0}
.modal-body{padding:22px 24px}
.modal-footer{padding:16px 24px;border-top:1px solid var(--border);display:flex;justify-content:flex-end;gap:10px}
.modal-close{background:none;border:none;font-size:1.4rem;cursor:pointer;color:var(--text-soft);padding:0;width:32px;height:32px;border-radius:8px}
.modal-close:hover{background:var(--surface-2);color:var(--text)}

/* ===== Auth ===== */
.auth-wrap{
  min-height:100vh;display:grid;place-items:center;padding:20px;
  background:
    radial-gradient(circle at 20% 20%, #ffdcb5 0, transparent 50%),
    radial-gradient(circle at 80% 80%, #ffc794 0, transparent 50%),
    var(--bg);
}
.auth-card{
  background:var(--surface);border-radius:24px;box-shadow:var(--shadow-lg);
  padding:40px;width:100%;max-width:440px;border:1px solid var(--border);
}
.auth-brand{display:flex;flex-direction:column;align-items:center;gap:12px;margin-bottom:28px}
.auth-brand .brand-logo{width:56px;height:56px;border-radius:16px;background:var(--gradient);display:grid;place-items:center;color:#fff;font-weight:800;font-size:1.4rem;box-shadow:var(--shadow-lg)}
.auth-brand h1{font-size:1.6rem;margin:0}
.auth-brand p{color:var(--text-muted);margin:0;font-size:.92rem}
.auth-tabs{display:flex;background:var(--surface-2);border-radius:var(--radius);padding:4px;margin-bottom:24px}
.auth-tab{flex:1;padding:9px;text-align:center;border-radius:8px;cursor:pointer;font-weight:600;color:var(--text-muted);font-size:.9rem;border:none;background:none;font-family:inherit}
.auth-tab.active{background:var(--surface);color:var(--orange-700);box-shadow:var(--shadow-sm)}

/* ===== Toast ===== */
.toast-container{position:fixed;top:20px;right:20px;z-index:200;display:flex;flex-direction:column;gap:10px;max-width:380px}
.toast{
  background:var(--surface);border:1px solid var(--border);border-left:4px solid var(--primary);
  padding:14px 18px;border-radius:var(--radius);box-shadow:var(--shadow-lg);
  display:flex;align-items:center;gap:10px;animation:slide .25s;font-size:.9rem;
}
.toast.success{border-left-color:var(--success)}
.toast.error{border-left-color:var(--danger)}
.toast.warning{border-left-color:var(--warning)}

/* ===== Utils ===== */
.flex{display:flex}.items-center{align-items:center}.justify-between{justify-content:space-between}
.gap-2{gap:8px}.gap-3{gap:12px}.gap-4{gap:16px}
.mt-2{margin-top:8px}.mt-4{margin-top:16px}.mb-2{margin-bottom:8px}.mb-4{margin-bottom:16px}
.text-muted{color:var(--text-muted)}.text-soft{color:var(--text-soft)}
.text-sm{font-size:.85rem}.text-xs{font-size:.78rem}
.text-right{text-align:right}.text-center{text-align:center}
.hidden{display:none!important}
.divider{height:1px;background:var(--border);margin:18px 0}
.empty{padding:60px 20px;text-align:center;color:var(--text-soft)}
.empty .empty-icon{font-size:3rem;margin-bottom:12px;opacity:.4}
.kbd{font-family:var(--mono);background:var(--surface-2);border:1px solid var(--border);padding:2px 6px;border-radius:4px;font-size:.78rem}
.progress{height:8px;background:var(--surface-2);border-radius:999px;overflow:hidden}
.progress-bar{height:100%;background:var(--gradient);transition:width .3s;border-radius:999px}
.spinner{width:18px;height:18px;border:2px solid var(--border);border-top-color:var(--primary);border-radius:50%;animation:spin .7s linear infinite;display:inline-block}

@keyframes spin{to{transform:rotate(360deg)}}
@keyframes pop{from{transform:scale(.94);opacity:0}to{transform:scale(1);opacity:1}}
@keyframes fade{from{opacity:0}to{opacity:1}}
@keyframes slide{from{transform:translateX(20px);opacity:0}to{transform:translateX(0);opacity:1}}

/* ===== Mobile ===== */
.menu-toggle{display:none;background:none;border:1px solid var(--border-strong);padding:8px;border-radius:8px;cursor:pointer}
@media (max-width:880px){
  .sidebar{position:fixed;left:-280px;z-index:50;transition:left .25s;box-shadow:var(--shadow-lg)}
  .sidebar.open{left:0}
  .menu-toggle{display:inline-flex}
  .content{padding:18px}
  .topbar{padding:14px 18px}
  h1{font-size:1.5rem}
}
