/* ======================================================
   theme.css - Corporate Clean Theme
   ขาว + น้ำเงินเข้ม/ฟ้า ตาม Design Style ที่ Lock ไว้
   ====================================================== */

:root {
    --brand-navy:   #0B2447;
    --brand-blue:   #1B6FC9;
    --brand-blue-lt:#E8F1FC;
    --brand-bg:     #F6F7F9;
    --brand-white:  #FFFFFF;
    --brand-border: #E2E6EC;
}

body {
    background-color: var(--brand-bg);
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    padding-bottom: 76px; /* กันพื้นที่ Bottom Nav มือถือ */
}

body.admin-layout {
    padding-bottom: 0;
}

/* ---------- Top Navbar ---------- */
.app-navbar {
    background-color: var(--brand-navy);
}

/* ---------- Mobile Page Padding (ตาม UI Guideline: ~16px) ---------- */
.app-content {
    padding: 16px;
}

.page-title {
    color: var(--brand-navy);
    font-weight: 600;
    margin-bottom: 16px;
}

/* ---------- Card เมนูหลัก (มือถือ) ---------- */
.menu-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--brand-white);
    border: 1px solid var(--brand-border);
    border-radius: 12px;
    padding: 18px 8px;
    text-decoration: none;
    color: var(--brand-navy);
    font-size: 14px;
    font-weight: 500;
    min-height: 90px;
    transition: box-shadow .15s ease;
}
.menu-card:hover, .menu-card:active {
    box-shadow: 0 2px 10px rgba(11,36,71,.12);
    color: var(--brand-blue);
}
.menu-card i { font-size: 26px; color: var(--brand-blue); }

.section-heading {
    color: var(--brand-navy);
    font-weight: 600;
    margin-top: 8px;
}

/* ---------- Placeholder Card (หน้า Template ที่ยังไม่มี Logic จริง) ---------- */
.placeholder-card {
    border: 1px dashed var(--brand-border);
    border-radius: 10px;
    background: var(--brand-white);
}

/* ---------- Bottom Navigation (มือถือ: ผู้แจ้ง / ช่าง) ---------- */
.bottom-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    display: flex;
    background: var(--brand-white);
    border-top: 1px solid var(--brand-border);
    box-shadow: 0 -2px 8px rgba(0,0,0,.05);
    z-index: 1030;
}
.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 2px;
    min-height: 56px;
    color: #6C7A93;
    text-decoration: none;
    font-size: 11px;
}
.bottom-nav-item i { font-size: 20px; }
.bottom-nav-item.active { color: var(--brand-blue); font-weight: 600; }

/* ---------- Desktop Sidebar (ผู้ดูแลระบบ) ---------- */
.app-shell { display: flex; }
.app-sidebar {
    width: 240px;
    min-height: calc(100vh - 56px);
    background: var(--brand-white);
    border-right: 1px solid var(--brand-border);
    padding: 16px 0;
}
.sidebar-section { margin-bottom: 18px; }
.sidebar-section-label {
    padding: 4px 20px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #8996AC;
    font-weight: 600;
}
.sidebar-link {
    display: block;
    padding: 9px 20px;
    color: var(--brand-navy);
    text-decoration: none;
    font-size: 14px;
}
.sidebar-link:hover { background: var(--brand-blue-lt); }
.sidebar-link.active {
    background: var(--brand-blue-lt);
    color: var(--brand-blue);
    font-weight: 600;
    border-right: 3px solid var(--brand-blue);
}
.admin-layout .app-content { flex: 1; padding: 24px; }

/* ---------- Badge สถานะงานซ่อม (5 สถานะ ตาม Workflow ที่ Lock) ---------- */
.badge-status-pending      { background: #6C7A93; }
.badge-status-inprogress   { background: var(--brand-blue); }
.badge-status-waitingparts { background: #E0922B; }
.badge-status-completed    { background: #1E9E5A; }
.badge-status-cancelled    { background: #C0392B; }

/* ---------- Touch Target ตาม UI Guideline (ปุ่ม/Input >= 46-48px) ---------- */
.btn, .form-control, .form-select { min-height: 46px; }
.btn-lg { min-height: 48px; }

/* ---------- เพิ่มโดยหัวข้อ "แจ้งซ่อมใหม่" (reporter/new_repair.php) ---------- */
/* สีพื้นของการ์ดฟอร์ม (ไม่ใช่พื้นหลังหน้าเว็บ) — ใช้สีฟ้าอ่อนเดียวกับ Token
   ที่มีอยู่แล้วในระบบ (--brand-blue-lt) ให้สบายตากว่าขาวล้วน โดยตั้งใจให้ต่าง
   จากพื้นหลังหน้าเว็บ (--brand-bg) เพื่อให้การ์ดยังดูลอยเด่นแยกจากพื้นหลังได้
   ช่องกรอกข้อมูลข้างในยังเป็นสีขาว Default ของ Bootstrap อยู่ เลยเกิด Contrast
   ให้เห็นขอบเขตแต่ละช่องชัดขึ้นไปในตัวด้วย ไม่ต้องแก้ .form-control เพิ่ม */
.form-card {
    background-color: var(--brand-blue-lt);
}
/* แนบรูปภาพอาการ */
.upload-box {
    border: 2px dashed var(--brand-border);
    border-radius: 12px;
    padding: 18px;
    text-align: center;
    color: #6C7A93;
    cursor: pointer;
    background: #F9FAFB;
    margin: 0;
    transition: border-color .15s, background .15s;
}
.upload-box:hover { border-color: var(--brand-blue); }

.photo-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 10px;
}
.photo-preview-item { position: relative; }
.photo-preview-item img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--brand-border);
    display: block;
}
.photo-preview-remove {
    position: absolute;
    top: -6px; right: -6px;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: #C0392B;
    color: #fff;
    border: none;
    font-size: .8rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- เพิ่มโดยหัวข้อ "งานของฉัน (รายการ)" (reporter/my_repairs.php) ---------- */
.status-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.status-tab {
    flex: 0 0 auto;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--brand-white);
    border: 1px solid var(--brand-border);
    color: var(--brand-navy);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}
.status-tab.active {
    background: var(--brand-navy);
    border-color: var(--brand-navy);
    color: #fff;
}

.repair-card-link { text-decoration: none; color: inherit; display: block; }
.repair-card {
    border: 1px solid var(--brand-border);
    border-radius: 12px;
    transition: box-shadow .15s ease;
}
.repair-card-link:hover .repair-card,
.repair-card-link:active .repair-card {
    box-shadow: 0 2px 10px rgba(11,36,71,.10);
}

.info-chip {
    display: inline-block;
    background: #EEF1F5;
    color: #4B5768;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 12px;
    margin-right: 6px;
    margin-bottom: 4px;
}

.badge-priority-normal   { background: #EDEFF3; color: #5A6472; }
.badge-priority-high     { background: #FEF3D9; color: #92610A; }
.badge-priority-urgent   { background: #FDE6D3; color: #B45309; }
.badge-priority-critical { background: #FBE4E1; color: #C0392B; font-weight: 700; }

/* ---------- เพิ่มโดยหัวข้อ "รายละเอียดงาน (มุมมองผู้แจ้ง)" (reporter/repair_detail.php) ---------- */
.timeline { position: relative; padding-left: 22px; }
.timeline-item { position: relative; padding-bottom: 18px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
    content: '';
    position: absolute;
    left: -17px; top: 4px; bottom: -18px;
    width: 2px;
    background: var(--brand-border);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
    position: absolute;
    left: -22px; top: 2px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--brand-blue);
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--brand-blue);
}
