:root {
    --primary: #2AABE2;
    --primary-light: #5BC4ED;
    --primary-dark: #1E8FBF;
    --secondary: #F5921B;
    --secondary-light: #F9AD4A;
    --secondary-dark: #D97B0E;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --background: #f8fafb;
    --surface: #ffffff;
    --text: #1e293b;
    --text-muted: #6B7280;
    --border: #e2e8f0;
    --radius: 16px;
    --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-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

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

body {
    background-color: var(--background);
    color: var(--text);
    line-height: 1.5;
}

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

.sidebar {
    width: 260px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
}

/* Typography */
h1, h2, h3 {
    font-weight: 700;
    color: #0f172a;
}

.title-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Components */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    gap: 0.5rem;
}

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

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

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #e0f4fd; color: #1E8FBF; }

/* Form */
.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
}

input, select, textarea {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(42, 171, 226, 0.1);
}

/* Progress Bar */
.progress-wrapper {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
}

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

.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Sidebar Nav */
.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.nav-link.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(42, 171, 226, 0.25);
}

.nav-link i {
    width: 20px;
    font-size: 1.1rem;
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-muted);
}

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

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

.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card .icon-box {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.quick-action-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.quick-action-item:hover {
    background: white;
    border-color: var(--primary);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.quick-action-item i {
    width: 32px;
    font-size: 1.1rem;
}

.goal-card {
    background: linear-gradient(135deg, #2AABE2, #F5921B);
    border-radius: var(--radius);
    padding: 1.5rem;
    color: white;
    margin-top: 1rem;
    position: relative;
    box-shadow: 0 10px 20px -5px rgba(42, 171, 226, 0.4);
}

.avatar-initials {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--primary-light);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

@media (max-width: 1024px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
}

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

/* DataTables Custom Styling */
.dataTables_wrapper {
    font-size: 0.875rem;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 1.25rem;
}

.dataTables_wrapper .dataTables_length select {
    padding: 0.4rem 2rem 0.4rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    width: auto;
    display: inline-block;
}

.dataTables_wrapper .dataTables_filter input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    width: 220px;
    transition: border-color 0.2s;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(42, 171, 226, 0.1);
}

.dataTables_wrapper .dataTables_info {
    color: var(--text-muted);
    font-size: 0.8rem;
    padding-top: 1rem;
}

.dataTables_wrapper .dataTables_paginate {
    padding-top: 1rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 0.4rem 0.75rem;
    margin: 0 2px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: white;
    color: var(--text) !important;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 0.8rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--background) !important;
    border-color: var(--primary);
    color: var(--primary) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary) !important;
    border-color: var(--primary);
    color: white !important;
    font-weight: 600;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.dataTables_wrapper .dt-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.dataTables_wrapper .dt-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

table.datatable thead .sorting:after,
table.datatable thead .sorting_asc:after,
table.datatable thead .sorting_desc:after {
    font-size: 0.6rem;
    margin-left: 0.5rem;
    opacity: 0.5;
}

table.dataTable.no-footer {
    border-bottom: none;
}
