@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4361ee;
    --primary-light: #4895ef;
    --secondary-color: #3f37c9;
    --success-color: #4cc9f0;
    --success-dark: #4895ef;
    --danger-color: #f72585;
    --warning-color: #fca311;
    --dark-color: #1e1e2e;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --text-primary: #2b2d42;
    --text-secondary: #8d99ae;
    --sidebar-width: 260px;
    --header-height: 60px;
    --card-radius: 12px;
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--light-bg);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--white);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.sidebar-header {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 1px;
}

.sidebar nav {
    padding: 20px 0;
    flex: 1;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    padding: 15px 30px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    border-left: 4px solid transparent;
}

.sidebar nav a i {
    margin-right: 15px;
    font-size: 1.2rem;
    width: 25px;
    text-align: center;
}

.sidebar nav a:hover, .sidebar nav a.active {
    color: var(--primary-color);
    background-color: rgba(67, 97, 238, 0.05);
    border-left-color: var(--primary-color);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px;
    transition: var(--transition);
    width: calc(100% - var(--sidebar-width));
}

.main-content header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--dark-color);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--white);
    padding: 25px;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 20px;
}

.stat-card.blue .stat-icon { background-color: rgba(67, 97, 238, 0.1); color: var(--primary-color); }
.stat-card.green .stat-icon { background-color: rgba(76, 201, 240, 0.1); color: var(--success-color); }
.stat-card.red .stat-icon { background-color: rgba(247, 37, 133, 0.1); color: var(--danger-color); }
.stat-card.yellow .stat-icon { background-color: rgba(252, 163, 17, 0.1); color: var(--warning-color); }

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
    font-weight: 500;
}

.stat-info p {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
}

/* Cards & Tables */
.card {
    background: var(--white);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 30px;
    margin-bottom: 30px;
}

.card h3 {
    font-size: 1.2rem;
    color: var(--dark-color);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead th {
    text-align: left;
    padding: 15px 20px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 2px solid #f0f0f0;
}

table tbody td {
    padding: 15px 20px;
    color: var(--text-primary);
    border-bottom: 1px solid #f9f9f9;
    font-size: 0.95rem;
}

table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Badges */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.badge-pending { background-color: rgba(252, 163, 17, 0.1); color: var(--warning-color); }
.badge-paid { background-color: rgba(76, 201, 240, 0.1); color: #00b4d8; }
.badge-late { background-color: rgba(247, 37, 133, 0.1); color: var(--danger-color); }

/* Forms */
.form-row {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
}

.form-group {
    flex: 1;
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
}

input[type="text"],
input[type="number"],
input[type="date"],
select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
    background-color: #fcfcfc;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
    background-color: var(--white);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 0.95rem;
    gap: 8px;
}

.btn-primary, button[type="submit"] {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover, button[type="submit"]:hover {
    background-color: var(--secondary-color);
    box-shadow: 0 4px 10px rgba(67, 97, 238, 0.3);
}

.btn-success {
    background-color: #2ecc71;
    color: white;
}
.btn-success:hover { background-color: #27ae60; }

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}
.btn-warning:hover { background-color: #e69500; }

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.alert i { margin-right: 10px; }

.alert-success { background-color: rgba(76, 201, 240, 0.1); color: #0077b6; border: 1px solid rgba(76, 201, 240, 0.2); }
.alert-error { background-color: rgba(247, 37, 133, 0.1); color: var(--danger-color); border: 1px solid rgba(247, 37, 133, 0.2); }

/* Responsive */
@media (max-width: 992px) {
    :root {
        --sidebar-width: 80px;
    }
    .sidebar-header h2 { display: none; }
    .sidebar nav a span { display: none; }
    .sidebar nav a { justify-content: center; padding: 20px; }
    .sidebar nav a i { margin: 0; font-size: 1.5rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .main-content { margin-left: 0; padding: 20px; width: 100%; }
    .sidebar { transform: translateX(-100%); width: 260px; }
    .sidebar.active { transform: translateX(0); }
    .stats-grid { grid-template-columns: 1fr; }
    .form-row { flex-direction: column; gap: 0; }
}
