/* SearchLifter Premium Dark Theme */
:root {
    --bg-dark: #0f172a;
    /* slate-900 */
    --bg-card: #1e293b;
    /* slate-800 */
    --bg-hover: #334155;
    /* slate-700 */
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    /* slate-400 */
    --primary: #2563eb;
    /* blue-600 */
    --primary-hover: #3b82f6;
    /* blue-500 */
    --danger: #ef4444;
    /* red-500 */
    --success: #22c55e;
    /* green-500 */
    --border: #334155;
    /* slate-700 */

    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
}

/* Utilities */
.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.w-full {
    width: 100%;
}

.h-screen {
    height: 100vh;
}

.text-center {
    text-align: center;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.mt-4 {
    margin-top: 1rem;
}

.p-4 {
    padding: 1rem;
}

.p-6 {
    padding: 1.5rem;
}

.p-8 {
    padding: 2rem;
}

/* Components */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.input-group {
    margin-bottom: 1rem;
}

.label {
    display: block;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.input {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    color: white;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn {
    display: inline-block;
    width: 100%;
    padding: 0.75rem;
    background-color: var(--primary);
    color: white;
    font-weight: bold;
    border-radius: 0.25rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: center;
    text-decoration: none;
}

.btn:hover {
    background-color: var(--primary-hover);
}

.btn-danger {
    background-color: transparent;
    color: #f87171;
    border: 1px solid #7f1d1d;
}

.btn-danger:hover {
    background-color: #450a0a;
}

.text-red {
    color: var(--danger);
}

.text-green {
    color: var(--success);
}

.text-blue {
    color: #60a5fa;
}

.font-bold {
    font-weight: 700;
}

.text-3xl {
    font-size: 1.875rem;
}

.text-4xl {
    font-size: 2.25rem;
}

/* Grid */
.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .md\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .md\:flex {
        display: flex;
    }

    .hidden-md {
        display: none;
    }
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 260px;
    background-color: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 2rem;
}

.nav-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    text-decoration: none;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    transition: background 0.2s;
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--bg-hover);
}

.nav-link.active {
    background-color: var(--primary);
}

.content-area {
    flex: 1;
    padding: 2.5rem;
    overflow-y: auto;
}

/* --- NEW: Design System from Mockup --- */

/* 1. Metric Cards with Trends */
.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.trend-indicator {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 0.5rem;
}

.trend-up {
    color: var(--success);
}

.trend-down {
    color: var(--danger);
}

/* 2. User Management Cards (Middle Panel Style) */
.user-card {
    background: #1e293b;
    /* Slate-800 */
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.user-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    border-color: var(--primary);
}

.user-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.user-avatar-lg {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    background: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    font-weight: bold;
    margin-right: 1rem;
}

.credential-box {
    background: #0f172a;
    /* Darker bg for sensitive data */
    border-radius: 0.5rem;
    padding: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
    border: 1px dashed var(--border);
}

.credential-toggle {
    cursor: pointer;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* 3. Quick Actions (Bottom Panel Style) */
.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.action-btn {
    background: white;
    color: #0f172a;
    border-radius: 1rem;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: hover 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.action-btn:hover {
    background: #f1f5f9;
}

.action-icon {
    font-size: 1.5rem;
    color: var(--primary);
    background: #eff6ff;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
}

/* 4. Activity List (Right Panel Style) */
.activity-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
}

.activity-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.icon-login {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
}

.icon-alert {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

.icon-success {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
}

/* Data Tables */
.table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

th {
    text-align: left;
    padding: 1rem;
    background-color: var(--bg-hover);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

td {
    padding: 1rem;
    border-top: 1px solid var(--border);
    color: var(--text-main);
}

tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Badge System */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-admin {
    background: rgba(139, 92, 246, 0.1);
    color: #a78bfa;
}

.badge-sales {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
}

.badge-client {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
}

.badge-marketing {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
}

/* Calendar Widget */
.calendar-widget {
    background: var(--bg-card);
    border-radius: 1rem;
    padding: 1.5rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    color: var(--text-muted);
    cursor: default;
}

.calendar-day.today {
    background-color: var(--primary);
    color: white;
    font-weight: bold;
}

.calendar-day.has-event {
    border: 1px solid var(--primary);
    color: var(--primary);
    font-weight: bold;
}

/* Premium Forms */
select.input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

textarea.input {
    resize: vertical;
    min-height: 100px;
}