:root {
    --primary: #27aae1;
    --primary-dark: #1e8bb7;
    --accent: #f18022;
    --accent-hover: #d66d1a;
    --dark: #0F172A;
    --dark-light: #1E293B;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --white: #FFFFFF;
    --black: #000000;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-full: 9999px;

    --glass: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    
    --sidebar-width: 260px;
    --header-height: 70px;
}

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

body {
    background-color: var(--gray-100);
    color: var(--dark);
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

ul {
    list-style: none;
}

button, input, select, textarea {
    font: inherit;
    outline: none;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding-top: var(--header-height);
    transition: all 0.3s ease;
}

@media (max-width: 1024px) {
    .main-content {
        margin-left: 0;
    }
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--dark);
    color: var(--white);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

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

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 0.75rem;
    overflow-y: auto;
}

.nav-group {
    margin-bottom: 1.5rem;
}

.nav-label {
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--gray-500);
    letter-spacing: 0.05em;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius);
    color: var(--gray-400);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.nav-item:hover {
    color: var(--white);
    background-color: var(--dark-light);
}

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

.nav-item i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--dark-light);
}

.user-profile-sm {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background-color: var(--gray-300);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark);
    font-weight: 600;
}

.user-info-sm h4 {
    font-size: 0.875rem;
    font-weight: 600;
}

.user-info-sm p {
    font-size: 0.75rem;
    color: var(--gray-400);
}

/* Header */
.header {
    height: var(--header-height);
    background-color: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar-width);
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    transition: all 0.3s ease;
}

@media (max-width: 1024px) {
    .header {
        left: 0;
    }
}

.header-search {
    flex: 1;
    max-width: 400px;
}

.search-input-group {
    position: relative;
}

.search-input-group i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.search-input-group input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.75rem;
    background-color: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-full);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.icon-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    font-size: 1.25rem;
}

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

.badge-dot {
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background-color: var(--accent);
    border: 2px solid var(--white);
    border-radius: var(--radius-full);
}

/* Glassmorphism */
.glass-panel {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

.glass-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

/* Page Content */
.page-content {
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

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

.page-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
}

.page-title p {
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.stat-card {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

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

.stat-title {
    color: var(--gray-500);
    font-weight: 600;
    font-size: 0.875rem;
}

.stat-icon {
    width: 40px;
    height: 40px;
    background-color: var(--gray-100);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.stat-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

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

/* Grid Sections */
.sections-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
}

.card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

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

.card-title {
    font-size: 1rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
    flex: 1;
}

/* Tables */
.table-container {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1000px;
}

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

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: middle;
}

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

tr:hover td {
    background-color: var(--gray-100);
}

/* Badges */
.badge {
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-blue { background-color: #E0F2FE; color: #0369A1; }
.badge-orange { background-color: #FFEDD5; color: #C2410C; }
.badge-green { background-color: #DCFCE7; color: #15803D; }
.badge-red { background-color: #FEE2E2; color: #B91C1C; }

/* Status Indicators */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.8125rem;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
}

.dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.dot-success { background-color: var(--success); }
.dot-success::after { background-color: var(--success); }
.dot-warning { background-color: var(--warning); }
.dot-warning::after { background-color: var(--warning); }
.dot-danger { background-color: var(--danger); }
.dot-danger::after { background-color: var(--danger); }

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(2.5); opacity: 0; }
}

/* Client Row Hover */
.client-row {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.client-row:hover {
    background-color: rgba(39, 170, 225, 0.04) !important;
    transform: scale(1.005);
    box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.05);
    z-index: 10;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

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

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

.btn-accent {
    background-color: var(--accent);
    color: var(--white);
}

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

.btn-secondary {
    background-color: var(--white);
    border-color: var(--gray-200);
    color: var(--dark);
}

.btn-secondary:hover {
    background-color: var(--gray-100);
}

.btn-dark {
    background-color: var(--dark);
    color: var(--white);
}

.btn-icon {
    padding: 0.625rem;
}

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

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 0.625rem 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background-color: var(--white);
    transition: border-color 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary);
}

/* Filters */
.filter-bar {
    background-color: var(--white);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filter-item label {
    margin-bottom: 0;
    font-size: 0.75rem;
    color: var(--gray-500);
}

.filter-select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background-color: var(--gray-100);
    font-weight: 600;
    color: var(--dark);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748B'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal {
    background-color: var(--white);
    width: 100%;
    max-width: 500px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

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

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.animate-fade { animation: fadeIn 0.4s ease-out; }
.animate-slide-up { animation: slideUp 0.4s ease-out; }

/* Login Page Styles */
.auth-page {
    background: linear-gradient(135deg, var(--dark) 0%, var(--primary) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    background-color: var(--white);
    width: 100%;
    max-width: 440px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.auth-title h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.auth-title p {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--gray-400);
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
}

.auth-divider::before, .auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background-color: var(--gray-200);
}

.remember-forgot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.forgot-link {
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 600;
}

.forgot-link:hover {
    text-decoration: underline;
}

/* Pagination */
.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
    gap: 0.25rem;
    justify-content: center;
}

.page-item .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    background-color: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    color: var(--gray-600);
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.page-item:hover .page-link {
    background-color: var(--gray-100);
    border-color: var(--gray-300);
    color: var(--primary);
}

.page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.page-item.disabled .page-link {
    background-color: var(--gray-100);
    color: var(--gray-400);
    cursor: not-allowed;
    border-color: var(--gray-200);
}

.pagination svg {
    width: 16px;
    height: 16px;
}

/* Skeleton Loaders */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1.25rem;
    margin-bottom: 0.5rem;
    width: 100%;
}

.skeleton-value {
    height: 2.5rem;
    width: 60%;
    margin: 0.5rem 0;
}

.skeleton-chart {
    height: 300px;
    width: 100%;
}
