:root {
    /* Colors */
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #ec4899;
    --bg-dark: #0f172a;
    --bg-sidebar: #1e293b;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;

    /* Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);

    /* Transitions */
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
}

/* Layout
*/
.app-container
{
    display: flex;
    height: 100vh;
}

/* Sidebar
*/
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid
var(--border-color);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.sidebar-header
{
    padding: var(--space-md);
    border-bottom: 1px solid
var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo-icon {
    font-size: 1.8rem;
}

.sidebar-nav
{
    flex: 1;
    padding: var(--space-md) 0;
    overflow-y: auto;
}

.sidebar-nav
ul {
    list-style: none;
}

.nav-item a
{
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-item
a:hover,
.nav-item.active
a {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.nav-item
ion-icon {
    font-size: 1.4rem;
}

.sidebar-footer
{
    padding: var(--space-md);
    border-top: 1px solid var(--border-color);
}

.user-profile
{
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.user-profile
img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
}

.user-info
{
    display: flex;
    flex-direction: column;
}

.user-info
.name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-info
.role {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: linear-gradient(135deg,
var(--bg-dark) 0%, #131c31 100%);
}

.top-bar {
    height: 70px;
    padding: 0 var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid
var(--border-color);
}

.search-bar
{
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    background-color: rgba(255, 255, 255,
0.05);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    width: 300px;
}

.search-bar
input {
    background: none;
    border: none;
    color: var(--text-main);
    width: 100%;
    outline: none;
}

.search-bar
ion-icon {
    color: var(--text-muted);
}

.top-actions
{
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

/* Buttons
*/
.btn-primary
{
    background: linear-gradient(135deg,
var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover
{
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-secondary
{
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover
{
    border-color: var(--text-main);
    color: var(--text-main);
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    position: relative;
    padding: 0.5rem;
    border-radius: var(--radius-full);
    transition: var(--transition);
}

.icon-btn:hover
{
    background-color: rgba(255, 255, 255,
0.05);
    color: var(--text-main);
}

.badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--danger);
    color: white;
    font-size: 0.7rem;
    padding: 2px 5px;
    border-radius: var(--radius-full);
}

/* View
Container */
.view-container
{
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
}

.page-header
{
    margin-bottom: var(--space-lg);
}

.page-title
{
    font-size: 1.8rem;
    font-weight: 700;
}

/*
Dashboard Grid */
.dashboard-grid
{
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.stat-card
{
    background-color: var(--bg-card);
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    position: relative;
    overflow: hidden;
}

.stat-card::before
{
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg,
var(--primary-color), var(--secondary-color));
}

.stat-title
{
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.stat-value
{
    font-size: 2rem;
    font-weight: 700;
}

.stat-trend
{
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.trend-up {
    color: var(--success);
}

.trend-down
{
    color: var(--danger);
}

.charts-grid
{
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.chart-card
{
    background-color: var(--bg-card);
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    height: 300px;
    /* Mock height for charts */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.chart-header
{
    width: 100%;
    margin-bottom: auto;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Tables
*/
.table-container
{
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    border-bottom: 1px solid
var(--border-color);
}

th {
    background-color: rgba(0, 0, 0, 0.2);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
}

tr:last-child
td {
    border-bottom: none;
}

tr:hover {
    background-color: rgba(255, 255, 255,
0.02);
}

.status-badge
{
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
}

.status-lead
{
    background-color: rgba(99, 102, 241, 0.2);
    color: #818cf8;
}

.status-client
{
    background-color: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.status-prospect
{
    background-color: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

/* Modal */
.modal-overlay
{
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    background-color: var(--bg-card);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

@keyframes
slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header
{
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.close-modal
{
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.hidden {
    display: none !important;
}

.form-group
{
    margin-bottom: var(--space-md);
}

.form-group
label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-group
input,
.form-group
select {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-family: inherit;
    outline: none;
}

.form-group
input:focus,
.form-group
select:focus {
    border-color: var(--primary-color);
}

.form-actions
{
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
}

/* SVG
Charts Placeholders */
.bar-chart-placeholder
{
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 150px;
    width: 100%;
    padding: 0 20px;
}

.bar {
    flex: 1;
    background: linear-gradient(to top,
var(--primary-color), var(--secondary-color));
    border-radius: 4px 4px 0 0;
    opacity: 0.8;
    transition: height 1s ease;
    height: 0;
    /* Animated by JS */
}

.donut-chart-container
{
    position: relative;
    width: 150px;
    height: 150px;
}

svg.donut {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

circle.donut-ring
{
    fill: none;
    stroke: var(--bg-dark);
    stroke-width: 20;
}

circle.donut-segment
{
    fill: none;
    stroke-width: 20;
    stroke-dasharray: 0 100;
    /* Animated by JS */
    transition: stroke-dasharray 1s ease;
}