/* Main Styles */
:root {
    --primary-color: #4e73df;
    --secondary-color: #858796;
    --success-color: #1cc88a;
    --info-color: #36b9cc;
    --warning-color: #f6c23e;
    --danger-color: #e74a3b;
    --light-color: #f8f9fc;
    --dark-color: #5a5c69;
    --bg-color: #f3f4f6; /* Light gray background similar to screenshot */
    --sidebar-width: 250px;
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
    color: #333;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: var(--primary-color); /* Or a gradient */
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-logo i {
    margin-right: 10px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-color);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #d1d3e2;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 16px;
    transition: border-color 0.2s;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn {
    display: inline-block;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    padding: 12px 20px;
    font-size: 16px;
    line-height: 1.5;
    border-radius: 5px;
    transition: color 0.15s, background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
    cursor: pointer;
    border: none;
}

.btn-primary {
    color: #fff;
    background-color: var(--primary-color);
}
.btn-primary:hover {
    background-color: #2e59d9;
}
.btn-block {
    display: block;
    width: 100%;
}

/* Layout Structure */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

/* Sidebar */
#sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: #fff; /* White sidebar as per screenshot */
    color: var(--dark-color);
    transition: all 0.3s;
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
    min-height: 100vh;
}

#sidebar .sidebar-header {
    padding: 20px;
    background: #fff;
    display: flex;
    align-items: center;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.2rem;
    border-bottom: 1px solid #eee;
}
#sidebar .sidebar-header i {
    margin-right: 10px;
    font-size: 1.5rem;
}

#sidebar ul.components {
    padding: 20px 0;
}

#sidebar ul li {
    padding: 5px 15px;
}

#sidebar ul li a {
    padding: 12px 15px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    color: var(--secondary-color);
    border-radius: 8px;
    transition: 0.2s;
}

#sidebar ul li a:hover {
    color: var(--primary-color);
    background: #f0f4ff; /* Light blue hover */
    text-decoration: none;
}

#sidebar ul li.active > a {
    color: var(--primary-color);
    background: #eef2ff; /* Selected state background */
    font-weight: bold;
}
#sidebar ul li a i {
    margin-right: 15px;
    width: 20px; /* Fixed width for icons alignment */
    text-align: center;
}

/* Content Area */
#content {
    width: 100%;
    padding: 0;
    min-height: 100vh;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

/* Top Navbar */
.navbar {
    padding: 15px 30px; /* Match padding with content */
    background: #fff;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,.04);
}

.navbar-search {
    position: relative;
}
.navbar-search input {
    padding: 10px 15px 10px 40px;
    border-radius: 20px;
    border: 1px solid #eee;
    background: #f8f9fc;
    width: 300px;
}
.navbar-search i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
}

.navbar-user {
    display: flex;
    align-items: center;
}
.user-info {
    text-align: right;
    margin-right: 15px;
}
.user-name {
    font-weight: bold;
    color: var(--dark-color);
    display: block;
}
.user-role {
    font-size: 0.8rem;
    color: var(--secondary-color);
}
.user-avatar {
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

/* Main Content Container */
.main-content {
    padding: 30px;
    flex-grow: 1;
}

/* Cards */
.card {
    background: #fff;
    border-radius: 12px; /* Rounded corners */
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.1); /* Softer shadow */
    margin-bottom: 30px;
    border: none; /* Remove default border */
}

.card-header {
    padding: 20px 25px;
    background-color: #fff;
    border-bottom: 1px solid #f0f2f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0; /* Rounded top corners only */
}
.card-header h3, .card-header h4, .card-header h5, .card-header h6 {
    margin: 0;
    color: var(--dark-color);
    font-weight: bold;
}

.card-body {
    padding: 25px;
}

/* Dashboard Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}
.stat-card {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.1);
    display: flex;
    align-items: center;
}
.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-right: 20px;
    flex-shrink: 0;
}
.stat-icon.blue { background-color: #eef2ff; color: var(--primary-color); }
.stat-icon.green { background-color: #e6fffa; color: var(--success-color); }
.stat-icon.purple { background-color: #f3e8ff; color: #805ad5; }
.stat-icon.orange { background-color: #fffaf0; color: #dd6b20; }

.stat-details h4 {
    margin: 0 0 10px;
    color: var(--secondary-color);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.stat-details .count {
    margin: 0;
    font-size: 2rem;
    font-weight: bold;
    color: var(--dark-color);
    line-height: 1.2;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}
.table {
    width: 100%;
    margin-bottom: 1rem;
    color: #858796;
    border-collapse: collapse; /* Ensure borders collapse */
}
.table th,
.table td {
    padding: 15px;
    vertical-align: middle;
    border-top: 1px solid #e3e6f0;
}
.table thead th {
    vertical-align: bottom;
    border-bottom: 2px solid #e3e6f0;
    background-color: #f8f9fc;
    color: var(--secondary-color);
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    border-top: none;
}
.table tbody tr:hover {
    background-color: #f8f9fc;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 8px;
}
.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}
.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

/* Utility Classes */
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-3 { margin-top: 1rem; }
.mb-3 { margin-bottom: 1rem; }
.mr-2 { margin-right: 0.5rem; }

.badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
}
.badge-success { background: var(--success-color); color: white; }
.badge-warning { background: var(--warning-color); color: #333; }
.badge-danger { background: var(--danger-color); color: white; }