/* TimeMachine Platform — Dashboard CSS */
:root {
    --primary: #00BFA5;
    --primary-dark: #009688;
    --bg: #0a0a1a;
    --bg-card: #1a1a2e;
    --bg-input: #16213e;
    --text: #e0e0e0;
    --text-muted: #888;
    --border: #2a2a4a;
    --danger: #e74c3c;
    --warning: #f39c12;
    --success: #2ecc71;
    --info: #3498db;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg); color: var(--text);
    min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.app { display: flex; min-height: 100vh; }
.sidebar {
    width: 240px; background: var(--bg-card); border-right: 1px solid var(--border);
    padding: 20px 0; position: fixed; top: 0; left: 0; bottom: 0; overflow-y: auto; z-index: 100;
}
.sidebar .logo { padding: 0 20px 20px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.sidebar .logo h2 { color: var(--primary); font-size: 18px; }
.sidebar .logo small { color: var(--text-muted); font-size: 12px; }
.sidebar nav a {
    display: flex; align-items: center; gap: 10px; padding: 10px 20px;
    color: var(--text-muted); transition: all 0.2s; font-size: 14px;
}
.sidebar nav a:hover, .sidebar nav a.active { color: var(--text); background: rgba(255,255,255,0.05); text-decoration: none; }
.sidebar nav a.active { border-left: 3px solid var(--primary); color: var(--primary); }
.sidebar nav .divider { height: 1px; background: var(--border); margin: 10px 20px; }
.sidebar .user-info { padding: 15px 20px; border-top: 1px solid var(--border); margin-top: auto; position: absolute; bottom: 0; left: 0; right: 0; }
.sidebar .user-info .name { font-size: 14px; font-weight: 500; }
.sidebar .user-info .role { font-size: 11px; color: var(--primary); text-transform: uppercase; }

.main { margin-left: 240px; flex: 1; padding: 30px; min-height: 100vh; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.page-header h1 { font-size: 24px; font-weight: 600; }

/* Cards */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.card h3 { margin-bottom: 12px; font-size: 16px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; }
.stat-card .value { font-size: 32px; font-weight: 700; color: var(--primary); }
.stat-card .label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px;
    border: none; border-radius: var(--radius); cursor: pointer; font-size: 14px;
    transition: all 0.2s; font-weight: 500;
}
.btn-primary { background: var(--primary); color: #000; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
input, select, textarea {
    width: 100%; padding: 10px 12px; background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text); font-size: 14px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
textarea { min-height: 80px; resize: vertical; }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--text-muted); font-weight: 500; font-size: 12px; text-transform: uppercase; }
tr:hover { background: rgba(255,255,255,0.02); }

/* Badges */
.badge {
    display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px;
    font-weight: 600; text-transform: uppercase;
}
.badge-trial { background: rgba(52,152,219,0.2); color: var(--info); }
.badge-active { background: rgba(46,204,113,0.2); color: var(--success); }
.badge-expired { background: rgba(243,156,18,0.2); color: var(--warning); }
.badge-suspended { background: rgba(231,76,60,0.2); color: var(--danger); }
.badge-banned { background: rgba(231,76,60,0.3); color: #ff6b6b; }
.badge-super_admin { background: rgba(0,191,165,0.2); color: var(--primary); }
.badge-admin { background: rgba(155,89,182,0.2); color: #9b59b6; }
.badge-user { background: rgba(149,165,166,0.2); color: #95a5a6; }

/* Tabs */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab {
    padding: 10px 20px; cursor: pointer; color: var(--text-muted); font-size: 14px;
    border-bottom: 2px solid transparent; transition: all 0.2s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Modal */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7); z-index: 1000; align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; width: 90%; max-width: 500px; }
.modal h3 { margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* Toast */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 2000; }
.toast {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 12px 20px; margin-bottom: 8px; box-shadow: var(--shadow);
    animation: slideIn 0.3s ease;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Notifications bell */
.notification-bell { position: relative; cursor: pointer; }
.notification-bell .count {
    position: absolute; top: -4px; right: -4px; background: var(--danger);
    color: #fff; font-size: 10px; width: 16px; height: 16px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

/* Auth pages */
.auth-container {
    display: flex; align-items: center; justify-content: center; min-height: 100vh;
    background: var(--bg);
}
.auth-box {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
    padding: 40px; width: 400px; max-width: 90%;
}
.auth-box h1 { text-align: center; margin-bottom: 8px; color: var(--primary); }
.auth-box .subtitle { text-align: center; color: var(--text-muted); margin-bottom: 24px; font-size: 14px; }
.auth-box .btn { width: 100%; justify-content: center; padding: 12px; }
.auth-box .footer { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-muted); }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main { margin-left: 0; padding: 16px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* Empty state */
.empty-state { text-align: center; padding: 40px; color: var(--text-muted); }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { margin-bottom: 16px; }

/* Loading */
.loading { text-align: center; padding: 40px; color: var(--text-muted); }
.spinner { display: inline-block; width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
