/* =================================================================
 * EDShield Attendance Pro — Dashboard Styles
 * Fully responsive. Mobile-first improvements at the bottom.
 * ================================================================= */

.eds-app {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 16px;
    font-family: -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: #1a1a1a;
    line-height: 1.4;
}
.eds-app * { box-sizing: border-box; }

.eds-login-prompt {
    text-align: center;
    padding: 60px 20px;
    font-family: -apple-system, 'Segoe UI', Roboto, sans-serif;
}
.eds-login-btn {
    display: inline-block;
    margin-top: 18px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    padding: 14px 32px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
}

/* ─── HEADER ─────────────────────────────────────────────── */
.eds-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px;
    color: #fff;
    margin-bottom: 20px;
    box-shadow: 0 12px 32px rgba(102, 126, 234, .3);
    flex-wrap: wrap;
    gap: 14px;
}
.eds-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.eds-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}
.eds-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, .4);
    object-fit: cover;
    display: block;
}
.eds-avatar-edit {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: #fff;
    color: #667eea;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
    transition: transform .15s;
}
.eds-avatar-edit:hover { transform: scale(1.1); }

.eds-greeting {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.3px;
}
.eds-wave {
    display: inline-block;
    animation: wave 2s infinite;
}
@keyframes wave {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(20deg); }
    75% { transform: rotate(-10deg); }
}
.eds-sub {
    font-size: 13px;
    opacity: .92;
    margin-top: 3px;
}

.eds-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.eds-clock-now {
    font-size: 24px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    background: rgba(255, 255, 255, .18);
    padding: 8px 16px;
    border-radius: 10px;
}
.eds-pill-link {
    color: #fff;
    background: rgba(255, 255, 255, .18);
    padding: 8px 14px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background .2s;
}
.eds-pill-link:hover { background: rgba(255, 255, 255, .28); color: #fff; }

/* ─── TODAY CARD ─────────────────────────────────────────── */
.eds-today-card {
    background: #fff;
    border-radius: 18px;
    padding: 24px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .06);
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 20px;
}
.eds-today-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #888;
    font-weight: 700;
}
.eds-today-status {
    font-size: 19px;
    font-weight: 600;
    margin: 8px 0 14px;
}
.eds-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}
.eds-dot-green {
    background: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, .2);
    animation: pulse 2s infinite;
}
.eds-dot-blue { background: #3b82f6; }
.eds-dot-grey { background: #9ca3af; }
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(16, 185, 129, .2); }
    50% { box-shadow: 0 0 0 10px rgba(16, 185, 129, .05); }
}
.eds-duration { color: #10b981; font-weight: 600; }
.eds-today-times {
    display: flex;
    gap: 18px;
    font-size: 14px;
    color: #555;
    flex-wrap: wrap;
    align-items: center;
}
.eds-today-times b { color: #222; }
.eds-streak {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.eds-today-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.eds-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 26px;
    border: 0;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all .2s;
}
.eds-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, .18);
}
.eds-btn:disabled {
    background: #cbd5e1 !important;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.eds-btn-in  { background: linear-gradient(135deg, #10b981, #059669); }
.eds-btn-out { background: linear-gradient(135deg, #ef4444, #dc2626); }
.eds-spin {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── MESSAGE BAR ────────────────────────────────────────── */
.eds-msg {
    padding: 0;
    margin-bottom: 14px;
    border-radius: 12px;
    font-weight: 500;
    overflow: hidden;
    max-height: 0;
    transition: all .3s;
}
.eds-msg.ok, .eds-msg.err {
    padding: 14px 18px;
    max-height: 300px;
}
.eds-msg.ok  { background: #d1fae5; color: #065f46; border-left: 4px solid #10b981; }
.eds-msg.err { background: #fee2e2; color: #991b1b; border-left: 4px solid #ef4444; }
.eds-msg code { background: rgba(0,0,0,.08); padding: 2px 6px; border-radius: 4px; }

/* ─── STAT CARDS ─────────────────────────────────────────── */
.eds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.eds-stat {
    padding: 22px;
    border-radius: 16px;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .1);
    transition: transform .2s;
}
.eds-stat:hover { transform: translateY(-4px); }
.eds-stat-icon { font-size: 26px; margin-bottom: 10px; }
.eds-stat-num {
    font-size: 34px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -1.5px;
}
.eds-stat-label {
    font-size: 13px;
    margin-top: 6px;
    opacity: .95;
    font-weight: 500;
}
.eds-grad-1 { background: linear-gradient(135deg, #10b981, #059669); }
.eds-grad-2 { background: linear-gradient(135deg, #ef4444, #dc2626); }
.eds-grad-3 { background: linear-gradient(135deg, #f59e0b, #d97706); }
.eds-grad-4 { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.eds-grad-5 { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.eds-grad-6 { background: linear-gradient(135deg, #ec4899, #db2777); }

/* ─── TWO-COLUMN LAYOUT ──────────────────────────────────── */
.eds-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
}

/* ─── CARDS ──────────────────────────────────────────────── */
.eds-card {
    background: #fff;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .06);
    margin-bottom: 18px;
}
.eds-card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
}

/* ─── PROGRESS RING ──────────────────────────────────────── */
.eds-progress-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.eds-ring-wrap {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 6px 0;
}
.eds-ring { width: 100%; height: 100%; }
.eds-ring circle { transition: stroke-dasharray 1.2s ease-out; }
.eds-ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}
.eds-ring-num {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.eds-ring-label {
    font-size: 12px;
    color: #888;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.eds-ring-sub { font-size: 13px; color: #666; margin-top: 8px; }

/* ─── BAR CHART ──────────────────────────────────────────── */
.eds-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 170px;
    padding: 10px 0;
}
.eds-bar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    height: 100%;
}
.eds-bar-val { font-size: 11px; color: #666; height: 14px; margin-bottom: 4px; }
.eds-bar-track {
    flex: 1;
    width: 60%;
    max-width: 32px;
    background: #f1f5f9;
    border-radius: 6px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}
.eds-bar {
    width: 100%;
    background: linear-gradient(180deg, #667eea, #764ba2);
    border-radius: 6px;
    transition: height 1s ease-out;
    min-height: 2px;
}
.eds-bar.is-today { background: linear-gradient(180deg, #10b981, #059669); }
.eds-bar-label { font-size: 11px; color: #888; margin-top: 6px; font-weight: 600; }

/* ─── CALENDAR ───────────────────────────────────────────── */
.eds-cal {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}
.eds-cal-h {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: #888;
    padding: 6px 0;
    text-transform: uppercase;
}
.eds-cal-d {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    background: #f8fafc;
    color: #333;
    border: 2px solid transparent;
    transition: transform .15s;
}
.eds-cal-d:hover { transform: scale(1.1); }
.eds-cal-d.is-today {
    border-color: #667eea;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(102, 126, 234, .3);
}
.eds-cal-d.is-present { background: #d1fae5; color: #065f46; }
.eds-cal-d.is-absent  { background: #fee2e2; color: #991b1b; }
.eds-cal-d.is-holiday { background: #fef3c7; color: #92400e; font-weight: 700; }
.eds-cal-d.is-weekend { background: #f1f5f9; color: #9ca3af; }
.eds-cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 14px;
    font-size: 12px;
    color: #555;
}
.eds-le {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    vertical-align: middle;
    margin-right: 5px;
}
.eds-le-p { background: #d1fae5; }
.eds-le-a { background: #fee2e2; }
.eds-le-h { background: #fef3c7; }
.eds-le-w { background: #f1f5f9; }

/* ─── HOLIDAY / ACTIVITY ROWS ────────────────────────────── */
.eds-holiday-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}
.eds-holiday-row:last-child { border: 0; }
.eds-holiday-date {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: 10px;
    padding: 6px 10px;
    text-align: center;
    min-width: 48px;
}
.eds-holiday-day {
    font-size: 18px;
    font-weight: 800;
    color: #92400e;
    line-height: 1;
}
.eds-holiday-mon {
    font-size: 10px;
    text-transform: uppercase;
    color: #92400e;
    font-weight: 600;
}
.eds-holiday-name { font-weight: 600; font-size: 14px; }
.eds-holiday-away { font-size: 12px; color: #888; }

.eds-activity-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}
.eds-activity-row:last-child { border: 0; }
.eds-activity-date { font-weight: 600; font-size: 14px; }
.eds-activity-times { font-size: 12px; color: #777; margin-top: 2px; }
.eds-activity-hrs {
    background: #eef2ff;
    color: #4338ca;
    padding: 5px 11px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
}

.eds-empty {
    text-align: center;
    padding: 18px;
    color: #888;
    font-size: 14px;
}

.eds-footer {
    text-align: center;
    color: #aaa;
    font-size: 12px;
    padding: 20px 0;
}

/* ─── CONFETTI ───────────────────────────────────────────── */
.eds-confetti {
    position: fixed;
    top: -10px;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    z-index: 9999;
    animation: fall linear forwards;
    pointer-events: none;
}
@keyframes fall {
    to { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* =================================================================
 * RESPONSIVE BREAKPOINTS
 * ================================================================= */

/* Tablet */
@media (max-width: 900px) {
    .eds-two-col { grid-template-columns: 1fr; }
}

/* Phone */
@media (max-width: 640px) {
    .eds-app { padding: 0 10px; }
    .eds-header { padding: 16px 18px; }
    .eds-header-left { width: 100%; }
    .eds-header-right { width: 100%; justify-content: space-between; }
    .eds-greeting { font-size: 18px; }
    .eds-sub { font-size: 12px; }
    .eds-clock-now { font-size: 20px; padding: 6px 12px; }
    .eds-avatar { width: 48px; height: 48px; }

    .eds-today-card { padding: 18px 20px; }
    .eds-today-status { font-size: 16px; }
    .eds-today-times { gap: 10px; font-size: 13px; }
    .eds-today-actions { width: 100%; }
    .eds-btn { flex: 1; justify-content: center; padding: 14px 18px; }

    .eds-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .eds-stat { padding: 16px; }
    .eds-stat-num { font-size: 26px; }
    .eds-stat-icon { font-size: 22px; margin-bottom: 6px; }
    .eds-stat-label { font-size: 11px; }

    .eds-card { padding: 18px; }
    .eds-card-title { font-size: 15px; margin-bottom: 12px; }

    .eds-ring-wrap { width: 140px; height: 140px; }
    .eds-ring-num { font-size: 28px; }

    .eds-chart { height: 140px; }

    .eds-cal-d { font-size: 12px; }

    .eds-pill-link { padding: 6px 10px; font-size: 12px; }
}

/* Very small phones */
@media (max-width: 380px) {
    .eds-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .eds-today-actions { flex-direction: column; }
    .eds-btn { width: 100%; }
}
