/* ============================================
   OLOT IT PARK CRM - MODERN STYLES
   ============================================ */

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --secondary: #64748b;
    --success: #10b981;
    --info: #06b6d4;
    --warning: #f59e0b;
    --danger: #ef4444;
    --light: #f8fafc;
    --dark: #1e293b;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --card-bg: #ffffff;
    --body-bg: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --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);
    --radius: 12px;
    --radius-lg: 16px;
}

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

body {
    background: var(--body-bg);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================
   WRAPPER LAYOUT
   ============================================ */

.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
    min-width: 260px;
    max-width: 260px;
    min-height: 100vh;
    background: var(--sidebar-bg);
    color: #fff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1001;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px 20px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.2), rgba(6, 182, 212, 0.1));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.02em;
}

.sidebar-header h3 i {
    color: var(--info);
}

.components {
    padding: 16px 0;
    flex: 1;
    overflow-y: auto;
}

.components li {
    list-style: none;
    margin: 2px 0;
}

.sidebar a {
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    font-weight: 500;
    font-size: 0.95rem;
}

.sidebar a:hover {
    background: var(--sidebar-hover);
    color: #fff;
    border-left-color: var(--primary);
}

.components li.active > a {
    background: var(--sidebar-hover);
    color: #fff;
    border-left-color: var(--primary);
}

.components li ul {
    padding-left: 0;
    background: rgba(0, 0, 0, 0.2);
}

.components li ul li a {
    padding-left: 52px;
    font-size: 0.9rem;
    font-weight: 400;
    background: transparent;
}

.components li ul li a:hover {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar .collapse.show {
    background: rgba(0, 0, 0, 0.15);
}

/* Sidebar Badge */
.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
}

/* ============================================
   CONTENT AREA
   ============================================ */

#content {
    width: 100%;
    min-height: 100vh;
    margin-left: 260px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--body-bg);
}

#content.active {
    margin-left: 0;
}

/* ============================================
   NAVBAR
   ============================================ */

.navbar {
    background: var(--card-bg) !important;
    border-radius: 0;
    box-shadow: var(--shadow);
    padding: 14px 24px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    font-weight: 700;
    color: var(--text-primary) !important;
}

#sidebarCollapse {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px 14px;
    border-radius: 10px;
    transition: all 0.2s ease;
}

#sidebarCollapse:hover {
    background: var(--light);
    color: var(--primary);
}

.navbar .dropdown-menu {
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
    padding: 8px 0;
    margin-top: 10px;
}

.navbar .dropdown-item {
    padding: 10px 20px;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.navbar .dropdown-item:hover {
    background: var(--light);
    color: var(--primary);
}

.navbar .dropdown-item i {
    margin-right: 10px;
    color: var(--text-secondary);
}

.nav-link {
    font-weight: 500;
    color: var(--text-primary) !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link .badge {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
}

/* ============================================
   CARDS
   ============================================ */

.card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: var(--card-bg);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    font-weight: 600;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h5 {
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 24px;
}

/* ============================================
   STAT CARDS
   ============================================ */

.stat-card {
    border: none;
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

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

.stat-card h6 {
    font-size: 0.875rem;
    font-weight: 700;
    color: #151515 !important;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.stat-card h3 {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0;
    color: #ffffff !important;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.stat-card small {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.95) !important;
    font-weight: 600;
}

.stat-card .icon-circle {
    background: rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.stat-card small a {
    color: rgba(255, 255, 255, 0.95);
    text-decoration: underline;
    font-weight: 600;
}

.stat-card small a:hover {
    color: #ffffff;
}

/* Stat Card Backgrounds */
.bg-gradient-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.bg-gradient-info {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.bg-gradient-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.bg-gradient-secondary {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}

/* Progress Bar in Stat Cards */
.stat-progress {
    margin-top: 16px;
}

.stat-progress .progress {
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
}

.stat-progress .progress-bar {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
}

/* ============================================
   CHARTS & VISUALIZATIONS
   ============================================ */

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.mini-chart {
    height: 60px;
    width: 100%;
    opacity: 0.6;
}

/* Attendance Stats */
.attendance-stat {
    padding: 20px;
    border-radius: var(--radius);
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.attendance-stat:hover {
    transform: scale(1.02);
}

.attendance-stat h4 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.attendance-stat small {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
}

.attendance-stat.present {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
    border-color: #86efac;
}

.attendance-stat.absent {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border-color: #fca5a5;
}

.attendance-stat.late {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border-color: #fcd34d;
}

/* ============================================
   TABLES
   ============================================ */

.table {
    margin-bottom: 0;
    font-size: 0.95rem;
}

.table thead th {
    font-weight: 700;
    background: #f8fafc;
    border-bottom: 2px solid var(--border-color);
    padding: 14px 16px;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

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

.table tbody tr:hover {
    background: #f8fafc;
}

.table-sm th,
.table-sm td {
    padding: 12px 14px;
}

/* Table Actions */
.table-actions {
    display: flex;
    gap: 8px;
}

.table-actions .btn {
    padding: 6px 10px;
    font-size: 0.85rem;
}

/* ============================================
   BADGES
   ============================================ */

.badge {
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
}

.badge-soft-success {
    background: #dcfce7;
    color: #166534;
}

.badge-soft-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-soft-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-soft-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-soft-secondary {
    background: #f1f5f9;
    color: #475569;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 10px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    border: none;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: none;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.3);
}

.btn-info {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    border: none;
    color: white;
}

.btn-info:hover {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    border: none;
}

.btn-outline-primary {
    border: 2px solid #4f46e5;
    color: #4f46e5;
    background: transparent;
}

.btn-outline-primary:hover {
    background: #4f46e5;
    border-color: #4f46e5;
}

/* ============================================
   FORMS
   ============================================ */

.form-control,
.form-select {
    border-radius: 10px;
    border: 2px solid var(--border-color);
    padding: 12px 16px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.form-floating > .form-control {
    padding-top: 1.625rem;
    padding-bottom: 0.625rem;
}

/* Search Input */
.search-box {
    position: relative;
}

.search-box .form-control {
    padding-left: 44px;
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
    border: none;
    border-radius: var(--radius);
    padding: 16px 20px;
    font-weight: 500;
}

.alert-success {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
}

.alert-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
}

.alert-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

.alert-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
}

/* ============================================
   OVERLAY
   ============================================ */

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    backdrop-filter: blur(4px);
}

.sidebar-overlay.active {
    display: block;
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    padding: 40px 30px;
    text-align: center;
    color: white;
}

.login-header h3 {
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 1.5rem;
}

.login-header p {
    opacity: 0.9;
    margin: 0;
}

.login-body {
    padding: 40px 30px;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -80px auto 20px;
    box-shadow: var(--shadow-lg);
    font-size: 2.5rem;
    color: var(--primary);
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
    gap: 6px;
}

.page-link {
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.page-link:hover {
    background: var(--light);
    color: var(--primary);
}

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

.page-item.disabled .page-link {
    opacity: 0.5;
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

.fade-in {
    animation: fadeIn 0.5s ease;
}

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.pulse-animation {
    animation: pulse 2s infinite;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 991px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        margin-left: -280px;
        height: 100vh;
        z-index: 1050;
        width: 280px;
        max-width: 280px;
        min-width: 280px;
    }

    .sidebar.mobile-active {
        margin-left: 0;
        box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    }

    .sidebar.active {
        margin-left: -280px;
    }

    #content {
        margin-left: 0;
        width: 100%;
        padding-top: 0;
    }

    #content.active {
        margin-left: 0;
    }
    
    .navbar {
        padding: 10px 15px;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    #sidebarCollapse {
        padding: 8px 12px;
    }

    .stat-card h3 {
        font-size: 1.8rem;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-card .icon-circle {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
    
    .chart-container {
        height: 250px;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 10px 12px;
    }
    
    .navbar-brand span {
        display: none;
    }
    
    .d-none.d-sm-inline {
        display: none !important;
    }

    #content {
        padding: 12px;
    }

    .card-header {
        padding: 14px 16px;
    }
    
    .card-header h5 {
        font-size: 1rem;
    }

    .card-body {
        padding: 16px;
    }

    .stat-card {
        padding: 18px;
        margin-bottom: 12px;
    }

    .stat-card h3 {
        font-size: 1.6rem;
    }
    
    .stat-card h6 {
        font-size: 0.75rem;
    }
    
    .stat-card small {
        font-size: 0.8rem;
    }
    
    .stat-card .icon-circle {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .table-responsive {
        border-radius: var(--radius);
    }
    
    .table thead th {
        font-size: 0.7rem;
        padding: 10px 12px;
    }
    
    .table tbody td {
        font-size: 0.9rem;
        padding: 10px 12px;
    }

    .attendance-stat h4 {
        font-size: 1.4rem;
    }
    
    .attendance-stat small {
        font-size: 0.65rem;
    }
    
    .attendance-stat {
        padding: 15px 10px;
    }

    .btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
    
    .btn-sm {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .chart-container {
        height: 200px;
    }
    
    .fade-in {
        animation: none;
    }
}

@media (max-width: 576px) {
    .sidebar {
        width: 260px;
        max-width: 260px;
        min-width: 260px;
        margin-left: -260px;
    }
    
    .stat-card {
        margin-bottom: 12px;
        padding: 16px;
    }
    
    .stat-card h3 {
        font-size: 1.4rem;
    }
    
    .stat-card .icon-circle {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .login-body {
        padding: 24px 16px;
    }
    
    .login-header {
        padding: 30px 20px 50px;
    }
    
    .login-logo {
        width: 70px;
        height: 70px;
        font-size: 2rem;
        margin-top: -70px;
    }

    .table-actions {
        flex-direction: row;
        gap: 4px;
    }

    .table-actions .btn {
        width: auto;
        padding: 4px 8px;
    }
    
    .attendance-stat h4 {
        font-size: 1.2rem;
    }
    
    .attendance-stat small {
        font-size: 0.6rem;
    }
    
    .row {
        --bs-gutter-x: 0.75rem;
    }
    
    .col-4 {
        padding-left: 6px;
        padding-right: 6px;
    }
    
    .chart-container {
        height: 180px;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-gradient {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-hover {
    transition: all 0.3s ease;
}

.shadow-hover:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-3px);
}

.icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.bg-light-primary { background: #eef2ff; color: #4f46e5; }
.bg-light-success { background: #ecfdf5; color: #10b981; }
.bg-light-info { background: #ecfeff; color: #06b6d4; }
.bg-light-warning { background: #fffbeb; color: #f59e0b; }
.bg-light-danger { background: #fef2f2; color: #ef4444; }

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--body-bg);
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
