/* ==========================================
   Modern & Professional CSS Design System
   ========================================== */

:root {
    /* Color Palette */
    --primary: #ea580c;
    --primary-hover: #c2410c;
    --primary-light: #fff7ed;
    --bg-main: #f8fafc;
    --surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --success: #10b981;
    --info: #0284c7;

    /* Design Tokens */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Reset & Global Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    padding: 32px 16px;
    line-height: 1.5;
}

.app-container {
    max-width: 960px;
    margin: 0 auto;
}

/* Header Component */
.app-header {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #ffffff;
    padding: 20px 28px;
    border-radius: var(--radius-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-lg);
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.app-header h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.nav-links a {
    color: #94a3b8;
    text-decoration: none;
    margin-left: 10px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-links a:hover, .nav-links a.active {
    background: var(--primary);
    color: #ffffff;
}

/* Search Card Component */
.search-box-card {
    background: var(--surface);
    padding: 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.search-box-card label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.input-group i {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 16px;
}

.input-group input {
    flex: 1;
    padding: 12px 14px 12px 42px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 15px;
    background-color: #f8fafc;
    color: var(--text-main);
    transition: all 0.2s ease;
}

.input-group input:focus {
    background-color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.15);
    outline: none;
}

.input-group button, .btn-primary {
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.input-group button:hover, .btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Student Detail Card */
.student-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.student-profile {
    display: flex;
    gap: 24px;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 24px;
    margin-bottom: 24px;
}

.avatar-img {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-md);
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.avatar-placeholder {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-md);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    border: 1px solid rgba(234, 88, 12, 0.2);
}

.student-info h2 {
    color: var(--text-main);
    margin-bottom: 12px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.detail-item {
    background: #f8fafc;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    border: 1px solid var(--border-color);
}

.detail-item span {
    font-weight: 600;
    color: var(--text-muted);
    display: block;
    font-size: 11px;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.late-action-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    background: var(--primary-light);
    padding: 18px 20px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(234, 88, 12, 0.2);
}

.late-count-badge {
    background: var(--danger);
    color: white;
    padding: 4px 12px;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.02em;
}

/* History Logs */
.history-section {
    margin-top: 24px;
}

.history-item {
    background: var(--surface);
    border-left: 4px solid var(--info);
    padding: 12px 16px;
    margin-bottom: 10px;
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    border-top: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

/* Toast Message */
.toast {
    display: none;
    background: var(--success);
    color: white;
    padding: 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
    box-shadow: var(--shadow-md);
}

/* Modern Data Table */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.data-table th, .data-table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.data-table tbody tr:hover {
    background-color: #f8fafc;
}

.btn-danger {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

/* ==========================================
   Entry Options: Direct vs Manual Time Selection
   ========================================== */

.entry-options-wrapper {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Option 1: Direct Entry */
.direct-entry-card {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1.5px solid #86efac;
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.direct-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 13px;
    color: #166534;
    font-weight: 600;
}

.live-clock-badge {
    background: #dcfce7;
    color: #15803d;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid #bbf7d0;
}

.btn-direct-submit {
    background: #16a34a;
    color: #ffffff;
    border: none;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(22, 163, 74, 0.25);
}

.btn-direct-submit:hover {
    background: #15803d;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(22, 163, 74, 0.35);
}

/* OR Divider */
.entry-separator {
    display: flex;
    align-items: center;
    text-align: center;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.entry-separator::before,
.entry-separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e2e8f0;
}

.entry-separator span {
    padding: 0 10px;
}

/* Option 2: Manual Time Selection */
.manual-entry-card {
    background: #f8fafc;
    border: 1.5px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: left;
    transition: all 0.2s ease;
}

.manual-entry-card:focus-within {
    background: #f0f7ff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.manual-entry-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 10px;
}

.manual-entry-title .tag-optional {
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    background: #e2e8f0;
    padding: 2px 6px;
    border-radius: 4px;
}

.manual-inputs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.manual-input-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.manual-input-field input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: #0f172a;
    background: #ffffff;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.manual-input-field input:focus {
    border-color: #2563eb;
    outline: none;
}

.btn-manual-submit {
    background: #2563eb;
    color: #ffffff;
    border: none;
    padding: 11px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.btn-manual-submit:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.3);
}

.manual-helper-hint {
    font-size: 11px;
    color: #64748b;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}