:root {
    --sidebar-width: 260px;
    --primary-color: #4e73df;
    --secondary-color: #858796;
    --success-color: #1cc88a;
    --info-color: #36b9cc;
    --warning-color: #f6c23e;
    --danger-color: #e74a3b;
    --dark-bg: #1a1c23;
    --sidebar-bg: #2c3e50;
    --main-bg: #f8f9fc;
    --text-main: #5a5c69;
    --card-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--main-bg);
    color: var(--text-main);
    min-height: 100vh;
}

.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: white;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.1);
}

.sidebar-menu {
    flex: 1;
    padding: 20px 0;
}

.sidebar-menu a {
    padding: 12px 25px;
    display: flex;
    align-items: center;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: 0.3s;
    font-size: 0.95rem;
}

.sidebar-menu a:hover, .sidebar-menu a.active {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left: 4px solid var(--primary-color);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 25px;
    width: calc(100% - var(--sidebar-width));
}

.top-bar {
    background: white;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    margin: -25px -25px 25px -25px;
    box-shadow: 0 .15rem 1.75rem 0 rgba(58,59,69,.15);
    position: sticky;
    top: 0;
    z-index: 990;
}

/* Dashboard Cards */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    padding: 20px;
    margin-bottom: 25px;
    border: none;
}

.card-header {
    border-bottom: 1px solid #e3e6f0;
    padding-bottom: 15px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 700;
}

/* Forms in Dashboard */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: .5rem;
    font-size: .85rem;
    font-weight: 700;
    color: #4e73df;
}

.form-control {
    display: block;
    width: 100%;
    padding: .5rem .75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #6e707e;
    background-color: #fff;
    border: 1px solid #d1d3e2;
    border-radius: .35rem;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: #bac8f3;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(78,115,223,.25);
}

/* Tables in Dashboard */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    background-color: #f8f9fc;
    color: var(--text-main);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    padding: 12px 15px;
    border-bottom: 2px solid #e3e6f0;
    text-align: left;
}

table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e3e6f0;
    font-size: 0.9rem;
}

table tr:hover {
    background-color: #f8f9fc;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: 0.2s;
}

.btn-primary { background: var(--primary-color); color: white; }
.btn-primary:hover { background: #2e59d9; }
.btn-success { background: var(--success-color); color: white; }
.btn-danger { background: var(--danger-color); color: white; }
.btn-info { background: var(--info-color); color: white; }

/* Filter Section */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    background: #f8f9fc;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

/* Stats Widgets */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    border-left: 4px solid var(--primary-color);
    border-radius: 5px;
    padding: 15px 20px;
    box-shadow: var(--card-shadow);
}

.stat-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #5a5c69;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
    backdrop-filter: blur(2px);
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    position: relative;
}

@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }
    .sidebar-header,
    .sidebar-menu a span,
    .sidebar-footer span,
    .sidebar-footer a span {
        display: none !important;
    }
    .sidebar-footer {
        padding: 15px 0 !important;
        justify-content: center !important;
    }
    .sidebar-footer a {
        margin: 0 !important;
        justify-content: center;
        width: 100%;
    }
    .main-content {
        margin-left: 70px;
        width: calc(100% - 70px);
    }
}
