/* ============================================================
   WC License Manager — Admin Styles
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f1f5f9;
    color: #0f172a;
    line-height: 1.5;
}

/* ── Login Page ── */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.login-box {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
}

.login-logo { font-size: 48px; margin-bottom: 12px; }
.login-box h1 { font-size: 20px; color: #1e293b; margin-bottom: 24px; }

/* ── App Layout ── */
.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    background: #1e293b;
    color: #fff;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand {
    font-size: 16px;
    font-weight: 700;
    padding: 0 20px 20px;
    border-bottom: 1px solid #334155;
    margin-bottom: 8px;
}

.nav-item {
    display: block;
    padding: 10px 20px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.nav-item:hover { color: #fff; background: #334155; }
.nav-item.active { color: #fff; background: #6366f1; }
.sidebar-spacer { flex: 1; }
.nav-logout { border-top: 1px solid #334155; margin-top: 8px; }

.content {
    flex: 1;
    margin-left: 220px;
    padding: 30px;
}

.content h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    color: #1e293b;
}

/* ── Stats Grid ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.stat-card.stat-green { border-color: #10b981; }
.stat-card.stat-red { border-color: #ef4444; }

.stat-number {
    font-size: 28px;
    font-weight: 800;
    color: #1e293b;
}

.stat-green .stat-number { color: #10b981; }
.stat-red .stat-number { color: #ef4444; }

.stat-label {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Cards ── */
.card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.card h2 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.info-box {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #6366f1;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.info-box h3 { margin-bottom: 8px; }
.info-box code {
    display: inline-block;
    background: #f1f5f9;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
}

/* ── Forms ── */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    background: #f8fafc;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #6366f1;
    outline: none;
}

.input-wide { max-width: 500px; }

.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.form-row .form-group { flex: 1; min-width: 180px; }

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    margin-right: 4px;
    margin-bottom: 4px;
}

.checkbox-label input[type="checkbox"] { margin: 0; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: #fff;
}

.btn-primary:hover { opacity: 0.9; }
.btn-ghost {
    background: transparent;
    border: 1px solid #e2e8f0;
    color: #64748b;
}

.btn-small { padding: 4px 10px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; padding: 12px; }
.btn-link {
    background: none;
    border: none;
    color: #6366f1;
    cursor: pointer;
    font-size: 13px;
    padding: 2px 4px;
    text-decoration: underline;
}

.btn-danger { color: #ef4444 !important; }

/* ── Table ── */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table th {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 2px solid #e2e8f0;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
}

.table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.table tr:hover { background: #f8fafc; }

.license-key {
    font-size: 11px;
    background: #f1f5f9;
    padding: 3px 6px;
    border-radius: 4px;
    word-break: break-all;
}

/* ── Badges ── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-green { background: #d1fae5; color: #065f46; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-small {
    padding: 2px 6px;
    font-size: 10px;
    background: #e0e7ff;
    color: #3730a3;
    border-radius: 8px;
    margin: 1px;
}

/* ── Alerts ── */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .sidebar { width: 100%; height: auto; position: relative; flex-direction: row; flex-wrap: wrap; padding: 10px; }
    .sidebar-brand { padding: 0 10px; border: none; margin: 0; }
    .sidebar-spacer { display: none; }
    .nav-item { padding: 8px 12px; font-size: 13px; }
    .content { margin-left: 0; padding: 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { flex-direction: column; }
}
