* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Tahoma', 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    direction: rtl;
    padding: 20px;
}
.container { max-width: 1200px; margin: 0 auto; }
.card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    margin-bottom: 20px;
}
h1, h2, h3 { color: #4a3f8f; margin-bottom: 16px; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.95);
    padding: 16px 24px;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    flex-wrap: wrap;
    gap: 10px;
}
.topbar .user-info { color: #666; font-size: 14px; }
.topbar .user-info b { color: #4a3f8f; }

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 600;
}
.btn-primary { background: #667eea; color: #fff; }
.btn-primary:hover { background: #5568d3; transform: translateY(-2px); }
.btn-success { background: #10b981; color: #fff; }
.btn-success:hover { background: #059669; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-warning { background: #f59e0b; color: #fff; }
.btn-warning:hover { background: #d97706; }
.btn-secondary { background: #6b7280; color: #fff; }
.btn-secondary:hover { background: #4b5563; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; color: #555; }
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    transition: border 0.2s;
}
.form-control:focus { outline: none; border-color: #667eea; }

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}
table th, table td {
    padding: 12px;
    text-align: right;
    border-bottom: 1px solid #e5e7eb;
}
table th {
    background: #f9fafb;
    color: #4a3f8f;
    font-weight: 700;
    font-size: 14px;
}
table tr:hover { background: #f9fafb; }

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}
.badge-present { background: #d1fae5; color: #065f46; }
.badge-absent { background: #fee2e2; color: #991b1b; }
.badge-late { background: #fef3c7; color: #92400e; }

.alert {
    padding: 12px 20px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-weight: 600;
}
.alert-success { background: #d1fae5; color: #065f46; }
.alert-error { background: #fee2e2; color: #991b1b; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 14px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border-right: 4px solid #667eea;
}
.stat-card .num { font-size: 32px; font-weight: 800; color: #4a3f8f; }
.stat-card .label { color: #666; font-size: 13px; margin-top: 6px; }
.stat-card.green { border-color: #10b981; }
.stat-card.green .num { color: #10b981; }
.stat-card.red { border-color: #ef4444; }
.stat-card.red .num { color: #ef4444; }
.stat-card.yellow { border-color: #f59e0b; }
.stat-card.yellow .num { color: #f59e0b; }

.login-box {
    max-width: 400px;
    margin: 80px auto;
}
.login-box h1 { text-align: center; margin-bottom: 24px; }

.att-row { display: flex; gap: 8px; align-items: center; }
.att-row label {
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid #e5e7eb;
    font-size: 13px;
    transition: all 0.15s;
    user-select: none;
}
.att-row input[type=radio] { display: none; }
.att-row input[type=radio]:checked + label {
    border-color: #667eea;
    background: #eef2ff;
    font-weight: 700;
}
.att-row input[value=present]:checked + label { background: #d1fae5; border-color: #10b981; color: #065f46; }
.att-row input[value=absent]:checked + label { background: #fee2e2; border-color: #ef4444; color: #991b1b; }
.att-row input[value=late]:checked + label { background: #fef3c7; border-color: #f59e0b; color: #92400e; }

.tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.tab {
    padding: 10px 20px;
    border-radius: 10px;
    background: #fff;
    color: #4a3f8f;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.tab.active { background: #4a3f8f; color: #fff; }