/* ============================================================
   Oxley Christian College — e-Forms Portal
   Global Stylesheet (ASP.NET MVC port)
   ============================================================ */

/* CSS Variables */
:root {
    --navy:         #1a237e;
    --navy-dark:    #0d1452;
    --navy-light:   #3949ab;
    --gold:         #f0c200;
    --gold-dark:    #c9a800;
    --grey-50:      #fafafa;
    --grey-100:     #f5f5f5;
    --grey-200:     #eeeeee;
    --grey-400:     #bdbdbd;
    --grey-600:     #757575;
    --grey-800:     #424242;
    --success:      #2e7d32;
    --success-bg:   #e8f5e9;
    --error:        #c62828;
    --error-bg:     #ffebee;
    --text:         #1a1a2e;
    --text-secondary: #555;
    --radius-sm:    6px;
    --radius:       8px;
    --radius-lg:    14px;
    --shadow-sm:    0 1px 3px rgba(0,0,0,.08);
    --shadow-md:    0 4px 12px rgba(0,0,0,.1);
    --shadow-lg:    0 8px 24px rgba(0,0,0,.14);
    --space-sm:     0.5rem;
    --space-md:     1rem;
    --space-lg:     1.5rem;
    --space-xl:     2rem;
    --space-2xl:    2.5rem;
    --font-sm:      0.875rem;
    --font-base:    1rem;
    --font-lg:      1.125rem;
    --font-xl:      1.375rem;
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Open Sans', system-ui, sans-serif;
    font-size: var(--font-base);
    color: var(--text);
    background: var(--grey-100);
    line-height: 1.5;
}
h1, h2, h3 { margin: 0 0 0.5rem; font-weight: 700; color: var(--navy); line-height: 1.2; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 0.5rem; }
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ── Header ──────────────────────────────────────────────── */
.app-header {
    background: var(--navy);
    box-shadow: var(--shadow-md);
    position: sticky; top: 0; z-index: 100;
}
.app-header__inner {
    max-width: 1280px; margin: 0 auto;
    display: flex; align-items: center; gap: 1rem;
    padding: 0.75rem 1.5rem;
}
.app-header__brand { display: flex; align-items: center; text-decoration: none; }
.brand-logo { height: 44px; width: auto; }

.app-header__nav {
    display: flex; gap: 0.25rem; flex: 1; margin-left: 1.5rem;
}
.nav-link {
    display: flex; align-items: center; gap: 0.4rem;
    color: rgba(255,255,255,.75); font-size: var(--font-sm); font-weight: 500;
    padding: 0.5rem 0.75rem; border-radius: var(--radius-sm);
    text-decoration: none; transition: background .15s, color .15s;
}
.nav-link:hover, .nav-link.active {
    background: rgba(255,255,255,.15); color: white; text-decoration: none;
}
.nav-link .material-icons { font-size: 18px; }

.app-header__user {
    display: flex; align-items: center; gap: 0.75rem; margin-left: auto;
}
.user-name { color: white; font-size: var(--font-sm); font-weight: 500; }

/* ── Layout ──────────────────────────────────────────────── */
#main-content { min-height: calc(100vh - 68px); }

.page-container {
    max-width: 1100px; margin: 0 auto;
    padding: var(--space-xl) var(--space-lg);
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.6rem 1.25rem; border-radius: var(--radius-sm);
    font-size: var(--font-sm); font-weight: 600; cursor: pointer;
    border: none; text-decoration: none; transition: background .15s, box-shadow .15s;
}
.btn:hover { text-decoration: none; }
.btn .material-icons { font-size: 18px; }

.btn--primary { background: var(--navy); color: white; }
.btn--primary:hover { background: var(--navy-light); color: white; }

.btn--secondary { background: white; color: var(--navy); border: 1.5px solid var(--navy); }
.btn--secondary:hover { background: var(--grey-50); }

.btn--sm { padding: 0.35rem 0.85rem; font-size: 0.8rem; }
.btn--sm .material-icons { font-size: 16px; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-icon-danger {
    background: none; border: none; cursor: pointer;
    color: var(--error); padding: 4px; border-radius: 4px;
    display: inline-flex; align-items: center;
}
.btn-icon-danger:hover { background: var(--error-bg); }
.btn-icon-danger .material-icons { font-size: 20px; }

/* ── Forms ──────────────────────────────────────────────── */
.form-control {
    display: block; width: 100%;
    padding: 0.55rem 0.85rem;
    border: 1.5px solid var(--grey-400);
    border-radius: var(--radius-sm);
    font-size: var(--font-sm);
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
    background: white;
}
.form-control:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(26,35,126,.12);
}
select.form-control { cursor: pointer; }

.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field label { font-size: var(--font-sm); font-weight: 600; color: var(--grey-800); }
.field .hint { font-size: 0.8rem; color: var(--grey-600); }

.field-group {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
    margin-bottom: 1rem;
}
@media (max-width: 600px) { .field-group { grid-template-columns: 1fr; } }

.required { color: var(--error); }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.75rem 1rem; border-radius: var(--radius-sm);
    font-size: var(--font-sm); font-weight: 500;
    margin-bottom: 1rem;
}
.alert--error  { background: var(--error-bg);   color: var(--error);   border-left: 3px solid var(--error); }
.alert--success { background: var(--success-bg); color: var(--success); border-left: 3px solid var(--success); }
.alert .material-icons { font-size: 20px; flex-shrink: 0; }

/* ── Form Sections ───────────────────────────────────────── */
.form-section {
    background: white; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm); margin-bottom: 1.5rem; overflow: hidden;
}
.form-section__header {
    display: flex; align-items: center; gap: 0.6rem;
    background: var(--navy); color: white;
    padding: 0.75rem 1.25rem; font-weight: 700; font-size: var(--font-sm);
    text-transform: uppercase; letter-spacing: 0.05em;
}
.form-section__header .material-icons { font-size: 18px; }
.form-section__body { padding: 1.25rem 1.5rem; }

.notice {
    display: flex; align-items: center; gap: 0.5rem;
    background: #fff8e1; border-left: 3px solid var(--gold-dark);
    padding: 0.6rem 1rem; border-radius: var(--radius-sm);
    font-size: var(--font-sm); color: var(--grey-800); margin-bottom: 1rem;
}
.notice .material-icons { font-size: 18px; color: var(--gold-dark); flex-shrink: 0; }

.page-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap;
}
.page-subtitle { color: var(--grey-600); font-size: var(--font-sm); margin: 0; }
.page-header__hint {
    display: flex; align-items: center; gap: 0.4rem;
    font-size: var(--font-sm); color: var(--grey-600);
    background: white; padding: 0.5rem 0.75rem; border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}
.page-header__hint .material-icons { font-size: 18px; }

/* ── Entries / Trips Table ───────────────────────────────── */
.entries-table-wrapper {
    overflow-x: auto; margin-bottom: 1rem; border-radius: var(--radius-sm);
    border: 1px solid var(--grey-200);
}
.entries-table {
    width: 100%; border-collapse: collapse; font-size: var(--font-sm);
}
.entries-table th {
    background: var(--grey-50); padding: 0.6rem 0.75rem;
    text-align: left; font-weight: 600; color: var(--grey-800);
    border-bottom: 2px solid var(--grey-200); white-space: nowrap;
}
.entries-table td {
    padding: 0.5rem 0.5rem; border-bottom: 1px solid var(--grey-100); vertical-align: middle;
}
.entries-table tr:last-child td { border-bottom: none; }
.entries-table .entry-num {
    color: var(--grey-600); font-weight: 700; text-align: center; width: 32px;
}
.entries-table .form-control { min-width: 100px; }

/* ── Totals ──────────────────────────────────────────────── */
.totals-table { max-width: 420px; margin-left: auto; margin-top: 1rem; }
.totals-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.6rem 1rem; border-bottom: 1px solid var(--grey-100);
    font-size: var(--font-sm);
}
.totals-row--total {
    background: var(--navy); color: white;
    border-radius: var(--radius-sm); margin-top: 0.5rem; border: none;
    font-size: var(--font-lg); font-weight: 700; padding: 0.75rem 1rem;
}

/* ── Declaration ─────────────────────────────────────────── */
.declaration-text {
    background: var(--grey-50); border-left: 4px solid var(--navy);
    padding: 0.75rem 1rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic; color: var(--text-secondary); margin-bottom: 1rem;
}

/* ── Form Actions ────────────────────────────────────────── */
.form-actions {
    display: flex; justify-content: space-between; align-items: center;
    gap: 1rem; margin-top: 1rem;
}

/* ── Login ───────────────────────────────────────────────── */
.login-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 60%, var(--navy-light) 100%);
    padding: 1.5rem;
}
.login-card {
    background: white; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); padding: var(--space-2xl);
    width: 100%; max-width: 460px;
}
.login-brand { text-align: center; margin-bottom: 1.5rem; }
.login-brand__logo { display: block; height: 80px; width: auto; margin: 0 auto 0.75rem; }
.login-brand__divider {
    width: 60px; height: 3px; background: var(--gold);
    border-radius: 2px; margin: 0.5rem auto;
}
.login-brand__tagline { font-size: var(--font-lg); color: var(--grey-600); font-weight: 500; }
.login-heading { font-size: var(--font-xl); text-align: center; margin-bottom: 1.25rem; }

.password-field { position: relative; }
.password-field .form-control { padding-right: 50px; }
.password-toggle {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; color: var(--grey-600);
    padding: 4px; display: flex; align-items: center;
}
.password-toggle:hover { color: var(--navy); }
.password-toggle .material-icons { font-size: 20px; }

.login-submit { width: 100%; justify-content: center; margin-top: 1.25rem; }

.demo-accounts { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--grey-100); }
.demo-accounts__heading {
    font-size: 12px; font-weight: 700; color: var(--grey-600);
    text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.5rem;
}
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.demo-account {
    background: var(--grey-50); border: 1px solid var(--grey-200);
    border-radius: var(--radius-sm); padding: 0.5rem 0.75rem;
    cursor: pointer; text-align: left; transition: border-color .15s;
}
.demo-account:hover { border-color: var(--navy); background: rgba(26,35,126,.04); }
.demo-account__role { display: block; font-size: 13px; font-weight: 700; color: var(--navy); }
.demo-account__email { display: block; font-size: 11px; color: var(--grey-600); margin-top: 2px; }

/* ── Dashboard ───────────────────────────────────────────── */
.dashboard-welcome {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap;
}
.welcome-sub { color: var(--grey-600); font-size: var(--font-sm); }
.welcome-date {
    font-size: var(--font-sm); color: var(--grey-600); font-weight: 500;
    background: white; padding: 0.5rem 1rem; border-radius: var(--radius);
    box-shadow: var(--shadow-sm); white-space: nowrap;
}

.action-cards {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1.5rem;
}
@media (max-width: 700px) { .action-cards { grid-template-columns: 1fr; } }

.action-card {
    display: flex; align-items: center; gap: 1rem; background: white;
    border-radius: var(--radius-lg); padding: 1.5rem;
    box-shadow: var(--shadow-md); text-decoration: none; color: inherit;
    border: 2px solid transparent; transition: border-color .15s, box-shadow .15s, transform .1s;
}
.action-card:hover {
    border-color: var(--navy); box-shadow: var(--shadow-lg);
    transform: translateY(-2px); text-decoration: none;
}
.action-card__icon {
    width: 60px; height: 60px; border-radius: 50%; flex-shrink: 0;
    background: rgba(26,35,126,.1); display: flex; align-items: center; justify-content: center;
}
.action-card__icon .material-icons { font-size: 30px; color: var(--navy); }
.action-card__icon--gold { background: rgba(240,194,0,.15); }
.action-card__icon--gold .material-icons { color: var(--gold-dark); }
.action-card__body { flex: 1; }
.action-card__body h3 { font-size: var(--font-lg); margin-bottom: 4px; }
.action-card__body p { font-size: var(--font-sm); color: var(--grey-600); margin: 0; }
.action-card__arrow { color: var(--grey-400); font-size: 22px; flex-shrink: 0; }

.dashboard-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem;
}
@media (max-width: 900px) { .dashboard-grid { grid-template-columns: 1fr; } }

/* ── Card ────────────────────────────────────────────────── */
.card {
    background: white; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm); padding: 1.25rem;
}

/* ── Data Table ──────────────────────────────────────────── */
.data-table {
    width: 100%; border-collapse: collapse; font-size: var(--font-sm);
}
.data-table th {
    text-align: left; padding: 0.5rem 0.75rem;
    border-bottom: 2px solid var(--grey-200);
    font-weight: 700; color: var(--grey-800); font-size: 12px;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.data-table td {
    padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--grey-100); vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--grey-50); }

/* ── Status Badges ───────────────────────────────────────── */
.status-badge {
    display: inline-block; padding: 2px 10px; border-radius: 99px;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
}
.status-badge--submitted    { background: #e3f2fd; color: #1565c0; }
.status-badge--dailyorg     { background: #fff3e0; color: #e65100; }
.status-badge--businessmgr  { background: #f3e5f5; color: #6a1b9a; }
.status-badge--complete     { background: #e8f5e9; color: #2e7d32; }

/* ── Detail / Approval sections ─────────────────────────────── */
.section-locked {
    opacity: 0.55; pointer-events: none;
}
.section-pending {
    border-left: 4px solid var(--grey-400);
}
.section-active {
    border-left: 4px solid var(--gold);
}
.section-approved {
    border-left: 4px solid var(--success);
}
.approval-stamp {
    display: flex; align-items: center; gap: 0.5rem;
    background: var(--success-bg); color: var(--success);
    border-radius: var(--radius-sm); padding: 0.6rem 1rem;
    font-size: var(--font-sm); font-weight: 600; margin-bottom: 1rem;
}
.approval-stamp .material-icons { font-size: 20px; }
.awaiting-notice {
    display: flex; align-items: center; gap: 0.5rem;
    background: var(--grey-100); color: var(--grey-600);
    border-radius: var(--radius-sm); padding: 0.75rem 1rem;
    font-size: var(--font-sm); font-style: italic;
}
.awaiting-notice .material-icons { font-size: 20px; }
.detail-field {
    display: flex; flex-direction: column; gap: 2px; margin-bottom: 0.75rem;
}
.detail-field label { font-size: 11px; font-weight: 700; color: var(--grey-600); text-transform: uppercase; letter-spacing: 0.05em; }
.detail-field span  { font-size: var(--font-sm); color: var(--text); font-weight: 500; }
.detail-row { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-bottom: 0.5rem; }

/* ── Utility ─────────────────────────────────────────────── */
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.mb-md { margin-bottom: 1rem; }

.empty-state {
    text-align: center; padding: 2.5rem 1rem; color: var(--grey-600);
}
.empty-state .material-icons { font-size: 48px; color: var(--grey-400); display: block; margin-bottom: 0.75rem; }
.empty-state p { margin-bottom: 0.75rem; }

.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
