/* CupCap Admin Panel - Styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:         #0f1117;
    --bg-card:    #1a1d27;
    --bg-hover:   #22263a;
    --border:     #2a2f42;
    --primary:    #6c63ff;
    --primary-h:  #5a52e0;
    --danger:     #e05252;
    --danger-h:   #c94040;
    --warning:    #f0a830;
    --success:    #3cb97a;
    --text:       #e8eaf2;
    --text-muted: #8890a8;
    --radius:     10px;
    --shadow:     0 4px 24px rgba(0,0,0,.4);
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 15px;
}

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

/* ---- Login Page ---- */
.login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(ellipse at center, #1a1d27 0%, #0f1117 70%);
}
.login-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
}
.login-logo {
    text-align: center;
    margin-bottom: 28px;
}
.login-logo h1 { font-size: 28px; color: var(--primary); letter-spacing: -0.5px; }
.login-logo p  { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

/* ---- Layout ---- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
}
.sidebar-logo {
    padding: 24px 20px 16px;
    border-bottom: 1px solid var(--border);
}
.sidebar-logo h2 { font-size: 20px; color: var(--primary); }
.sidebar-logo small { color: var(--text-muted); font-size: 12px; }

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: var(--text-muted);
    font-size: 14px;
    transition: all .15s;
    border-left: 3px solid transparent;
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--bg-hover);
    color: var(--text);
    border-left-color: var(--primary);
    text-decoration: none;
}
.sidebar-nav a .icon { font-size: 18px; width: 22px; text-align: center; }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
}
.sidebar-footer a { color: var(--danger); font-size: 13px; }

.main { margin-left: 240px; flex: 1; padding: 28px 32px; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}
.topbar h1 { font-size: 22px; font-weight: 600; }
.topbar .badge-online {
    background: #1e3a2a;
    color: var(--success);
    border: 1px solid var(--success);
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); display: inline-block; }

/* ---- Cards ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 20px; margin-bottom: 28px; }
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
}
.card-value { font-size: 36px; font-weight: 700; color: var(--text); line-height: 1; }
.card-label { color: var(--text-muted); font-size: 13px; margin-top: 8px; }
.card-icon   { font-size: 28px; margin-bottom: 12px; }
.card.primary .card-value { color: var(--primary); }
.card.success .card-value { color: var(--success); }
.card.warning .card-value { color: var(--warning); }
.card.danger  .card-value { color: var(--danger); }

/* ---- Table ---- */
.table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}
.table-header h3 { font-size: 15px; font-weight: 600; }

table { width: 100%; border-collapse: collapse; }
th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    background: rgba(255,255,255,.03);
    border-bottom: 1px solid var(--border);
}
td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-hover); }

.did-cell { font-family: monospace; font-size: 12px; color: var(--text-muted); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Badges ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 500;
}
.badge-active   { background: #1a3528; color: var(--success); border: 1px solid #2a5040; }
.badge-takedown { background: #3a2020; color: var(--danger);  border: 1px solid #5a2a2a; }
.badge-used     { background: #2a2030; color: var(--text-muted); border: 1px solid #3a2a50; }
.badge-pending  { background: #3a2f10; color: var(--warning); border: 1px solid #5a4a20; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all .15s;
    text-decoration: none;
}
.btn:hover { text-decoration: none; opacity: .9; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary  { background: var(--primary);  color: #fff; }
.btn-danger   { background: var(--danger);   color: #fff; }
.btn-warning  { background: var(--warning);  color: #000; }
.btn-success  { background: var(--success);  color: #fff; }
.btn-ghost    { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 13px; }

/* ---- Form ---- */
.form-group { margin-bottom: 18px; }
.form-label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text-muted); font-weight: 500; }
.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color .15s;
}
.form-control:focus { border-color: var(--primary); }
.form-control::placeholder { color: var(--text-muted); }

.search-bar { display: flex; gap: 10px; }
.search-bar .form-control { flex: 1; }

/* ---- Alerts ---- */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-success { background: #1a3528; color: var(--success); border: 1px solid #2a5040; }
.alert-danger  { background: #3a2020; color: var(--danger);  border: 1px solid #5a2a2a; }
.alert-warning { background: #3a2f10; color: var(--warning); border: 1px solid #5a4a20; }
.alert-info    { background: #1a1f3a; color: #7b9ff5;        border: 1px solid #2a3a5a; }

/* ---- Modal / Confirm ---- */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.7);
    display: flex; align-items: center; justify-content: center;
    z-index: 999;
}
.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px 32px;
    width: 440px;
    max-width: 95vw;
    box-shadow: var(--shadow);
}
.modal-box h3 { font-size: 18px; margin-bottom: 10px; }
.modal-box p  { color: var(--text-muted); margin-bottom: 24px; font-size: 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ---- Invite code ---- */
.invite-code {
    font-family: monospace;
    font-size: 15px;
    background: var(--bg);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    letter-spacing: .05em;
}

/* ---- Status Info ---- */
.server-info {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    margin-top: 20px;
}
.server-info h3 { margin-bottom: 16px; font-size: 15px; }
.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.info-row:last-child { border-bottom: none; }
.info-row .key { color: var(--text-muted); }
.info-row .val { font-weight: 500; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .sidebar { width: 200px; }
    .main { margin-left: 200px; padding: 16px; }
}