* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f5;
    color: #333;
}
a { text-decoration: none; color: inherit; }

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

/* Sidebar */
.sidebar {
    width: 260px;
    background: #1a1a2e;
    color: #fff;
    padding: 24px 0;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    overflow-y: auto;
}
.sidebar h2 {
    font-size: 18px;
    padding: 0 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 16px;
}
.sidebar a {
    display: block;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    transition: all 0.2s;
}
.sidebar a:hover, .sidebar a.active {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.sidebar .logout {
    margin-top: 32px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 16px;
    color: #ff6b6b;
}

/* Main content */
.main {
    margin-left: 260px;
    flex: 1;
    padding: 32px;
}
.main h1 {
    font-size: 28px;
    margin-bottom: 8px;
}
.main .subtitle {
    color: #666;
    margin-bottom: 28px;
}

/* Cards */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}
.card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.card h3 {
    font-size: 13px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.card .value {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a2e;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 24px;
}
th {
    background: #f8f9fa;
    text-align: left;
    padding: 14px 16px;
    font-size: 12px;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #eee;
}
td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
}
tr:hover td { background: #f8f9ff; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}
.btn-primary { background: #4361ee; color: #fff; }
.btn-primary:hover { background: #3651d4; }
.btn-danger { background: #ef476f; color: #fff; }
.btn-danger:hover { background: #d63d62; }
.btn-success { background: #06d6a0; color: #fff; }
.btn-success:hover { background: #05b88a; }
.btn-sm { padding: 6px 14px; font-size: 12px; }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #444;
}
.form-group input, .form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #4361ee;
}

/* Auth pages */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}
.auth-box {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.auth-box h1 {
    text-align: center;
    font-size: 24px;
    margin-bottom: 4px;
    color: #1a1a2e;
}
.auth-box p {
    text-align: center;
    color: #888;
    font-size: 14px;
    margin-bottom: 28px;
}
.auth-box .btn {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}
.auth-box .footer-text {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #888;
}
.auth-box .footer-text a { color: #4361ee; font-weight: 600; }
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}
.alert-error { background: #ffe8e8; color: #d32f2f; }
.alert-success { background: #e8faf0; color: #0a7c42; }

/* Badge */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.badge-success { background: #e8faf0; color: #0a7c42; }
.badge-danger { background: #ffe8e8; color: #d32f2f; }
.badge-warning { background: #fff8e1; color: #e65100; }

/* Script box */
.script-box {
    background: #1a1a2e;
    color: #a8d8ea;
    padding: 16px 20px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    overflow-x: auto;
    margin: 12px 0;
    position: relative;
}
.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}
.copy-btn:hover { background: rgba(255,255,255,0.2); }

/* Section */
.section { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); margin-bottom: 24px; }
.section h2 { font-size: 18px; margin-bottom: 16px; }

/* Flex */
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.mb-4 { margin-bottom: 16px; }
.mt-4 { margin-top: 16px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: #888; font-size: 13px; }

@media (max-width: 768px) {
    .sidebar { width: 200px; }
    .main { margin-left: 200px; padding: 20px; }
    .cards { grid-template-columns: 1fr 1fr; }
}
