/* ── LCB IT Helpdesk Stylesheet ─────────────────────────────────────────────── */

:root {
    --navy:       #1A235A;
    --navy-dark:  #111840;
    --navy-light: #2a3570;
    --red:        #B51C1C;
    --red-dark:   #8f1515;
    --white:      #ffffff;
    --gray-50:    #f8f9fa;
    --gray-100:   #f1f3f5;
    --gray-200:   #e9ecef;
    --gray-400:   #ced4da;
    --gray-600:   #6c757d;
    --gray-800:   #343a40;
    --green:      #198754;
    --orange:     #e07b00;
    --font:       'Segoe UI', system-ui, -apple-system, sans-serif;
    --radius:     8px;
    --shadow:     0 2px 8px rgba(0,0,0,0.10);
    --shadow-md:  0 4px 16px rgba(0,0,0,0.13);
}

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

body {
    font-family: var(--font);
    background: var(--gray-100);
    color: var(--gray-800);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Header ─────────────────────────────────────────────────────────────────── */
.site-header {
    background: var(--navy);
    color: var(--white);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    gap: 1rem;
}
.header-brand { display: flex; align-items: center; gap: 0.75rem; }
.header-logo  { height: 44px; width: auto; object-fit: contain; }
.header-title-block { display: flex; flex-direction: column; }
.header-title    { font-size: 1.1rem; font-weight: 700; color: var(--white); line-height: 1.2; }
.header-subtitle { font-size: 0.72rem; color: rgba(255,255,255,0.65); }
.header-right    { display: flex; align-items: center; gap: 0.75rem; }
.header-user     { font-size: 0.85rem; color: rgba(255,255,255,0.85); display: flex; align-items: center; gap: 0.4rem; }

.role-badge {
    font-size: 0.68rem;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.role-it_staff   { background: rgba(255,255,255,0.2); color: var(--white); }
.role-management { background: var(--red); color: var(--white); }

.hamburger {
    display: none;
    background: none;
    border: 1px solid rgba(255,255,255,0.35);
    color: var(--white);
    font-size: 1.2rem;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
}

.main-nav {
    display: flex;
    gap: 0;
    padding: 0 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    overflow-x: auto;
}
.nav-link {
    padding: 0.65rem 1.1rem;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}
.nav-link:hover { color: var(--white); border-bottom-color: rgba(255,255,255,0.4); }
.nav-link.active { color: var(--white); border-bottom-color: var(--red); font-weight: 600; }

/* ── Main & Footer ───────────────────────────────────────────────────────────── */
.main-content { flex: 1; padding: 1.5rem; }
.site-footer {
    background: var(--navy-dark);
    color: rgba(255,255,255,0.5);
    text-align: center;
    font-size: 0.78rem;
    padding: 0.85rem 1rem;
}

/* ── Page containers ─────────────────────────────────────────────────────────── */
.page-container { max-width: 820px; margin: 0 auto; }
.page-wide      { max-width: 1200px; margin: 0 auto; }

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1.2rem;
    border-radius: var(--radius);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: 2px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.btn-primary  { background: var(--red); color: var(--white); border-color: var(--red); }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn-outline  { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: var(--white); }
.btn-outline-sm { padding: 0.3rem 0.8rem; font-size: 0.78rem; background: transparent; color: rgba(255,255,255,0.85); border: 1px solid rgba(255,255,255,0.35); border-radius: 4px; cursor: pointer; text-decoration: none; }
.btn-outline-sm:hover { background: rgba(255,255,255,0.1); }
.btn-ghost    { background: transparent; color: var(--gray-600); border-color: var(--gray-400); }
.btn-ghost:hover { background: var(--gray-200); }
.btn-full     { width: 100%; }

/* ── Alerts ──────────────────────────────────────────────────────────────────── */
.alert { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.88rem; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: var(--red); }
.alert p { margin: 0; }

/* ── Form elements ───────────────────────────────────────────────────────────── */
.form-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--gray-600);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
}
.required { color: var(--red); }
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1.5px solid var(--gray-400);
    border-radius: var(--radius);
    font-size: 0.92rem;
    font-family: var(--font);
    color: var(--gray-800);
    background: var(--white);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(26,35,90,0.12);
}
.form-textarea { resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { margin-bottom: 1rem; }

/* ── Channel buttons ─────────────────────────────────────────────────────────── */
.channel-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.channel-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.55rem 0.9rem;
    border: 2px solid var(--gray-400);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-600);
    background: var(--white);
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    flex: 1;
    min-width: 80px;
}
.channel-btn input[type="radio"] { display: none; }
.channel-btn:hover { border-color: var(--navy); color: var(--navy); }
.channel-btn.selected { border-color: var(--navy); background: rgba(26,35,90,0.06); color: var(--navy); }
.channel-icon { font-size: 1.3rem; }

/* ── Category tiles ──────────────────────────────────────────────────────────── */
.category-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.category-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.75rem 0.5rem;
    border: 2px solid var(--gray-400);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-600);
    background: var(--white);
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    text-align: center;
}
.category-tile input[type="radio"] { display: none; }
.category-tile:hover { border-color: var(--navy); color: var(--navy); }
.category-tile.selected { border-color: var(--navy); background: rgba(26,35,90,0.06); color: var(--navy); }
.tile-icon { font-size: 1.5rem; }

/* ── Voice tip ───────────────────────────────────────────────────────────────── */
.voice-tip {
    background: rgba(26,35,90,0.05);
    border-left: 3px solid var(--navy);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 0.65rem 0.9rem;
    font-size: 0.82rem;
    color: var(--gray-600);
    margin-bottom: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-start;
}
.voice-tip strong { color: var(--navy); }
kbd { background: var(--gray-200); border: 1px solid var(--gray-400); border-radius: 3px; padding: 0.1rem 0.35rem; font-size: 0.78rem; font-family: monospace; }

/* ── Form card ───────────────────────────────────────────────────────────────── */
.form-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 2rem;
}
.form-card-header { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; }
.form-icon { font-size: 2rem; line-height: 1; }
.form-title { font-size: 1.3rem; font-weight: 700; color: var(--navy); }
.form-subtitle { font-size: 0.85rem; color: var(--gray-600); margin-top: 0.2rem; }

/* ── Confirmation card ───────────────────────────────────────────────────────── */
.confirmation-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 2.5rem 2rem;
    text-align: center;
    max-width: 500px;
    margin: 2rem auto;
}
.confirmation-icon {
    width: 64px; height: 64px;
    background: var(--green);
    color: var(--white);
    border-radius: 50%;
    font-size: 2rem;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem;
}
.confirmation-title { font-size: 1.4rem; font-weight: 700; color: var(--navy); margin-bottom: 0.4rem; }
.confirmation-subtitle { color: var(--gray-600); font-size: 0.9rem; margin-bottom: 1.5rem; }
.ticket-ref-box {
    background: var(--gray-50);
    border: 2px dashed var(--navy);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
}
.ticket-ref-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; color: var(--gray-600); text-transform: uppercase; }
.ticket-ref-number { font-size: 1.6rem; font-weight: 800; color: var(--navy); letter-spacing: 0.05em; }
.confirmation-note { font-size: 0.82rem; color: var(--gray-600); margin-bottom: 1.5rem; }
.confirmation-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

/* ── Board header ────────────────────────────────────────────────────────────── */
.board-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    gap: 1rem;
    flex-wrap: wrap;
}
.page-title { font-size: 1.4rem; font-weight: 700; color: var(--navy); }
.page-subtitle { font-size: 0.85rem; color: var(--gray-600); margin-top: 0.15rem; }

/* ── Filter bar ──────────────────────────────────────────────────────────────── */
.filter-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1.25rem;
    background: var(--white);
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.filter-search { flex: 1; min-width: 180px; }
.filter-select { width: auto; min-width: 120px; }

/* ── Table ───────────────────────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); }
.ticket-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    font-size: 0.85rem;
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    overflow: hidden;
}
.ticket-table thead { background: var(--navy); color: var(--white); }
.ticket-table th {
    padding: 0.75rem 0.85rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}
.ticket-table td {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: middle;
    white-space: nowrap;
}
.ticket-table tbody tr:hover { background: var(--gray-50); }
.ticket-table tbody tr:last-child td { border-bottom: none; }
.ticket-ref { font-weight: 700; color: var(--navy); font-size: 0.82rem; }
.empty-row { text-align: center; color: var(--gray-600); padding: 2rem !important; }
.date-cell { font-size: 0.8rem; color: var(--gray-600); }

/* ── Inline selects ──────────────────────────────────────────────────────────── */
.inline-form { display: inline; }
.inline-select {
    padding: 0.3rem 0.5rem;
    border: 1.5px solid var(--gray-400);
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: var(--font);
    cursor: pointer;
    background: var(--white);
    color: var(--gray-800);
}
.inline-select:focus { outline: none; border-color: var(--navy); }
.status-new         { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.status-in-progress { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.status-closed      { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }

/* ── Badges ──────────────────────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}
.badge-low        { background: #f0fdf4; color: #15803d; }
.badge-medium     { background: #eff6ff; color: #1d4ed8; }
.badge-high       { background: #fff7ed; color: #c2410c; }
.badge-critical   { background: #fef2f2; color: #b91c1c; }
.badge-new        { background: #eff6ff; color: #1d4ed8; }
.badge-inprogress { background: #fff7ed; color: #c2410c; }
.badge-closed     { background: #f0fdf4; color: #15803d; }

/* ── Mobile ticket cards ─────────────────────────────────────────────────────── */
.ticket-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem;
    margin-bottom: 0.75rem;
}
.ticket-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.ticket-card-body { margin-bottom: 0.75rem; }
.ticket-requester { font-size: 0.9rem; margin-bottom: 0.3rem; }
.ticket-desc { font-size: 0.82rem; color: var(--gray-600); margin-bottom: 0.5rem; }
.ticket-meta { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.meta-cat, .meta-via, .meta-date { font-size: 0.75rem; color: var(--gray-600); }
.ticket-card-actions .card-update-form { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.ticket-card-actions .form-select { flex: 1; min-width: 120px; font-size: 0.82rem; padding: 0.4rem 0.6rem; }
.empty-card { text-align: center; color: var(--gray-600); padding: 2rem; background: var(--white); border-radius: var(--radius); }

/* ── KPI cards ───────────────────────────────────────────────────────────────── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.kpi-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem 1rem;
    text-align: center;
}
.kpi-value { font-size: 2.2rem; font-weight: 800; line-height: 1; margin-bottom: 0.35rem; }
.kpi-value.navy  { color: var(--navy); }
.kpi-value.red   { color: var(--red); }
.kpi-value.green { color: var(--green); }
.kpi-label { font-size: 0.78rem; color: var(--gray-600); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }

/* ── Charts ──────────────────────────────────────────────────────────────────── */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.chart-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
}
.chart-title { font-size: 0.9rem; font-weight: 700; color: var(--navy); margin-bottom: 1rem; }
.bar-row { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.65rem; }
.bar-label { font-size: 0.8rem; color: var(--gray-800); min-width: 90px; }
.bar-track { flex: 1; background: var(--gray-200); border-radius: 4px; height: 10px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; transition: width 0.4s ease; min-width: 2px; }
.navy-fill   { background: var(--navy); }
.red-fill    { background: var(--red); }
.green-fill  { background: var(--green); }
.orange-fill { background: var(--orange); }
.gray-fill   { background: var(--gray-400); }
.bar-count { font-size: 0.8rem; font-weight: 700; color: var(--gray-800); min-width: 24px; text-align: right; }
.mt-4 { margin-top: 1rem; }

/* ── Login page ──────────────────────────────────────────────────────────────── */
.login-body { background: var(--navy); display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-container { width: 100%; max-width: 420px; padding: 1rem; }
.login-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    padding: 2.5rem 2rem;
}
.login-logo-wrap { text-align: center; margin-bottom: 1rem; }
.login-logo { height: 80px; width: auto; }
.login-title { font-size: 1.4rem; font-weight: 800; color: var(--navy); text-align: center; margin-bottom: 0.25rem; }
.login-subtitle { font-size: 0.85rem; color: var(--gray-600); text-align: center; margin-bottom: 1.5rem; }
.login-form .form-group { margin-bottom: 1rem; }
.login-accounts { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--gray-200); }
.login-accounts-title { font-size: 0.78rem; font-weight: 700; color: var(--gray-600); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
.demo-table { width: 100%; font-size: 0.78rem; border-collapse: collapse; }
.demo-table th, .demo-table td { padding: 0.3rem 0.5rem; text-align: left; border-bottom: 1px solid var(--gray-200); }
.demo-table th { color: var(--gray-600); font-weight: 600; }
.login-accounts-note { font-size: 0.72rem; color: var(--gray-600); margin-top: 0.5rem; }
code { background: var(--gray-100); padding: 0.1rem 0.3rem; border-radius: 3px; font-size: 0.78rem; }

/* ── Responsive ──────────────────────────────────────────────────────────────── */
.desktop-only { display: block; }
.mobile-only  { display: none; }

@media (max-width: 768px) {
    .header-right { display: none; }
    .hamburger { display: block; }
    .main-nav { display: none; flex-direction: column; padding: 0; }
    .main-nav.open { display: flex; }
    .nav-link { padding: 0.85rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.1); border-left: 3px solid transparent; }
    .nav-link.active { border-left-color: var(--red); border-bottom-color: rgba(255,255,255,0.1); }

    .form-row { grid-template-columns: 1fr; }
    .category-tiles { grid-template-columns: repeat(2, 1fr); }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .charts-grid { grid-template-columns: 1fr; }
    .form-card { padding: 1.25rem; }

    .desktop-only { display: none; }
    .mobile-only  { display: block; }

    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-search, .filter-select { width: 100%; }

    .board-header { flex-direction: column; align-items: flex-start; }
    .bar-label { min-width: 70px; }
}

@media (max-width: 480px) {
    .header-inner { padding: 0.6rem 1rem; }
    .main-content { padding: 1rem; }
    .kpi-grid { grid-template-columns: 1fr 1fr; gap: 0.65rem; }
    .kpi-value { font-size: 1.8rem; }
    .channel-buttons { flex-direction: column; }
    .channel-btn { flex-direction: row; justify-content: flex-start; }
}
