/* =====================================================================
   INTER PRESS OF TANZANIA LTD — STAFF PORTAL
   Brand: Red / White / Charcoal Grey — sans-serif only, no emojis/icons-as-decoration
   ===================================================================== */
:root {
    --ip-red: #A61E28;
    --ip-red-dark: #7E1620;
    --ip-charcoal: #2B2B2E;
    --ip-charcoal-light: #4A4A4E;
    --ip-grey-bg: #F4F4F5;
    --ip-border: #E0E0E2;
    --ip-white: #FFFFFF;
    --font-main: 'Segoe UI', Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-main);
    background: var(--ip-grey-bg);
    color: var(--ip-charcoal);
    font-size: 15px;
    line-height: 1.5;
}

a { color: var(--ip-red); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------- LOGIN PAGE (split layout: text left / form right) ---------------- */
.login-wrap {
    display: flex;
    min-height: 100vh;
}
.login-left {
    flex: 1.1;
    position: relative;
    background: #2B2B2E url('/assets/images/hero.jpg') center center / cover no-repeat;
}
.login-left-overlay {
    position: absolute;
    inset: 0;
    background: rgba(166, 30, 40, 0.28);
}

.login-right {
    flex: 1;
    background: var(--ip-white);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}
.login-box { width: 100%; max-width: 360px; }
.login-box-logo { display:block; height: 68px; width: auto; max-width: 100%; object-fit: contain; margin: 0 0 26px; }
.login-box h2 { font-size: 22px; font-weight: 600; margin-bottom: 6px; color: var(--ip-charcoal); text-align:left; }
.login-box .sub { color: #777; font-size: 13.5px; margin-bottom: 30px; text-align:left; }

.form-group { margin-bottom: 18px; }
.form-group label {
    display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px;
    color: var(--ip-charcoal-light); text-transform: uppercase; letter-spacing: 0.4px;
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 11px 13px; border: 1px solid var(--ip-border); border-radius: 4px;
    font-family: var(--font-main); font-size: 14.5px; background: var(--ip-white); color: var(--ip-charcoal);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--ip-red);
}

.btn {
    display: inline-block; padding: 11px 22px; border-radius: 4px; border: none;
    font-family: var(--font-main); font-size: 14.5px; font-weight: 600; cursor: pointer;
    text-align: center;
}
.btn-primary { background: var(--ip-red); color: var(--ip-white); width: 100%; }
.btn-primary:hover { background: var(--ip-red-dark); }
.btn-outline { background: transparent; border: 1px solid var(--ip-red); color: var(--ip-red); }
.btn-secondary { background: var(--ip-charcoal); color: var(--ip-white); }

.password-field { position: relative; }
.password-field input { padding-right: 42px; }
.toggle-password {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    background: none; border: none; padding: 4px; cursor: pointer; color: #999;
    display: flex; align-items: center;
}
.toggle-password:hover { color: var(--ip-red); }

.error-msg {
    background: #FCEBEC; border: 1px solid var(--ip-red); color: var(--ip-red-dark);
    padding: 10px 14px; border-radius: 4px; font-size: 13.5px; margin-bottom: 18px;
}

/* ---------------- APP SHELL (sidebar + content) ---------------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 260px; background: var(--ip-charcoal); color: var(--ip-white);
    padding: 26px 0; flex-shrink: 0;
}
.sidebar .brand { padding: 0 24px 22px; border-bottom: 1px solid #444; margin-bottom: 20px; text-align:center; }
.sidebar .brand img { width: 100%; max-width: 150px; height: auto; object-fit: contain; }
.sidebar .brand div { font-size: 12.5px; color: #B9B9BC; margin-top: 10px; letter-spacing: 0.3px; }
.sidebar nav a {
    display: block; padding: 11px 24px; color: #D8D8DA; font-size: 14px; border-left: 3px solid transparent;
}
.sidebar nav a:hover, .sidebar nav a.active {
    background: rgba(166,30,40,0.18); color: var(--ip-white); border-left-color: var(--ip-red); text-decoration: none;
}
.sidebar .section-label {
    padding: 18px 24px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #8A8A8E;
}

.hamburger-btn {
    display: none; flex-direction: column; justify-content: center; gap: 4px;
    width: 32px; height: 32px; background: none; border: none; cursor: pointer; padding: 0;
}
.hamburger-btn span { display: block; width: 100%; height: 2.5px; background: var(--ip-charcoal); border-radius: 2px; }

.sidebar-close { display: none; }
.sidebar-overlay { display: none; }

.main-content { flex: 1; padding: 32px 40px; min-width: 0; }
.topbar {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; flex-wrap: wrap; gap: 12px;
}
.topbar h1 { font-size: 22px; font-weight: 600; color: var(--ip-charcoal); }
.topbar .user-chip { font-size: 13.5px; color: var(--ip-charcoal-light); }
.topbar .user-chip strong { color: var(--ip-charcoal); }

.card {
    background: var(--ip-white); border: 1px solid var(--ip-border); border-radius: 6px;
    padding: 22px 24px; margin-bottom: 22px; max-width: 100%; overflow-x: auto;
}

table { width: 100%; border-collapse: collapse; }
table th {
    text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px;
    color: var(--ip-charcoal-light); border-bottom: 2px solid var(--ip-border); padding: 10px 12px;
}
table td { padding: 11px 12px; border-bottom: 1px solid var(--ip-border); font-size: 14px; }
table tr:hover td { background: #FAFAFA; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-ontime { background: #E6F4EA; color: #1E7A34; }
.badge-late { background: #FFF2DA; color: #9C6500; }
.badge-absent { background: #FCEBEC; color: var(--ip-red-dark); }
.badge-sick { background: #EAEAF7; color: #3E3E8C; }
.badge-special { background: #E8F2FB; color: #1D5D96; }
.badge-offshift { background: #EFEFEF; color: #555; }
.badge-pending { background: #F0F0F0; color: #888; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

@media print {
    .sidebar, .topbar, .no-print { display: none !important; }
    .main-content { padding: 0; }
    body { background: var(--ip-white); }
}

/* ===================== MOBILE RESPONSIVE ===================== */
@media (max-width: 900px) {
    .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    /* Login page: hero becomes a full-screen background, form floats on top as a card */
    .login-wrap { align-items: center; justify-content: center; padding: 20px; }
    .login-left { position: fixed; inset: 0; z-index: 1; }
    .login-right {
        position: relative; z-index: 2; width: 100%; max-width: 380px; margin: auto;
        padding: 30px 26px; background: rgba(255,255,255,0.96); border-radius: 12px;
        box-shadow: 0 12px 40px rgba(0,0,0,0.3);
    }
    .login-box { max-width: 100%; }

    /* App shell: sidebar becomes an off-canvas drawer */
    .app-shell { position: relative; }
    .sidebar {
        position: fixed; top: 0; left: 0; height: 100vh; z-index: 40;
        transform: translateX(-100%); transition: transform 0.25s ease;
        width: 82%; max-width: 300px; overflow-y: auto;
    }
    .sidebar.sidebar-open { transform: translateX(0); }
    .sidebar-close {
        display: block; position: absolute; top: 14px; right: 16px; background: none; border: none;
        color: var(--ip-white); font-size: 26px; line-height: 1; cursor: pointer; z-index: 41;
    }
    .sidebar-overlay {
        display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 35;
    }
    .sidebar-overlay.sidebar-overlay-visible { display: block; }

    .hamburger-btn { display: flex; }

    .main-content { padding: 18px 16px; }
    .topbar h1 { font-size: 18px; }
    .topbar { align-items: flex-start; }
    .topbar .user-chip { font-size: 12px; }

    .card { padding: 16px; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; gap: 14px; }

    table { display: block; overflow-x: auto; white-space: nowrap; }

    .btn { padding: 12px 18px; font-size: 14px; }
}
