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

/* Core Theme Variables */
:root {
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Dark Premium Color Palette */
    --color-bg: #0b0a12;
    --color-surface: #131120;
    --color-surface-hover: #1b192e;
    --color-surface-glass: rgba(19, 17, 32, 0.7);
    --color-border: rgba(255, 255, 255, 0.08);
    --color-border-focus: rgba(103, 61, 230, 0.5);
    
    --color-primary: #673de6;
    --color-primary-hover: #5430c4;
    --color-primary-glow: rgba(103, 61, 230, 0.25);
    
    --color-secondary: #00d2c4;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-info: #3b82f6;
    
    --color-text: #f3f4f6;
    --color-text-secondary: #9ca3af;
    --color-text-muted: #6b7280;

    --sidebar-width: 260px;
    --header-height: 70px;
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 20px;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.35);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Global Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #ffffff;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition-smooth);
}

a:hover {
    color: var(--color-primary-hover);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--color-bg);
}
::-webkit-scrollbar-thumb {
    background: var(--color-surface-hover);
    border-radius: var(--border-radius-sm);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* Utility Layout Classes */
.flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-column { flex-direction: column; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.w-full { width: 100%; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-family: var(--font-body);
    font-weight: 550;
    font-size: 0.9rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-smooth);
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--color-primary);
    color: #ffffff;
    box-shadow: 0 4px 14px var(--color-primary-glow);
}
.btn-primary:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--color-primary-glow);
}

.btn-secondary {
    background-color: transparent;
    border-color: var(--color-border);
    color: var(--color-text);
}
.btn-secondary:hover {
    background-color: var(--color-surface-hover);
    border-color: var(--color-text-secondary);
}

.btn-danger {
    background-color: var(--color-danger);
    color: #ffffff;
}
.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

/* Glassmorphism Card Container */
.glass-card {
    background: var(--color-surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition-smooth);
    margin-bottom: 1.5rem;
}
.glass-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: rgba(255, 255, 255, 0.12);
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    border-radius: var(--border-radius-sm);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}
.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-glow);
    background-color: rgba(0, 0, 0, 0.3);
}

/* App Shell (Dashboard Layout) */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--color-surface);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    transition: var(--transition-smooth);
}

.sidebar-header {
    height: var(--header-height);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
}

.sidebar-logo {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.35rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.sidebar-logo span {
    color: var(--color-primary);
}

.sidebar-menu {
    list-style: none;
    padding: 1.5rem 0.75rem;
    flex-grow: 1;
}

.sidebar-item {
    margin-bottom: 0.35rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    color: var(--color-text-secondary);
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    gap: 0.75rem;
    transition: var(--transition-smooth);
}
.sidebar-link:hover {
    color: #ffffff;
    background-color: var(--color-surface-hover);
}
.sidebar-link.active {
    color: #ffffff;
    background-color: var(--color-primary);
    box-shadow: 0 4px 12px var(--color-primary-glow);
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background-color: var(--color-primary);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-details {
    display: flex;
    flex-direction: column;
    max-width: 130px;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.7rem;
    color: var(--color-text-muted);
}

.btn-logout {
    color: var(--color-text-muted);
    font-size: 1.1rem;
}
.btn-logout:hover {
    color: var(--color-danger);
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    padding: 2rem;
    min-height: 100vh;
    transition: var(--transition-smooth);
}

.top-bar {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.page-title h1 {
    font-size: 1.75rem;
    font-weight: 700;
}

.page-title p {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin-top: 0.25rem;
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.75rem;
    font-family: var(--font-heading);
    font-weight: 700;
    color: #ffffff;
    margin-top: 0.25rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-icon.primary { background-color: rgba(103, 61, 230, 0.15); color: var(--color-primary); }
.stat-icon.success { background-color: rgba(16, 185, 129, 0.15); color: var(--color-success); }
.stat-icon.warning { background-color: rgba(245, 158, 11, 0.15); color: var(--color-warning); }
.stat-icon.info { background-color: rgba(59, 130, 246, 0.15); color: var(--color-info); }

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

.badge-new { background-color: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-contacted { background-color: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-proposal { background-color: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.badge-won { background-color: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-lost { background-color: rgba(239, 68, 68, 0.15); color: #f87171; }

/* Table Styling */
.table-container {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table th {
    padding: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--color-border);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    vertical-align: middle;
}

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

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

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    transform: translateY(20px);
    transition: var(--transition-smooth);
}
.modal-overlay.active .modal-content {
    transform: translateY(0);
}

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

.modal-close {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
}
.modal-close:hover {
    color: #ffffff;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: var(--color-surface);
    border-left: 4px solid var(--color-primary);
    box-shadow: var(--shadow-lg);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-sm);
    color: #ffffff;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 250px;
    animation: slideIn 0.3s ease forwards;
}

.toast.success { border-left-color: var(--color-success); }
.toast.danger { border-left-color: var(--color-danger); }
.toast.warning { border-left-color: var(--color-warning); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Glassmorphism Login Page */
.login-container {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 1.5rem;
    background: radial-gradient(circle at 10% 20%, rgba(103, 61, 230, 0.15) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(0, 210, 196, 0.1) 0%, transparent 40%),
                var(--color-bg);
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
}

.login-logo {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 2rem;
    color: #ffffff;
}
.login-logo span {
    color: var(--color-primary);
}

/* Activity Log list */
.activity-list {
    list-style: none;
}
.activity-item {
    border-bottom: 1px solid var(--color-border);
    padding: 0.85rem 0;
}
.activity-item:last-child {
    border-bottom: none;
}
.activity-meta {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* Responsive Design Adjustments */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 1.5rem;
    }
}
