/* RLL Bus System — Global Styles */
:root {
    --navy:    #1e3a5f;
    --blue:    #2563eb;
    --green:   #16a34a;
    --yellow:  #ca8a04;
    --red:     #dc2626;
    --gray:    #6b7280;
    --light:   #f3f4f6;
    --white:   #ffffff;
    --radius:  14px;
    --shadow:  0 1px 4px rgba(0,0,0,0.08);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f3f4f6;
    color: #1a1a1a;
    font-size: 13px;
    min-height: 100vh;
}

/* ── Header ── */
.header {
    background: var(--navy);
    color: var(--white);
    padding: 0 1rem;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header .brand { font-weight: 700; font-size: 1rem; display: flex; align-items: center; gap: .5rem; }
.header .brand span { font-size: 1.2rem; }
.header a.logout { color: #94a3b8; font-size: .85rem; text-decoration: none; }
.header a.logout:hover { color: var(--white); }

/* ── Breadcrumb ── */
.breadcrumb {
    background: var(--navy);
    color: #94a3b8;
    padding: .4rem 1rem;
    font-size: .82rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.breadcrumb a { color: #94a3b8; text-decoration: none; }
.breadcrumb a:hover { color: var(--white); }
.breadcrumb .current { color: var(--white); font-weight: 600; }

/* ── Main container ── */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.2rem 1rem;
}

/* ── Card ── */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.2rem;
    margin-bottom: 1rem;
}
.card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: .8rem;
    color: var(--navy);
}

/* ── Grid — admin / driver tiles ── */
.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: .75rem;
    margin-top: .5rem;
}
.tile {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.1rem .75rem .9rem;
    text-align: center;
    text-decoration: none;
    color: #1f2937;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .4rem;
    transition: transform .1s, box-shadow .1s;
}
.tile:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,0.15); }
.tile .icon { font-size: 2rem; }
.tile .label { font-size: .78rem; font-weight: 600; line-height: 1.2; }
.tile .sub   { font-size: .7rem; color: var(--gray); }

/* ── Section header in admin dashboard ── */
.section-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--gray);
    margin: 1.2rem 0 .5rem;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .45rem 1rem;
    border-radius: 6px;
    border: none;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: opacity .15s;
}
.btn:hover { opacity: .88; }
.btn-primary   { background: var(--blue);  color: var(--white); }
.btn-success   { background: var(--green); color: var(--white); }
.btn-danger    { background: var(--red);   color: var(--white); }
.btn-secondary { background: var(--navy);  color: var(--white); }
.btn-sm { padding: .3rem .7rem; font-size: .8rem; }

/* ── Badge / pill ── */
.badge {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
}
.badge-admin      { background: #dbeafe; color: #1d4ed8; }
.badge-supervisor { background: #e0e7ff; color: #4338ca; }
.badge-driver     { background: #dcfce7; color: #15803d; }
.badge-cleaner    { background: #fef9c3; color: #854d0e; }

/* ── Table ── */
.table-wrap { overflow-x: auto; }
table.rll-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}
table.rll-table th {
    background: var(--navy);
    color: var(--white);
    padding: .55rem .6rem;
    text-align: left;
    font-weight: 600;
    font-size: .8rem;
    white-space: nowrap;
}
table.rll-table td {
    padding: .45rem .6rem;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}
table.rll-table tr:hover td { background: #f9fafb; }
table.rll-table tr.highlight td { background: #fefce8; }

/* ── Forms ── */
.form-group { margin-bottom: .85rem; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .3rem; color: #374151; }
.form-control {
    width: 100%;
    padding: .5rem .75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: .95rem;
    outline: none;
}
.form-control:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }

/* ── Alert ── */
.alert {
    padding: .7rem 1rem;
    border-radius: 6px;
    margin-bottom: .75rem;
    font-size: .88rem;
}
.alert-danger  { background: #fee2e2; color: #991b1b; border-left: 3px solid var(--red); }
.alert-success { background: #dcfce7; color: #166534; border-left: 3px solid var(--green); }
.alert-warning { background: #fef9c3; color: #854d0e; border-left: 3px solid var(--yellow); }
.alert-info    { background: #dbeafe; color: #1d4ed8; border-left: 3px solid var(--blue); }

/* ── Status chips ── */
.status { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; font-weight: 600; }
.status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-ok     { color: var(--green);  } .status-ok::before  { background: var(--green); }
.status-warn   { color: var(--yellow); } .status-warn::before{ background: var(--yellow);}
.status-error  { color: var(--red);    } .status-error::before{ background: var(--red);  }

/* ── Login page ── */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a2744 0%, #2563eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.login-box {
    background: var(--white);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 340px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-box .app-icon { font-size: 3.5rem; margin-bottom: .5rem; }
.login-box h1 { font-size: 1.3rem; font-weight: 800; color: var(--navy); margin-bottom: .2rem; }
.login-box p  { font-size: .85rem; color: var(--gray); margin-bottom: 1.5rem; }
.pin-input {
    width: 100%;
    padding: .85rem;
    font-size: 1.4rem;
    text-align: center;
    letter-spacing: .3em;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 1rem;
    outline: none;
}
.pin-input:focus { border-color: var(--blue); }
.login-hint { font-size: .78rem; color: var(--gray); margin-top: .8rem; }

/* ── Duty roster ── */
.roster-wrap { overflow-x: auto; }
table.roster {
    border-collapse: collapse;
    font-size: .82rem;
    min-width: 600px;
}
table.roster th, table.roster td {
    border: 1px solid #e5e7eb;
    padding: .35rem .45rem;
    text-align: center;
    white-space: nowrap;
}
table.roster th { background: var(--navy); color: var(--white); font-size: .75rem; }
table.roster th.name-col { writing-mode: vertical-rl; transform: rotate(180deg); min-width: 32px; padding: .5rem .2rem; }
table.roster td.date-cell { text-align: left; font-weight: 600; min-width: 60px; }
table.roster td.ship-cell { text-align: left; color: var(--blue); font-size: .78rem; min-width: 100px; }
table.roster td.pax-cell  { color: var(--gray); }
table.roster td.yht-cell  { font-weight: 700; background: #f0f9ff; }
table.roster tr.week-row td { background: #f8fafc; font-weight: 700; font-size: .78rem; color: var(--navy); }
.roster-check { cursor: pointer; font-size: 1.1rem; }
.roster-check.on  { color: var(--green); }
.roster-check.off { color: #d1d5db; }
.roster-check.off-approved { color: var(--yellow); }

/* ── Mobile tweaks ── */
@media (max-width: 600px) {
    .tile-grid { grid-template-columns: repeat(2, 1fr); }
    .container { padding: .8rem .75rem; }
    .login-box { padding: 2rem 1.4rem; }
}
