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

:root {
    --primary-blue: #1d4ed8; /* Blue for buttons and active states */
    --primary-blue-hover: #1e40af;
    --sidebar-bg: #0b1a30; /* Dark blue sidebar */
    --sidebar-text: #94a3b8;
    --sidebar-text-hover: #ffffff;
    --sidebar-active-bg: #1d4ed8;
    --bg-light: #f3f4f6; /* Dashboard background */
    --card-bg: #ffffff;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    
    --success-color: #10b981;
    --success-bg: #d1fae5;
    --danger-color: #ef4444;
    --danger-bg: #fee2e2;
    --warning-color: #f59e0b;
    --warning-bg: #fef3c7;
    --info-color: #3b82f6;
    --info-bg: #dbeafe;
}

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

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* -------------------------------------
   LOGIN PAGE SPLIT DESIGN
-------------------------------------- */
.split-login-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

.login-left {
    flex: 1;
    background-color: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.login-left::after {
    content: '';
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 300px;
    background: radial-gradient(ellipse at bottom, rgba(29, 78, 216, 0.4) 0%, transparent 70%);
    z-index: 0;
}

.login-left-content {
    z-index: 1;
    max-width: 500px;
}

.login-left h1 {
    font-weight: 700;
    font-size: 2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.login-left p {
    color: var(--sidebar-text);
    font-size: 1rem;
    line-height: 1.5;
}

.login-right {
    flex: 1;
    background-color: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-card {
    background: var(--card-bg);
    border-radius: 0.75rem;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.login-card h2 {
    font-weight: 700;
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 0.25rem;
    color: var(--text-dark);
}

.login-card p.subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

.form-control {
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    border-radius: 0.35rem;
    color: var(--text-dark);
    font-size: 0.9rem;
    background-color: #f9fafb;
}

.form-control:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1);
    background-color: #ffffff;
}

.btn-primary {
    background-color: var(--primary-blue);
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 0.35rem;
    font-size: 0.9rem;
    font-weight: 500;
    width: 100%;
}

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

/* -------------------------------------
   DASHBOARD LAYOUT (Sidebar + Main)
-------------------------------------- */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.sidebar {
    width: 240px;
    background-color: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    z-index: 1050;
}

/* Mobile Sidebar Styles */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
    }
    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 4px 0 10px rgba(0,0,0,0.1);
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1040;
    }
    .sidebar-overlay.mobile-open {
        display: block;
    }
}

.sidebar-header {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-menu {
    flex-grow: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-heading {
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0 1.25rem;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}
.sidebar-heading:first-child {
    margin-top: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.25rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-link:hover, .sidebar-link.active {
    color: var(--sidebar-text-hover);
    background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-link.active {
    background-color: var(--sidebar-active-bg);
    border-radius: 0 1.5rem 1.5rem 0;
    margin-right: 0.75rem;
}

.sidebar-link i {
    width: 16px;
    text-align: center;
}

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    width: 100%;
}

.topbar {
    background-color: var(--card-bg);
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.topbar-left i {
    font-size: 1.25rem;
    color: var(--text-dark);
    cursor: pointer;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.topbar-user .avatar {
    width: 32px;
    height: 32px;
    background-color: #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.topbar-user .info {
    line-height: 1.2;
}
.topbar-user .name {
    font-weight: 600;
    font-size: 0.85rem;
}
.topbar-user .role {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.page-content {
    padding: 1.5rem;
    flex-grow: 1;
}

@media(max-width: 576px) {
    .page-content {
        padding: 1rem;
    }
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}
.page-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

/* -------------------------------------
   COMPONENTS
-------------------------------------- */
.stat-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.stat-icon.blue { background: var(--info-bg); color: var(--info-color); }
.stat-icon.green { background: var(--success-bg); color: var(--success-color); }
.stat-icon.orange { background: var(--warning-bg); color: var(--warning-color); }
.stat-icon.purple { background: #f3e8ff; color: #a855f7; }

.stat-info .title {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0.15rem;
}
.stat-info .value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.15rem;
}
.stat-info .desc {
    font-size: 0.7rem;
    color: var(--success-color);
}
.stat-info .desc.neutral { color: var(--text-muted); }

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
@media(max-width: 992px) {
    .content-grid { grid-template-columns: 1fr; }
}

.panel-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    overflow: hidden;
    height: 100%;
}

.panel-header {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.95rem;
}

.panel-body {
    padding: 1rem 1.25rem;
}

#admin-map, #map {
    width: 100%;
    height: 250px;
    border-radius: 0.35rem;
    border: 1px solid var(--border-color);
}
@media(max-width: 768px) {
    #admin-map, #map {
        height: 200px;
    }
}

/* Tables */
.table-custom {
    width: 100%;
    border-collapse: collapse;
}
.table-custom th {
    text-align: left;
    padding: 0.6rem 1rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}
.table-custom td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}
.table-custom tr:last-child td {
    border-bottom: none;
}

.badge-status {
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.7rem;
    font-weight: 600;
}
.badge-status.present {
    background-color: var(--success-bg);
    color: var(--success-color);
}
.badge-status.absent {
    background-color: var(--danger-bg);
    color: var(--danger-color);
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
}
.btn-success:hover {
    background-color: #059669;
}
.btn-success:disabled {
    background-color: #9ca3af;
    border-color: #9ca3af;
}

.big-checkin-btn {
    font-size: 1rem;
    padding: 0.75rem;
    font-weight: 600;
}
