@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

:root {
    --primary-color: #4f46e5;
    /* Modern Indigo */
    --secondary-color: #6366f1;
    --bg-color: #f3f4f6;
    --text-color: #1f2937;
    --sidebar-bg: #111827;
    --sidebar-text: #9ca3af;
    --card-bg: #ffffff;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: white;
    padding: 20px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.sidebar h2 {
    color: white;
    font-size: 20px;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar a {
    color: var(--sidebar-text);
    text-decoration: none;
    padding: 12px 15px;
    margin-bottom: 5px;
    border-radius: 8px;
    transition: all 0.3s;
    font-size: 15px;
    display: block;
}

.sidebar a:hover,
.sidebar a.active {
    background-color: #374151;
    color: white;
}

/* Main Content */
.main-content {
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
}

/* Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card h3 {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.card .number {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-color);
    margin-top: 5px;
}

/* Search Bar */
.search-box {
    background: white;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 10px;
}

.search-input {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}

.search-input:focus {
    border-color: var(--primary-color);
}

.search-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

/* Table */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background-color: #f9fafb;
    text-align: left;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    font-size: 12px;
    padding: 15px 20px;
    border-bottom: 1px solid #e5e7eb;
}

td {
    padding: 15px 20px;
    border-bottom: 1px solid #e5e7eb;
    color: #374151;
    font-size: 14px;
}

tr:hover {
    background-color: #f9fafb;
}

/* Status Badges */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background-color: #fee2e2;
    color: #b91c1c;
}

.badge-neutral {
    background-color: #f3f4f6;
    color: #374151;
}

.tr-expired {
    background-color: #fef2f2 !important;
}

.tr-today {
    background-color: #fffbeb !important;
}

/* Buttons */
.btn {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: 0.2s;
    display: inline-block;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-edit {
    background-color: var(--primary-color);
    color: white;
    margin-right: 5px;
}

.btn-delete {
    background-color: var(--danger-color);
    color: white;
}

.btn-delete:hover {
    opacity: 0.9;
}

/* Forms */
/* Dashboard Layout */
.dashboard-top {
    display: grid;
    grid-template-columns: 1fr 340px;
    /* Stats take space, chart is fixed smaller on right */
    gap: 25px;
    margin-bottom: 30px;
}

.chart-container {
    background: transparent;
    /* Transparent background */
    padding: 10px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.chart-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.chart-toggle-btn {
    background: rgba(229, 231, 235, 0.5);
    border: 1px solid rgba(209, 213, 219, 0.3);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 11px;
    cursor: pointer;
    font-weight: 600;
    color: #4b5563;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(4px);
}

.chart-toggle-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
    border-color: var(--primary-color);
}

.chart-toggle-btn:active {
    transform: translateY(0);
}

.chart-wrapper {
    position: relative;
    width: 100%;
    height: 180px;
    transition: opacity 0.3s;
}

.hidden-chart {
    display: none !important;
}

.chart-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 0 5px;
}

.form-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: border 0.3s;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
}

.form-actions {
    margin-top: 30px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Footer */
.main-footer {
    margin-top: 50px;
    padding: 20px 0;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
}

.main-footer p {
    margin: 5px 0;
}

/* Dashboard interactivity */
.card-link {
    text-decoration: none;
    transition: transform 0.2s;
}

.card-link:hover .card {
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        box-sizing: border-box;
        padding: 15px;
    }

    .sidebar h2 {
        margin-bottom: 20px;
    }

    .sidebar nav {
        display: flex;
        overflow-x: auto;
        gap: 5px;
        padding-bottom: 5px;
    }

    .sidebar a {
        white-space: nowrap;
        margin-bottom: 0;
    }

    .main-content {
        padding: 20px;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .table-container {
        overflow-x: auto;
    }
}