/* ============================================================
   EMPLOYEE PORTAL — MOBILE-FIRST CSS
   Color: Indigo #4f46e5 (distinct from Admin purple #7c3aed)
   ============================================================ */

:root {
    /* Employee Portal Colors — Indigo theme */
    --primary-color: #4f46e5;
    --primary-dark:  #4338ca;
    --primary-light: #818cf8;
    --secondary-color: #7c3aed;   /* accent: admin purple */

    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color:  #ef4444;
    --info-color:    #3b82f6;

    --text-dark:  #0f172a;
    --text-muted: #64748b;
    --bg-light:   #f8fafc;
    --bg-white:   #ffffff;
    --border-light: #e2e8f0;

    --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,.10);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;

    --bottom-nav-height: 68px;
    --header-height: 58px;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-light);
    margin: 0;
    padding-bottom: var(--bottom-nav-height);
    -webkit-font-smoothing: antialiased;
    color: var(--text-dark);
}

/* ============================================================ MOBILE HEADER */
.mobile-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    box-shadow: 0 2px 12px rgba(79,70,229,.3);
}
.mobile-header .header-left { display:flex; align-items:center; gap:10px; }
.mobile-header .avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: rgba(255,255,255,.25);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 13px;
}
.mobile-header .greeting { color: rgba(255,255,255,.8); font-size: 11px; }
.mobile-header .name { color: #fff; font-size: 15px; font-weight: 700; }
.mobile-header .header-right { display:flex; align-items:center; gap:14px; }
.mobile-header .notif-btn { position:relative; color:#fff; font-size:20px; text-decoration:none; padding:4px; }
.mobile-header .notif-badge {
    position: absolute; top: -2px; right: -4px;
    background: var(--danger-color); color: #fff;
    font-size: 9px; font-weight: 700;
    width: 16px; height: 16px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

/* ============================================================ BOTTOM NAV */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: var(--bottom-nav-height);
    background: var(--bg-white);
    border-top: 1px solid var(--border-light);
    display: flex; z-index: 100;
    box-shadow: 0 -4px 16px rgba(0,0,0,.07);
}
.nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: var(--text-muted); text-decoration: none;
    font-size: 10px; font-weight: 600; padding: 8px 4px; gap: 3px;
    position: relative; transition: color .2s;
}
.nav-item i { font-size: 20px; transition: transform .2s; }
.nav-item.active { color: var(--primary-color); }
.nav-item.active i { transform: scale(1.1); }
.nav-item.active::before {
    content: ''; position: absolute; top: 0; left: 20%; right: 20%;
    height: 3px; background: var(--primary-color); border-radius: 0 0 3px 3px;
}
.nav-item.qr-btn { color: #fff; }
.nav-item.qr-btn .nav-icon-wrap {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    width: 46px; height: 46px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin-top: -14px; box-shadow: 0 4px 12px rgba(79,70,229,.4);
}
.nav-item.qr-btn i { font-size: 20px; }
.nav-item.qr-btn span { color: var(--text-muted); }

/* ============================================================ PAGE CONTENT */
.page-content { padding: 16px; max-width: 600px; margin: 0 auto; }
.page-title { font-size: 20px; font-weight: 700; color: var(--text-dark); margin: 0 0 4px; }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin: 0 0 20px; }

/* ============================================================ CARDS */
.card-mobile {
    background: var(--bg-white); border-radius: var(--radius-md);
    padding: 16px; margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    width: 100%;
}
.card-mobile-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;
}
.card-mobile-title { font-size: 15px; font-weight: 700; color: var(--text-dark); }

/* ============================================================ STAT GRID */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.stat-pill {
    background: var(--bg-white); border-radius: var(--radius-md);
    padding: 14px 12px; text-align: center;
    box-shadow: var(--shadow-sm); border: 1px solid var(--border-light);
}
.stat-pill-val { font-size: 26px; font-weight: 800; color: var(--primary-color); line-height: 1; }
.stat-pill-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }
.stat-pill.green .stat-pill-val { color: var(--success-color); }
.stat-pill.orange .stat-pill-val { color: var(--warning-color); }
.stat-pill.red .stat-pill-val { color: var(--danger-color); }
.stat-pill.purple .stat-pill-val { color: var(--secondary-color); }

/* ============================================================ QUICK ACTIONS */
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.action-btn {
    background: var(--bg-white); border-radius: var(--radius-md);
    padding: 14px 10px; text-align: center; text-decoration: none;
    box-shadow: var(--shadow-sm); display: block;
    transition: all .2s; border: 1.5px solid transparent;
}
.action-btn:active { transform: scale(0.97); }
.action-btn:hover { border-color: var(--primary-color); text-decoration: none; }
.action-btn-icon {
    width: 46px; height: 46px; border-radius: 13px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 8px; font-size: 20px;
}
.action-btn-icon.blue   { background: rgba(79,70,229,.1);  color: var(--primary-color); }
.action-btn-icon.green  { background: rgba(16,185,129,.1); color: var(--success-color); }
.action-btn-icon.orange { background: rgba(245,158,11,.1); color: var(--warning-color); }
.action-btn-icon.purple { background: rgba(124,58,237,.1); color: var(--secondary-color); }
.action-btn-icon.red    { background: rgba(239,68,68,.1);  color: var(--danger-color); }
.action-btn-icon.teal   { background: rgba(20,184,166,.1); color: #14b8a6; }
.action-btn-label { font-size: 12px; font-weight: 700; color: var(--text-dark); }

/* ============================================================ ATTENDANCE CALENDAR */
.attendance-calendar {
    background: var(--bg-white); border-radius: var(--radius-md);
    padding: 16px; box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light); margin-bottom: 14px;
}
.cal-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.cal-nav {
    background: var(--bg-light); border: 1px solid var(--border-light);
    border-radius: var(--radius-sm); color: var(--primary-color);
    font-size: 16px; cursor: pointer; padding: 6px 10px; text-decoration: none;
}
.cal-title { font-size: 15px; font-weight: 700; color: var(--text-dark); }
.cal-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:3px; text-align:center; }
.cal-day-header { font-size: 12px; font-weight: 700; color: var(--text-muted); padding: 4px 0; }
.cal-day {
    aspect-ratio: 1; border-radius: 7px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-weight: 600; cursor: pointer;
    transition: all .15s; min-height: 30px;
}
.cal-day.empty { background: transparent; }
.cal-day.present { background: rgba(16,185,129,.12); color: #065f46; }
.cal-day.absent  { background: rgba(239,68,68,.10);  color: #991b1b; }
.cal-day.leave   { background: rgba(245,158,11,.12); color: #92400e; }
.cal-day.holiday { background: rgba(79,70,229,.10);  color: var(--primary-color); }
.cal-day.sunday  { color: var(--danger-color); opacity: .5; }
.cal-day.today   { background: var(--primary-color); color: #fff !important; font-weight: 800; }
.cal-day.half    { background: rgba(20,184,166,.12); color: #0f766e; }
.cal-legend { display:flex; gap:10px; margin-top:10px; flex-wrap:wrap; }
.legend-item { display:flex; align-items:center; gap:4px; font-size: 10px; color: var(--text-muted); }
.legend-dot { width:9px; height:9px; border-radius:50%; }

/* ============================================================ LEAVE LIST */
.leave-item {
    background: var(--bg-white); border-radius: var(--radius-md);
    padding: 13px; margin-bottom: 8px;
    box-shadow: var(--shadow-sm); border: 1px solid var(--border-light);
    border-left: 4px solid var(--border-light);
    display: flex; justify-content: space-between; align-items: flex-start;
}
.leave-item.pending  { border-left-color: var(--warning-color); }
.leave-item.approved { border-left-color: var(--success-color); }
.leave-item.rejected { border-left-color: var(--danger-color); }
.leave-type  { font-size: 14px; font-weight: 700; color: var(--text-dark); }
.leave-dates { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ============================================================ FORMS */
.form-mobile .form-group { margin-bottom: 14px; }
.form-mobile label { display:block; font-size:13px; font-weight:600; color:var(--text-dark); margin-bottom:5px; }
.form-mobile .form-control {
    width: 100%; padding: 13px 14px; border: 1.5px solid var(--border-light);
    border-radius: var(--radius-sm); font-size: 15px; color: var(--text-dark);
    background: var(--bg-white); transition: border-color .2s; -webkit-appearance: none;
}
.form-mobile .form-control:focus { border-color: var(--primary-color); outline: none; }
.form-mobile select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2364748b' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 38px;
}
.btn-full {
    width: 100%; padding: 15px; font-size: 15px; font-weight: 700;
    border: none; border-radius: var(--radius-sm); cursor: pointer;
    transition: all .2s; display: flex; align-items: center; justify-content: center;
    gap: 8px; text-decoration: none; letter-spacing: .3px;
}
.btn-full:active { transform: scale(0.98); }
.btn-full.primary { background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); color: #fff; }
.btn-full.success { background: linear-gradient(135deg, #10b981, #059669); color: #fff; }
.btn-full.danger  { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; }
.btn-full.outline { background: transparent; border: 2px solid var(--primary-color); color: var(--primary-color); }

/* ============================================================ PAYSLIP LIST */
.payslip-item {
    background: var(--bg-white); border-radius: var(--radius-md);
    padding: 13px; margin-bottom: 8px;
    box-shadow: var(--shadow-sm); border: 1px solid var(--border-light);
    display: flex; justify-content: space-between; align-items: center;
}
.payslip-month  { font-size: 15px; font-weight: 700; color: var(--text-dark); }
.payslip-amount { font-size: 13px; color: var(--success-color); font-weight: 700; }

/* ============================================================ ALERTS */
.alert-mobile {
    padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13px;
    margin-bottom: 12px; display: flex; align-items: flex-start; gap: 8px;
    border: 1px solid transparent;
}
.alert-mobile.success { background:#f0fdf4; color:#14532d; border-color:#bbf7d0; }
.alert-mobile.danger  { background:#fef2f2; color:#7f1d1d; border-color:#fecaca; }
.alert-mobile.warning { background:#fffbeb; color:#78350f; border-color:#fde68a; }
.alert-mobile.info    { background:#eff6ff; color:#1e3a8a; border-color:#bfdbfe; }

/* ============================================================ BADGES */
.badge-pill {
    display: inline-flex; align-items: center;
    padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700;
}
.badge-pill.success { background: rgba(16,185,129,.12); color: #065f46; }
.badge-pill.warning { background: rgba(245,158,11,.12); color: #92400e; }
.badge-pill.danger  { background: rgba(239,68,68,.12);  color: #991b1b; }
.badge-pill.info    { background: rgba(79,70,229,.10);  color: var(--primary-color); }

/* ============================================================ SKELETON */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%; animation: skeleton-loading 1.5s infinite; border-radius: var(--radius-sm);
}
@keyframes skeleton-loading { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ============================================================ RESPONSIVE */
@media (max-width: 380px) {
    .quick-actions { grid-template-columns: 1fr 1fr; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .cal-day { min-height: 26px; font-size: 11px; }
}
@media (min-width: 600px) {
    .page-content { padding: 24px; }
    .quick-actions { grid-template-columns: repeat(3, 1fr); }
    .stat-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 769px) {
    .page-content { max-width: 85%;}
    .stat-pill-label{
        font-size: 0.8rem;
    }
    .cal-day-header, .cal-day{
        font-size: 1rem;
    }
    .cal-day{
        aspect-ratio: 2;
    }
    .responsive-emp-container{
        display: flex;
        gap: 20px;
        margin-bottom: 20px;
    }
    .card-mobile{
        margin-bottom: 0;
    }
    .leave-item:last-child{
        margin-bottom: 0;
    }
    .quick-actions { grid-template-columns: repeat(3, 1fr); margin-bottom: 20px;}
    .stat-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Forms */
.form-control {
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-dark);
    background: #fff;
    transition: border-color .2s;
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
}
.form-control:focus { border-color: var(--primary-color); outline: none; box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2364748b' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 18px;
    padding-right: 36px;
}
textarea.form-control { resize: vertical; min-height: 90px; }
.text-muted { color: var(--text-muted); font-size: 12px; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all .2s;
    white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
}
.btn-primary:hover { opacity: .92; color: #fff; }

/* Tables */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.table thead tr { background: #f8fafc; }
.table th {
    padding: 10px 14px;
    font-weight: 700;
    color: var(--text-muted);
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}
.table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-dark);
    vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fafbff; }
.text-center { text-align: center; }

/* ============================================================ TDS DECLARATION */
.tax-summary-box {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.tax-summary-box .tax-val { font-size: 24px; font-weight: 800; }
.tax-summary-box .tax-lbl { font-size: 12px; opacity: 0.8; }
.old-regime-fields { display: none; }

/* ============================================================ STATUS BANNERS */
.locked-banner {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #fecaca;
}
.verified-banner {
    background: #dcfce7;
    color: #166534;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #bbf7d0;
}

/* ============================================================ DOCUMENT LIST */
.doc-item {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 13px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    border-left: 4px solid var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.doc-item.pdf   { border-left-color: var(--danger-color); }
.doc-item.image { border-left-color: var(--success-color); }
.doc-item-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.doc-item-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
}
.doc-item-icon.pdf   { background: rgba(239,68,68,.10);  color: var(--danger-color); }
.doc-item-icon.image { background: rgba(16,185,129,.10); color: var(--success-color); }
.doc-item-name { font-size: 14px; font-weight: 700; color: var(--text-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-item-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.doc-item-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px;
    border-radius: var(--radius-sm);
    border: none; cursor: pointer;
    font-size: 14px; text-decoration: none;
    transition: all .2s;
}
.btn-icon:active { transform: scale(0.95); }
.btn-icon.view   { background: rgba(59,130,246,.10); color: var(--info-color); }
.btn-icon.delete { background: rgba(239,68,68,.10);  color: var(--danger-color); }
.doc-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
}
.doc-empty i { font-size: 40px; opacity: 0.25; display: block; margin-bottom: 12px; }


