/* 
   CRM ULTRA-PREMIUM DESIGN SYSTEM 
   Concept: Modern SaaS / Dark Elegance 
   Palette: Deep Slate & Electric Indigo 
*/

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Colors - Deep & Vibrant */
    --primary-color: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --bg-main: #0b0f1a;
    --sidebar-bg: #0f172a;
    --card-bg: #1e293b;
    --card-border: rgba(255, 255, 255, 0.05);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
    
    /* Semantic Colors */
    --success: #10b981;
    --danger: #f43f5e;
    --warning: #f59e0b;
    
    /* Effects */
    --radius-lg: 1rem;
    --radius-md: 0.75rem;
    --shadow-premium: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06), 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

/* --- SIDEBAR --- */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    height: 100vh;
    position: fixed;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.sidebar-brand {
    padding: 3rem 2rem;
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #fff, var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand::before {
    content: '';
    width: 12px;
    height: 24px;
    background: var(--primary-color);
    border-radius: 4px;
    box-shadow: 0 0 15px var(--primary-glow);
}

.sidebar-nav {
    list-style: none;
    padding: 0 1.25rem;
    flex: 1;
}

.sidebar-nav li {
    margin-bottom: 0.5rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition);
    position: relative;
}

.sidebar-nav a:hover {
    color: #fff;
    background-color: rgba(255,255,255,0.05);
}

.sidebar-nav a.active {
    color: #fff;
    background-color: rgba(99, 102, 241, 0.15);
}

.sidebar-nav a.active::after {
    content: '';
    position: absolute;
    right: 1rem;
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary-color);
}

.sidebar-footer {
    padding: 2rem;
    border-top: 1px solid var(--border-color);
}

.user-info {
    padding: 1rem;
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

/* --- MAIN CONTENT --- */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 4rem;
    max-width: 1400px;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-header {
    margin-bottom: 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

/* --- CARDS & GRIDS --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 60px; height: 60px;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.1), transparent);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
}

.stat-title {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-premium);
    margin-bottom: 2rem;
}

.card-header {
    padding: 1.5rem 2.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 2.5rem;
}

/* --- TABLES --- */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    padding: 1.25rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9375rem;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr {
    transition: var(--transition);
}

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

/* --- BADGES --- */
.badge {
    padding: 0.35rem 0.85rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- FORMS & INPUTS --- */
.form-group {
    margin-bottom: 1.5rem;
}

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

.form-control {
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: #0b0f1a;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: #fff;
    font-family: inherit;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* --- BUTTONS --- */
.btn {
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #4f46e5);
    color: #fff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.btn-outline {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.05);
    border-color: #fff;
}

/* --- ALERTS --- */
.alert {
    padding: 1.25rem 2rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.2);
}

.alert-error {
    background: rgba(244, 63, 94, 0.1);
    color: #fb7185;
    border-color: rgba(244, 63, 94, 0.2);
}

/* --- PAGINATION --- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
}

.pagination a, .pagination span {
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    font-weight: 600;
    transition: var(--transition);
}

.pagination a:hover {
    background: rgba(255,255,255,0.07);
    transform: translateY(-2px);
}

.pagination .active {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* --- DETAIL VIEW (Linear Style) --- */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2.5rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.detail-value {
    font-weight: 600;
    text-align: right;
}

.note-item {
    background: rgba(255,255,255,0.02);
    border-left: 3px solid var(--primary-color);
    padding: 1.25rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin-bottom: 1rem;
}

.note-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.note-text {
    font-size: 0.9375rem;
}

/* --- LOGIN UPGRADE --- */
.auth-wrapper {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top left, #1e293b, #0b0f1a);
}

.auth-card {
    width: 100%;
    max-width: 450px;
    background: var(--card-bg);
    padding: 4rem;
    border-radius: 2rem;
    border: 1px solid var(--card-border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.auth-card h1 {
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 0.5rem;
}

.subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 3rem;
    font-size: 0.875rem;
}
