/* ── Woodland Brand Tokens ─────────────────────────────────────────────────── */
:root {
    --wdl-navy:        #0B2447;
    --wdl-navy-mid:    #19376D;
    --wdl-navy-light:  #1A4A8A;
    --wdl-gold:        #C9A84C;
    --wdl-white:       #FFFFFF;
    --wdl-bg:          #F2F4F8;
    --wdl-card-bg:     #FFFFFF;
    --wdl-text:        #1C1C1E;
    --wdl-text-muted:  #6B7280;
    --wdl-border:      #E5E7EB;
    --wdl-success:     #2E7D32;
    --wdl-danger:      #C62828;
    --wdl-warning:     #E65100;
    --wdl-info:        #1565C0;
    --wdl-radius:      12px;
    --wdl-radius-sm:   8px;
    --wdl-shadow:      0 2px 8px rgba(11,36,71,0.10);
    --wdl-shadow-md:   0 4px 16px rgba(11,36,71,0.15);
    --bottom-nav-h:    64px;
}

/* ── Base ──────────────────────────────────────────────────────────────────── */
html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Arial, sans-serif;
    background-color: var(--wdl-bg);
    color: var(--wdl-text);
    -webkit-font-smoothing: antialiased;
    overscroll-behavior-y: none;
}

/* ── App Shell ─────────────────────────────────────────────────────────────── */
.app-shell {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100dvh;
    position: relative;
    background: var(--wdl-bg);
}

/* ── Top Header Bar ────────────────────────────────────────────────────────── */
.app-header {
    background: var(--wdl-navy);
    color: var(--wdl-white);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    /* iOS safe area */
    padding-top: calc(12px + env(safe-area-inset-top));
}

.app-header .header-title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.app-header .header-back {
    color: var(--wdl-white);
    font-size: 20px;
    text-decoration: none;
    padding: 4px 8px 4px 0;
}

/* ── Page Content ──────────────────────────────────────────────────────────── */
.page-content {
    padding: 16px;
    padding-bottom: calc(var(--bottom-nav-h) + 16px + env(safe-area-inset-bottom));
}

/* ── Bottom Navigation ─────────────────────────────────────────────────────── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: var(--bottom-nav-h);
    background: var(--wdl-white);
    border-top: 1px solid var(--wdl-border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--wdl-text-muted);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 8px;
    transition: color 0.15s;
}

.bottom-nav-item.active,
.bottom-nav-item:hover {
    color: var(--wdl-navy);
}

.bottom-nav-item svg,
.bottom-nav-item .nav-icon {
    font-size: 22px;
    width: 24px;
    height: 24px;
}

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.wdl-card {
    background: var(--wdl-card-bg);
    border-radius: var(--wdl-radius);
    box-shadow: var(--wdl-shadow);
    padding: 16px;
    margin-bottom: 12px;
}

.wdl-card-header {
    font-size: 13px;
    font-weight: 600;
    color: var(--wdl-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* ── Dashboard Hero Tiles ──────────────────────────────────────────────────── */
.hero-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.hero-scroll::-webkit-scrollbar { display: none; }

.hero-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 84px;
    height: 84px;
    background: var(--wdl-card-bg);
    border-radius: var(--wdl-radius);
    box-shadow: var(--wdl-shadow);
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    text-decoration: none;
    color: var(--wdl-text);
    padding: 8px 6px;
    gap: 6px;
    border: none;
    flex-shrink: 0;
}

.hero-tile:active { transform: scale(0.95); box-shadow: none; }

.hero-tile-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.hero-tile-label {
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
    color: var(--wdl-text);
}

/* ── Dashboard Section Small Tiles ────────────────────────────────────────── */
.section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--wdl-navy);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 8px;
    padding-left: 2px;
}

.tile-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.small-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--wdl-card-bg);
    border-radius: var(--wdl-radius-sm);
    box-shadow: var(--wdl-shadow);
    padding: 10px 4px;
    gap: 5px;
    cursor: pointer;
    text-decoration: none;
    color: var(--wdl-text);
    border: none;
    position: relative;
    transition: transform 0.1s;
}

.small-tile:active { transform: scale(0.93); }

.small-tile-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.small-tile-label {
    font-size: 10px;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
    color: var(--wdl-text);
}

.tile-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--wdl-danger);
    color: white;
    font-size: 9px;
    font-weight: 700;
    border-radius: 10px;
    padding: 1px 5px;
    min-width: 16px;
    text-align: center;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn-wdl-primary {
    background: var(--wdl-navy);
    color: var(--wdl-white);
    border: none;
    border-radius: var(--wdl-radius-sm);
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.15s;
    min-height: 52px;
}

.btn-wdl-primary:hover  { background: var(--wdl-navy-mid); }
.btn-wdl-primary:active { background: var(--wdl-navy-light); }
.btn-wdl-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-wdl-outline {
    background: transparent;
    color: var(--wdl-navy);
    border: 1.5px solid var(--wdl-navy);
    border-radius: var(--wdl-radius-sm);
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-wdl-outline:hover { background: rgba(11,36,71,0.06); }

/* ── Form Controls ─────────────────────────────────────────────────────────── */
.wdl-input {
    background: var(--wdl-white);
    border: 1.5px solid var(--wdl-border);
    border-radius: var(--wdl-radius-sm);
    padding: 14px 16px;
    font-size: 15px;
    width: 100%;
    color: var(--wdl-text);
    outline: none;
    transition: border-color 0.15s;
    -webkit-appearance: none;
}

.wdl-input:focus {
    border-color: var(--wdl-navy);
    box-shadow: 0 0 0 3px rgba(11,36,71,0.08);
}

.wdl-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--wdl-text-muted);
    margin-bottom: 6px;
    display: block;
}

/* ── Status Badges ─────────────────────────────────────────────────────────── */
.badge-present  { background: #E8F5E9; color: #2E7D32; }
.badge-absent   { background: #FFEBEE; color: #C62828; }
.badge-leave    { background: #FFF3E0; color: #E65100; }
.badge-holiday  { background: #E3F2FD; color: #1565C0; }
.badge-od       { background: #F3E5F5; color: #6A1B9A; }
.badge-halfday  { background: #FFF8E1; color: #F57F17; }
.badge-pending  { background: #FFF3E0; color: #E65100; }
.badge-approved { background: #E8F5E9; color: #2E7D32; }
.badge-rejected { background: #FFEBEE; color: #C62828; }

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ── Loading Spinner ───────────────────────────────────────────────────────── */
.wdl-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

.wdl-spinner-navy {
    border-color: rgba(11,36,71,0.2);
    border-top-color: var(--wdl-navy);
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Full-page loader ──────────────────────────────────────────────────────── */
.page-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60vh;
    gap: 12px;
    color: var(--wdl-text-muted);
    font-size: 14px;
}

/* ── Divider ───────────────────────────────────────────────────────────────── */
.wdl-divider {
    height: 1px;
    background: var(--wdl-border);
    margin: 12px 0;
}

/* ── Toast / Alert ─────────────────────────────────────────────────────────── */
.wdl-alert {
    border-radius: var(--wdl-radius-sm);
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 12px;
}

.wdl-alert-danger  { background: #FFEBEE; color: #C62828; border-left: 4px solid #C62828; }
.wdl-alert-success { background: #E8F5E9; color: #2E7D32; border-left: 4px solid #2E7D32; }
.wdl-alert-info    { background: #E3F2FD; color: #1565C0; border-left: 4px solid #1565C0; }
