/* ============================================================
   kompas.css  –  Shared stylesheet for the Kompas platform
   Colors based on the Kompas logo:
     Teal   #1a9c8a  (primary / green)
     Navy   #1e2d8a  (dark blue text in logo)
     Gold   #e8a820  (golden K circle in logo)
   ============================================================ */

/* ── Variables ── */
:root {
    --teal:        #1a9c8a;
    --teal-dark:   #158275;
    --navy:        #1e2d8a;
    --navy-dark:   #162270;
    --gold:        #e8a820;
    --gold-dark:   #c98e15;
    --light-bg:    #f0f2f8;
    --white:       #ffffff;
    --text:        #333333;
    --text-muted:  #666666;
    --border:      #dde2f0;
    --card-shadow: 0 2px 10px rgba(30, 45, 138, 0.09);
    --radius:      12px;
}

/* ── Reset ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    min-height: 100dvh;
    background-color: var(--light-bg);
    color: var(--text);
    display: flex;
    flex-direction: column;
    font-size: 16px;
    line-height: 1.5;
}

/* ================================================================
   HEADER  –  JVR school logo left, optional right section
   ================================================================ */
.kp-header {
    background-color: var(--teal);
    color: var(--white);
    padding: 0 2rem;
    height: 56px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.kp-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    width: 100%;
    gap: 1rem;
}

/* School logo in header */
.kp-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
    height: 100%;
}

.kp-logo img {
    height: 36px;
    width: auto;
    display: block;
}

/* Right side of header (user info, logout) */
.kp-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    min-width: 0;
}

.kp-user-name {
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.kp-btn-logout {
    color: var(--white);
    background: rgba(255, 255, 255, 0.18);
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.kp-btn-logout:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* ================================================================
   MAIN CONTENT  –  full width
   ================================================================ */
.kp-main {
    flex: 1;
    padding: 2rem;
    width: 100%;
}

/* ================================================================
   CARDS
   ================================================================ */
.kp-card {
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    padding: 1.75rem;
}

.kp-card + .kp-card {
    margin-top: 1.25rem;
}

.kp-card-gold  { border-top:  4px solid var(--gold); }
.kp-card-teal  { border-top:  4px solid var(--teal); }
.kp-card-navy  { border-left: 4px solid var(--navy); }

/* ================================================================
   BUTTONS
   ================================================================ */
.kp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 22px;
    min-height: 48px;
    border: none;
    border-radius: 9px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.15s, box-shadow 0.2s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.kp-btn-primary {
    background-color: var(--teal);
    color: var(--white);
    box-shadow: 0 3px 10px rgba(26, 156, 138, 0.3);
}

.kp-btn-primary:hover {
    background-color: var(--teal-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 14px rgba(26, 156, 138, 0.4);
}

.kp-btn-primary:active {
    transform: translateY(0);
}

.kp-btn-navy {
    background-color: var(--navy);
    color: var(--white);
    box-shadow: 0 3px 10px rgba(30, 45, 138, 0.3);
}

.kp-btn-navy:hover {
    background-color: var(--navy-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 14px rgba(30, 45, 138, 0.4);
}

.kp-btn-navy:active {
    transform: translateY(0);
}

.kp-btn-full {
    width: 100%;
}

/* ================================================================
   ALERTS
   ================================================================ */
.kp-alert-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    color: #991b1b;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

/* ================================================================
   BADGE
   ================================================================ */
.kp-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
    margin-top: 6px;
    background-color: #dde2f0;
    color: var(--navy);
}

/* ================================================================
   TITLES
   ================================================================ */
.kp-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 0.25rem;
}

.kp-page-sub {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

/* ================================================================
   MENU CARD GRID  (dashboard)
   ================================================================ */
.kp-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}

.kp-menu-card {
    background-color: var(--white);
    border-radius: var(--radius);
    padding: 1.75rem 1.25rem;
    box-shadow: var(--card-shadow);
    text-align: center;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: transform 0.2s, box-shadow 0.2s, border-bottom-color 0.2s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    text-decoration: none;
    color: inherit;
    display: block;
}

.kp-menu-card:not(.kp-menu-card--disabled):hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(26, 156, 138, 0.18);
    border-bottom-color: var(--teal);
}

.kp-menu-card i {
    font-size: 2.5rem;
    color: var(--teal);
    display: block;
    margin-bottom: 0.75rem;
}

.kp-menu-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: #222;
}

.kp-menu-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

.kp-menu-card--disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ================================================================
   LOGIN PAGE
   ================================================================ */
.kp-login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 2rem;
}

.kp-login-center {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.kp-login-logo {
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    padding: 2.5rem 2rem;
    text-align: center;
}

.kp-login-logo img {
    width: 100%;
    max-width: 380px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* ================================================================
   FOOTER
   ================================================================ */
.kp-footer {
    text-align: center;
    padding: 1rem 2rem;
    font-size: 0.82rem;
    color: #999;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.kp-footer a {
    color: var(--teal);
    text-decoration: none;
}

.kp-footer a:hover {
    text-decoration: underline;
}

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

/* Tablet */
@media (max-width: 768px) {
    .kp-header {
        padding: 0 1rem;
    }

    .kp-main {
        padding: 1.25rem 1rem;
    }

    .kp-login-wrap {
        align-items: flex-start;
        padding: 1.25rem 1rem;
    }

    .kp-login-logo {
        padding: 1.75rem 1.25rem;
    }
}

/* Phone */
@media (max-width: 480px) {
    .kp-header {
        padding: 0 0.75rem;
        height: 50px;
    }

    .kp-logo img {
        height: 30px;
    }

    .kp-user-name {
        display: none;
    }

    .kp-main {
        padding: 1rem 0.75rem;
    }

    .kp-card {
        padding: 1.25rem;
    }

    .kp-login-wrap {
        padding: 1rem 0.75rem;
    }

    .kp-login-logo {
        padding: 1.25rem 1rem;
    }

    .kp-menu-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .kp-menu-card {
        padding: 1.25rem 0.75rem;
    }

    .kp-page-title {
        font-size: 1.25rem;
    }

    .kp-btn {
        min-height: 50px;
    }
}

@media (max-width: 360px) {
    .kp-menu-grid {
        grid-template-columns: 1fr;
    }
}
