* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* Shared card */
.card { background: white; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); padding: 1.5rem 2rem; margin-bottom: 2rem; }
.card h2, .card h3 { margin-bottom: 1rem; }

/*Header */
.header { background: #E07A3F; color: white; padding: 1rem 2rem; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.header-content { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.logo h1 { font-size: 1.5rem; }
.logo span { font-size: 0.875rem; opacity: 0.9; }
.user-info { display: flex; align-items: center; gap: 1rem; }
.user-meta { display: flex; flex-direction: column; align-items: flex-end; }
.user-role { padding: 0.25rem 0.75rem; background: rgba(255,255,255,0.2); border-radius: 4px; font-size: 0.75rem; text-transform: uppercase; }
.last-login { font-size: 0.7rem; opacity: 0.8; margin-top: 2px; }

/*buttons*/
.btn, .btn-nav, .btn-close, .btn-approve, .btn-reject, .btn-small { border: none; border-radius: 4px; cursor: pointer; font-weight: 600; font-family: inherit; }
.btn { padding: 0.75rem 1.5rem; font-size: 1rem; }
.btn-primary   { background: #E07A3F; color: white; }
.btn-primary:hover   { background: #c9612a; }
.btn-secondary { background: #f59e0b; color: white; }
.btn-secondary:hover { background: #d97706; }
.btn-leave     { background: #f59e0b; color: white; padding: 0.75rem 1.5rem; font-size: 1rem; border: none; border-radius: 4px; cursor: pointer; font-weight: 600; }
.btn-leave:hover     { background: #d97706; }
.btn-logout    { background: white; color: #E07A3F; padding: 0.5rem 1rem; border: none; border-radius: 4px; cursor: pointer; font-weight: 600; }
.btn-logout:hover    { background: #f0f0f0; }
.btn-profile   { background: rgba(255,255,255,0.2); color: white; border: 1px solid white; padding: 0.5rem 1rem; border-radius: 4px; cursor: pointer; font-weight: 600; }
.btn-profile:hover   { background: rgba(255,255,255,0.3); }
.btn-nav       { background: #E07A3F; color: white; padding: 0.5rem 1rem; }
.btn-nav:hover       { background: #c9612a; }
.btn-close     { background: #ef4444; color: white; padding: 0.5rem 1rem; }
.btn-small     { background: #E07A3F; color: white; padding: 0.4rem 0.8rem; font-size: 0.875rem; }
.btn-small:hover     { background: #c9612a; }
.btn-approve   { flex: 1; padding: 0.5rem; background: #10b981; color: white; border: none; border-radius: 4px; cursor: pointer; font-weight: 600; }
.btn-approve:hover   { background: #059669; }
.btn-reject    { flex: 1; padding: 0.5rem; background: #ef4444; color: white; border: none; border-radius: 4px; cursor: pointer; font-weight: 600; }
.btn-reject:hover    { background: #dc2626; }

/* badges */
.badge { padding: 0.25rem 0.75rem; border-radius: 12px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }
.badge.present  { background: #d1fae5; color: #065f46; }
.badge.absent   { background: #fee2e2; color: #991b1b; }
.badge.late     { background: #fef3c7; color: #92400e; }
.badge.on-leave { background: #ede9fe; color: #5b21b6; }
.badge.pending  { background: #fef3c7; color: #92400e; }
.badge.approved { background: #d1fae5; color: #065f46; }
.badge.rejected { background: #fee2e2; color: #991b1b; }

/*dots */
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dot.present  { background: #E07A3F; }
.dot.late     { background: #f59e0b; }
.dot.absent   { background: #ef4444; }
.dot.on-leave { background: #8b5cf6; }

/* main container */
.main-container { max-width: 1200px; margin: 2rem auto; padding: 0 2rem; }

/*stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.stat-card { background: white; padding: 1.5rem; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); text-align: center; }
.stat-card h3 { font-size: 2rem; color: #E07A3F; margin-bottom: 0.5rem; }
.stat-card p  { color: #666; font-size: 0.875rem; }

/* check-in card */
.checkin-card { background: white; padding: 2rem; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); margin-bottom: 2rem; }
.checkin-card h2 { margin-bottom: 1rem; }
.current-time { text-align: center; font-size: 1.125rem; color: #E07A3F; padding: 1rem; background: #f5f7fa; border-radius: 4px; margin-bottom: 1.5rem; }
.checkin-status { margin: 1.5rem 0; padding: 1rem; background: #f9f9f9; border-radius: 4px; }
.status-row { display: flex; justify-content: space-between; padding: 0.5rem 0; align-items: center; }
.time-ago { font-size: 0.8rem; color: #999; font-weight: 400; margin-left: 0.5rem; }
.checkin-actions { text-align: center; margin-top: 1.5rem; }
.action-group { display: flex; gap: 1rem; justify-content: center; }
.completed-msg { color: #10b981; font-weight: 600; }

/* section toggle */
.section-toggle-bar { display: flex; justify-content: flex-end; gap: 1rem; margin-bottom: 1rem; }

/* charts */
.charts-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.chart-card { background: white; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); padding: 1rem; overflow: hidden; }

/* calendar*/
.calendar-section { background: white; padding: 2rem; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); margin-bottom: 2rem; }
.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.5rem; }
.calendar-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 4px; background: #f9f9f9; font-size: 0.875rem; transition: transform 0.1s; cursor: default; }
.calendar-day:not(.header):hover { transform: scale(1.08); }
.calendar-day.header  { font-weight: 600; background: #e5e7eb; }
.calendar-day.other-month { opacity: 0.3; }
.calendar-day.today   { border: 2px solid #E07A3F; font-weight: 700; }
.calendar-day.present { background: #E07A3F; color: white; }
.calendar-day.late    { background: #f59e0b; color: white; }
.calendar-day.absent  { background: #ef4444; color: white; }
.calendar-day.on-leave { background: #8b5cf6; color: white; }
.calendar-legend { display: flex; gap: 1.5rem; margin-top: 1rem; justify-content: center; flex-wrap: wrap; }
.calendar-legend span { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; }

/* activity */
.activity-section { background: white; padding: 1.5rem 2rem; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); margin-bottom: 2rem; }
.activity-section h3 { margin-bottom: 1rem; font-size: 1rem; }
.activity-list { list-style: none; }
.activity-list li { display: flex; justify-content: space-between; padding: 0.6rem 0; border-bottom: 1px solid #f0f0f0; font-size: 0.875rem; }
.activity-list li:last-child { border-bottom: none; }
.activity-date { color: #999; min-width: 100px; }
.activity-text { color: #555; }

/* admin-controls */
.admin-controls { background: white; padding: 1.25rem; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); margin-bottom: 1.5rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.admin-controls input { flex: 1; min-width: 180px; }
.admin-controls input, .admin-controls select { padding: 0.75rem; border: 1px solid #ddd; border-radius: 4px; font-size: 0.9rem; }
.admin-tabs { display: flex; margin-bottom: 1.5rem; border-bottom: 2px solid #e5e7eb; }
.tab-btn { padding: 0.75rem 1.5rem; background: none; border: none; border-bottom: 3px solid transparent; margin-bottom: -2px; cursor: pointer; font-weight: 600; color: #666; font-size: 0.95rem; display: flex; align-items: center; gap: 0.5rem; }
.tab-btn:hover { color: #E07A3F; }
.tab-btn.tab-active { color: #E07A3F; border-bottom-color: #E07A3F; }
.leave-badge { background: #ef4444; color: white; border-radius: 999px; padding: 0.1rem 0.5rem; font-size: 0.7rem; font-weight: 700; }

/* handsontable */
.hot-wrapper { background: white; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); padding: 1rem 1rem 1.5rem; margin-bottom: 1.5rem; overflow: hidden; }
.hot-hint { font-size: 0.8rem; color: #666; background: #fffbeb; border-left: 3px solid #f59e0b; padding: 0.5rem 0.75rem; border-radius: 0 4px 4px 0; margin-bottom: 0.75rem; }

/*modal*/
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-content { background: white; border-radius: 8px; width: 90%; max-height: 85vh; overflow-y: auto; padding: 2rem; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.details p { margin: 0.75rem 0; }

/* break*/
.break-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); display: flex; align-items: center; justify-content: center; z-index: 2000; }
.break-modal { background: white; padding: 3rem; border-radius: 8px; text-align: center; max-width: 400px; }
.break-modal h2 { margin-bottom: 1rem; }
.break-timer { font-size: 3rem; color: #E07A3F; font-weight: 700; margin: 1.5rem 0; }
.break-modal p { margin-bottom: 1.5rem; color: #666; }

/* forms*/
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.5rem; color: #666; font-size: 0.875rem; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 0.75rem; border: 1px solid #ddd; border-radius: 4px; font-size: 1rem; font-family: inherit; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: #E07A3F; }
.form-group textarea { resize: vertical; }
.form-actions { display: flex; gap: 1rem; margin-top: 1rem; }
.form-actions .btn { flex: 1; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* profile */
.profile-modal { max-width: 600px; }
.profile-section { display: flex; flex-direction: column; gap: 1.5rem; }
.profile-picture-section { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 1rem; background: #f9f9f9; border-radius: 8px; }
.profile-picture { width: 120px; height: 120px; border-radius: 50%; overflow: hidden; border: 4px solid #E07A3F; display: flex; align-items: center; justify-content: center; }
.profile-picture img { width: 100%; height: 100%; object-fit: cover; }
.profile-placeholder { width: 100%; height: 100%; background: linear-gradient(135deg, #E07A3F 0%, #764ba2 100%); color: white; display: flex; align-items: center; justify-content: center; font-size: 3rem; font-weight: 700; }

/* auth page */
.auth-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #E07A3F 0%, #764ba2 100%); }
.auth-card { background: white; padding: 2rem; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); width: 400px; max-width: 90%; }
.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-header h1 { font-size: 2rem; color: #E07A3F; margin-bottom: 0.5rem; }
.auth-header p  { color: #666; font-size: 0.875rem; }
.login-greeting { margin-top: 0.5rem; font-size: 0.8rem; color: #E07A3F; font-weight: 500; }
.auth-form h2   { margin-bottom: 1.5rem; color: #333; }
.auth-form button { width: 100%; margin-top: 1rem; }

/* add employee form */
.add-employee-form { background: #f9f9f9; border-radius: 8px; padding: 1.5rem; margin-bottom: 1.5rem; border: 1px dashed #ddd; }
.add-employee-form h3 { margin-bottom: 1rem; font-size: 0.95rem; color: #555; }
.add-employee-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.75rem; }
.add-employee-grid .form-group { margin-bottom: 0; }

/* leave section */
.leave-history-section { background: white; padding: 1.5rem 2rem; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); margin-bottom: 2rem; }
.leave-history-section h3 { margin-bottom: 1rem; font-size: 1rem; }
.leave-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.leave-table th { background: #f9f9f9; padding: 0.75rem 1rem; text-align: left; color: #666; font-weight: 600; }
.leave-table td { padding: 0.75rem 1rem; border-top: 1px solid #f0f0f0; vertical-align: top; }
.reason-cell { max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leave-modal { max-width: 520px; }

/*Leave cards (admin) */
.leave-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.leave-card { background: white; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.08); overflow: hidden; border-left: 4px solid #e5e7eb; }
.leave-card-pending  { border-left-color: #f59e0b; }
.leave-card-approved { border-left-color: #10b981; }
.leave-card-rejected { border-left-color: #ef4444; }
.leave-card-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem 0.5rem; }
.leave-dept-tag { margin-left: 0.5rem; background: #f3f4f6; color: #555; border-radius: 4px; padding: 0.1rem 0.5rem; font-size: 0.75rem; }
.leave-card-body { padding: 0.5rem 1.25rem 1rem; }
.leave-meta-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.leave-type-pill { background: #ede9fe; color: #5b21b6; border-radius: 999px; padding: 0.2rem 0.75rem; font-size: 0.75rem; font-weight: 600; }
.leave-dates  { font-size: 0.875rem; color: #444; }
.leave-reason { color: #555; font-style: italic; font-size: 0.875rem; margin: 0.4rem 0; }
.leave-applied { color: #999; font-size: 0.75rem; }
.leave-card-actions { display: flex; gap: 0.75rem; padding: 0.75rem 1.25rem; background: #f9f9f9; border-top: 1px solid #f0f0f0; }

/* Empty state*/
.empty-state { text-align: center; padding: 3rem; color: #aaa; background: white; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); margin-bottom: 2rem; }

/*Responsive*/
@media (max-width: 768px) {
    .main-container { padding: 0 1rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-controls, .section-toggle-bar { flex-direction: column; }
    .calendar-grid { gap: 0.25rem; }
    .charts-row, .form-row, .add-employee-grid { grid-template-columns: 1fr; }
}