/* style.css - Primary Theme CSS for Student Attendance System */
/* Standard Sans-Serif stack for 100% offline, high-fidelity premium typography */

:root {
    --bg-layout: #f8fafc;
    --sidebar-bg: #ffffff;
    --header-bg: #ffffff;
    
    /* Summary Card Specific Colors from Reference */
    --card-purple: #6366f1;
    --card-blue: #3b82f6;
    --card-teal: #0d9488;
    --card-orange: #f97316;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    
    --sidebar-active-bg: rgba(99, 102, 241, 0.06);
    --sidebar-active-color: #4f46e5;
    --transition-speed: 0.2s;
}

body {
    background-color: var(--bg-layout);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

/* Layout Framework */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.top-header {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    z-index: 100;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    font-size: 24px;
    color: var(--sidebar-active-color);
}

.system-name {
    font-weight: 700;
    font-size: 18px;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

.user-avatar-container {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar {
    color: var(--text-secondary);
    font-size: 18px;
}

.app-content-wrapper {
    display: flex;
    margin-top: 70px;
    height: calc(100vh - 70px);
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 24px 16px;
    box-sizing: border-box;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    width: 100%;
}

.nav-header {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 16px 12px 8px 12px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    font-size: 14px;
    transition: all var(--transition-speed) ease;
}

.nav-link:hover {
    background-color: #f8fafc;
    color: var(--text-primary);
}

.nav-link.active {
    background-color: var(--sidebar-active-bg);
    color: var(--sidebar-active-color);
    font-weight: 600;
}

.nav-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    overflow-y: auto;
    background-color: var(--bg-layout);
}

/* Page Section Titles (Student Mgmt Style) */
.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Summary Cards Grid */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    border-radius: 16px;
    padding: 24px;
    color: #ffffff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    transition: transform var(--transition-speed) ease;
}

.summary-card:hover {
    transform: translateY(-2px);
}

.card-purple { background: linear-gradient(135deg, #818cf8 0%, #4f46e5 100%); }
.card-blue { background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%); }
.card-teal { background: linear-gradient(135deg, #2dd4bf 0%, #0d9488 100%); }
.card-orange { background: linear-gradient(135deg, #fb923c 0%, #ea580c 100%); }

.summary-card-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.85;
    margin-bottom: 8px;
}

.summary-card-value {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -1px;
}

.summary-card-icon {
    position: absolute;
    right: 20px;
    bottom: 20px;
    font-size: 48px;
    opacity: 0.15;
}

/* Content Layout (Middle & Right panels) */
.dashboard-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

@media (max-width: 1024px) {
    .dashboard-row {
        grid-template-columns: 1fr;
    }
}

.content-card {
    background-color: #ffffff;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.02);
    margin-bottom: 24px;
}

.card-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.card-sec-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Tables styling matching Reference Screenshot */
.custom-table {
    width: 100%;
    border-collapse: collapse;
}

.custom-table th {
    background-color: #f8fafc;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.custom-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 14px;
    vertical-align: middle;
}

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

.custom-table tr:hover {
    background-color: #fafafa;
}

/* Badges */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.status-active { background-color: #ecfdf5; color: #047857; }
.status-expired { background-color: #fef2f2; color: #b91c1c; }
.status-present { background-color: #ecfdf5; color: #047857; }

/* Buttons & Inputs */
.btn-primary-custom {
    background-color: var(--sidebar-active-color);
    color: #ffffff;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    transition: all var(--transition-speed) ease;
}

.btn-primary-custom:hover {
    background-color: #3b82f6;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.15);
    color: #ffffff;
}

.form-control-custom {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text-primary);
    width: 100%;
}

.form-control-custom:focus {
    border-color: var(--sidebar-active-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    outline: none;
}
