:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #ffffff;
    --sidebar-active-bg: #334155;
    --main-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--main-bg);
    color: var(--text-main);
}

.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 2rem 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff;
}

.logo .material-icons-round {
    font-size: 2rem;
    color: var(--primary-color);
}

.logo-text {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.025em;
}

.sidebar-nav {
    flex: 1;
    padding: 0 1rem;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.sidebar-nav a:hover {
    background-color: var(--sidebar-active-bg);
    color: #fff;
}

.sidebar-nav li.active > a {
    background-color: var(--primary-color);
    color: #fff;
}

/* Submenu Styles */
.has-submenu .submenu {
    display: none;
    list-style: none;
    padding-left: 2.75rem;
    margin-top: 0.25rem;
}

.has-submenu.open .submenu {
    display: block;
}

.has-submenu .submenu a {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    color: var(--sidebar-text);
}

.has-submenu .submenu a:hover,
.has-submenu .submenu li.active a {
    color: #fff;
    background: transparent;
}

.menu-arrow {
    margin-left: auto;
    font-size: 1.25rem !important;
    transition: transform 0.2s;
}

.has-submenu.open .menu-arrow {
    transform: rotate(90deg);
}


.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--sidebar-active-bg);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-logout:hover {
    color: #fff;
}

/* Main Content Styling */
.main-content {
    flex: 1;
    margin-left: 260px;
}

.topbar {
    height: 64px;
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 90;
}

.breadcrumb {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.user-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.avatar {
    width: 36px;
    height: 36px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    overflow: hidden !important;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.05);
    position: relative;
    z-index: 1; /* Force clipping */
    -webkit-mask-image: -webkit-radial-gradient(white, black); /* Force clipping on Safari */
    mask-image: radial-gradient(white, black);
}

.avatar img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
    border-radius: 50% !important;
}

.content-wrapper {
    padding: 2rem;
}

.page-title {
    margin-bottom: 2rem;
}

.page-title h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.page-title p {
    color: var(--text-muted);
}

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

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-info h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.stat-info p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Data Table Section */
.data-section {
    background: var(--card-bg);
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.section-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.section-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.875rem;
    border: none;
    transition: background 0.2s;
}

.btn-secondary {
    background: #f1f5f9;
    color: var(--text-main);
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.table-container {
    width: 100%;
    overflow-x: auto;
}

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

th {
    text-align: left;
    padding: 1rem 1.5rem;
    background: #f8fafc;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

tr:last-child td {
    border-bottom: none;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-badge.processing {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.status-badge.pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.text-muted {
    color: var(--text-muted);
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: #fff;
    width: 100%;
    max-width: 500px;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-header {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.close-modal {
    cursor: pointer;
    color: var(--text-muted);
}

/* Form Styling */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.modal-footer {
    margin-top: 2rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger-outline {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}

.btn-danger-outline:hover {
    background: var(--danger);
    color: #fff;
}

/* Multiple Selection / Areas */
.area-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.area-chip {
    padding: 0.25rem 0.5rem;
    background: #f1f5f9;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
