/* ==========================================================================
   AJT Incident Notification Report System
   Shared style — navy-blue glassmorphism, Inter font (matches AJT's other
   internal web systems: HR, Asset, Attendance, Task Tracker, Transport).
   ========================================================================== */

:root {
    --navy-900: #060b18;
    --navy-800: #0a1128;
    --navy-700: #101a3a;
    --navy-600: #16224a;
    --accent: #2a78d6;
    --accent-light: #5598e7;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted: #8b93ab;
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.14);
    --good: #0ca30c;
    --warning: #fab219;
    --serious: #ec835a;
    --critical: #d03b3b;
    --radius: 16px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: linear-gradient(160deg, var(--navy-900) 0%, var(--navy-800) 55%, var(--navy-700) 100%);
    color: var(--text-primary);
    min-height: 100vh;
}

#particles-js {
    position: fixed;
    inset: 0;
    z-index: 0;
}

.page-wrap {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- Glass card ---------- */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

/* ---------- Language switcher (public form only) ---------- */
.lang-switch {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    background: rgba(255,255,255,0.07);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 6px 12px;
    backdrop-filter: blur(10px);
}
.lang-switch a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 2px 4px;
}
.lang-switch a.active { color: #fff; }
.lang-switch span { color: var(--text-muted); }

/* ---------- Top brand bar ---------- */
.brand-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 22px 16px 6px;
    text-align: center;
}
.brand-bar .brand-name {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.04em;
}
.brand-bar .brand-sub {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Clickable AJT logo + name — used in the public form, login page, and admin topbar */
.brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}
.brand-logo {
    height: 34px;
    width: 34px;
    flex-shrink: 0;
    display: block;
}
.admin-topbar .brand-logo { height: 28px; width: 28px; }

/* ---------- Centered auth / form container ---------- */
.center-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px 48px;
}

.form-card {
    width: 100%;
    max-width: 560px;
    padding: 32px 28px;
}
.form-card.narrow { max-width: 420px; }

.form-card h1 {
    font-size: 1.4rem;
    margin: 0 0 4px;
}
.form-card .subtitle {
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin: 0 0 24px;
}

/* ---------- Form controls ---------- */
label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 16px 0 6px;
}
label.required::after { content: " *"; color: var(--serious); }

input[type="text"],
input[type="password"],
input[type="datetime-local"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input:focus, select:focus, textarea:focus {
    border-color: var(--accent-light);
    background: rgba(255, 255, 255, 0.09);
}
textarea { resize: vertical; min-height: 110px; }
select option { background: var(--navy-800); color: var(--text-primary); }

.help-text {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 560px) {
    .field-row { grid-template-columns: 1fr; }
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 18px;
    margin-top: 26px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    color: #fff;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.98rem;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.15s;
    box-shadow: 0 6px 18px rgba(42, 120, 214, 0.35);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(42, 120, 214, 0.45); }
.btn:active { transform: translateY(0); }
.btn.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: none;
    border: 1px solid var(--glass-border);
}
.btn.btn-small { width: auto; padding: 8px 14px; margin-top: 0; font-size: 0.85rem; }
.btn.btn-danger { background: linear-gradient(135deg, var(--critical) 0%, #a3401f 100%); box-shadow: none; }

/* ---------- Alerts ---------- */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.88rem;
    margin-bottom: 18px;
}
.alert-error   { background: rgba(208,59,59,0.15); border: 1px solid rgba(208,59,59,0.35); color: #ffb4b0; }
.alert-success { background: rgba(12,163,12,0.15); border: 1px solid rgba(12,163,12,0.35); color: #8fe58f; }

/* ---------- Confirmation screen ---------- */
.confirm-icon {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: rgba(12,163,12,0.15);
    color: var(--good);
    display: flex; align-items: center; justify-content: center;
    font-size: 32px;
    margin: 0 auto 18px;
}
.incident-code-box {
    text-align: center;
    background: rgba(255,255,255,0.06);
    border: 1px dashed var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    margin: 18px 0;
}
.incident-code-box .code {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: var(--accent-light);
}

/* ==========================================================================
   Admin dashboard layout
   ========================================================================== */
.admin-shell { display: flex; min-height: 100vh; position: relative; z-index: 1; }

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(255,255,255,0.03);
}
.admin-topbar .brand-name { font-weight: 700; }
.admin-topbar .user-chip {
    display: flex; align-items: center; gap: 10px;
    font-size: 0.85rem; color: var(--text-secondary);
}
.admin-main { flex: 1; padding: 26px 28px 60px; max-width: 1280px; margin: 0 auto; width: 100%; }

.nav-tabs { display: flex; gap: 8px; margin-bottom: 22px; flex-wrap: wrap; }
.nav-tabs a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 9px 16px;
    border-radius: 9px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid transparent;
}
.nav-tabs a.active, .nav-tabs a:hover {
    background: rgba(255,255,255,0.07);
    border-color: var(--glass-border);
    color: #fff;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.stat-card {
    padding: 18px 20px;
}
.stat-card .stat-value { font-size: 1.7rem; font-weight: 800; }
.stat-card .stat-label { color: var(--text-secondary); font-size: 0.82rem; margin-top: 4px; }

.panel { padding: 22px 24px; margin-bottom: 24px; }
.panel h2 { margin: 0 0 16px; font-size: 1.05rem; }

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}
.filter-bar select, .filter-bar input[type="text"], .filter-bar input[type="date"] {
    width: auto;
    padding: 9px 12px;
    font-size: 0.85rem;
}
.filter-bar .btn { width: auto; margin: 0; padding: 9px 16px; }

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
table.data-table th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 10px 12px;
    border-bottom: 1px solid var(--glass-border);
}
table.data-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    vertical-align: middle;
}
table.data-table tr:hover td { background: rgba(255,255,255,0.03); }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

/* Simple bar chart (Incidents by Factory) */
.bar-chart-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.bar-chart-row .bar-label { width: 130px; font-size: 0.85rem; color: var(--text-secondary); flex-shrink: 0; }
.bar-chart-track { flex: 1; height: 12px; background: rgba(255,255,255,0.07); border-radius: 6px; overflow: hidden; }
.bar-chart-fill { height: 100%; border-radius: 6px; }
.bar-chart-row .bar-value { width: 36px; text-align: right; font-weight: 700; font-size: 0.85rem; }

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
@media (max-width: 700px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-item .dt-label { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 3px; }
.detail-item .dt-value { font-size: 0.95rem; }

.photo-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.photo-grid a img {
    width: 110px; height: 110px; object-fit: cover;
    border-radius: 10px; border: 1px solid var(--glass-border);
}

.back-link { color: var(--text-secondary); text-decoration: none; font-size: 0.88rem; }
.back-link:hover { color: #fff; }

@media (max-width: 700px) {
    .admin-main { padding: 20px 14px 40px; }
    .admin-topbar { padding: 14px 16px; }
    table.data-table { display: block; overflow-x: auto; white-space: nowrap; }
}
