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

html, body {
    height: 100%;
}

/* =========================
   ROOT COLORS (รวมหน้าแรก)
========================= */
:root {
    /* Warm wood */
    --wood-deep:   #6B4226;
    --wood-soft:   #C08A53;

    /* Harbor (น้ำเงินเทาเข้ม) */
    --harbor:      #1E293B;

    /* Sea green */
    --sea-green:   #0EB7A0;

    /* Sky grey */
    --sky-grey:    #CBD5E1;

    /* Pearl shell */
    --pearl-shell: #F8F5EF;

    /* footer height สำหรับ fixed footer */
    --footer-height: 52px;
    /* header height สำหรับ fixed header (ใช้จริง) */
    --header-height: 64px;
}

/* =========================
   GLOBAL / BODY
========================= */
body {
    font-family: Aktiv Grotesk Thai, Arial, sans-serif;
    background-color: #F5F7FA;
    color: #1F2933;
    font-size: 14px;
    line-height: 1.4;
    min-height: 100vh;
    overflow-x: hidden;
	
	padding-top: 80px;
    padding-bottom: var(--footer-height);
}

/* โครง layout กลาง: เนื้อหาส่วนที่อยู่ระหว่าง header กับ footer */
/*.page-shell {
    position: relative;
    min-height: 100vh;
    padding-top: var(--header-height);
    padding-bottom: var(--footer-height); 
} */

/* =========================
   HEADER + NAV
========================= */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 18px 24px;

    background: linear-gradient(90deg, #0F172A, #1E293B, #1D4ED8);
    color: #E5E7EB;

    width: 100%;
    z-index: 1000;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.25);
    border-bottom: 1px solid #1F2933;
}

/* กำหนด header height ให้สัมพันธ์กับตัวแปร */
@media (min-width: 0px){
    .site-header {
        min-height: var(--header-height);
    }
}

.site-header-inner {
    width: 100%;
    max-width: 1080px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* แบรนด์ */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #F9FAFB;
    white-space: nowrap;
}

/* เมนูด้านขวา */
.main-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.main-nav a {
    color: #E5E7EB;
    text-decoration: none;
    white-space: nowrap;
    margin-left: 8px;
    font-size: 13px;
}

.main-nav a:hover {
    color: #BFDBFE;
    text-decoration: none;
}

.main-nav .nav-spacer {
    flex: 1;
}

.main-nav .user-info {
    margin-right: 4px;
    color: #E5E7EB;
    font-size: 12px;
}

/* ปุ่ม Logout */
.main-nav .logout-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 14px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid #60A5FA;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    color: #E5E7EB;
    transition: background-color 0.15s ease, border-color 0.15s ease,
                box-shadow 0.15s ease, transform 0.05s ease;
}

.main-nav .logout-link:hover {
    background: #1D4ED8;
    border-color: #93C5FD;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.4);
    transform: translateY(-1px);
}

/* ไอคอนเมนู */
.main-nav .nav-icon i {
    font-size: 18px;
    color: #E5E7EB;
    transition: color 0.2s, transform 0.1s;
}

.main-nav .nav-icon:hover i {
    color: #BFDBFE;
    transform: translateY(-1px);
}

/* ปุ่ม 3 ขีด */
.nav-toggle {
    display: none;
    border: none;
    background: transparent;
    color: #E5E7EB;
    font-size: 20px;
    cursor: pointer;
}

/* =========================
   REMINDER ALERT
========================= */

.reminder-alert-box {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 10px;
    margin: 10px 0 16px;
    font-size: 13px;
    gap: 10px;
    flex-wrap: wrap;
}

.reminder-has-task {
    background-color: #EDF4FF;
    border: 1px solid #C4D7F5;
}

.reminder-empty {
    background-color: #F3FBF6;
    border: 1px solid #C6E6D2;
}

.reminder-alert-icon {
    margin-right: 4px;
    color: #2563EB;
}

.reminder-empty .reminder-alert-icon {
    color: #16A34A;
}

.reminder-alert-title {
    font-weight: 600;
    margin-bottom: 2px;
    color: #334155;
}

.reminder-alert-text {
    color: #4B5563;
}

.reminder-alert-action {
    margin-left: auto;
}

.btn-reminder-view {
    padding: 6px 12px;
    border-radius: 999px;
    background-color: #FFFFFF;
    color: #4B5563;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    border: 2px solid #4B5563;
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.15);
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease,
                box-shadow 0.15s ease, transform 0.05s ease;
}

.btn-reminder-view:hover {
    background-color: #F3F4F6;
    color: #111827;
    box-shadow: 0 5px 12px rgba(15, 23, 42, 0.22);
    transform: translateY(-1px);
}

/* =========================
   CONTAINER / CONTENT
========================= */

.container {
    max-width: 900px;
    width: 100%;
    margin: 18px auto calc(var(--footer-height) + 4px) auto;
    background: #FFFFFF;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid #E0E7F0;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
    overflow-x: hidden;
}

h1, h2 {
    color: #1F2933;
}

h2 {
    font-size: 16px;
    letter-spacing: 0.02em;
}

/* =========================
   FORM
========================= */

.form-layout {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 16px 24px;
    align-items: flex-start;
    background: #F3F5F9;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #E0E7F0;
    margin-bottom: 12px;
}

.form-layout .form-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group {
    margin-bottom: 10px;
}

.form-group label,
.form-label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    color: #4B5563;
}

.form-group input,
.form-group select,
.form-group textarea,
.form-control,
input,
select,
textarea {
    width: 100%;
    padding: 7px 9px;
    font-size: 12px;
    border: 1px solid #CBD5E1;
    border-radius: 6px;
    background-color: #FFFFFF !important;
    color: #111827;
    box-sizing: border-box;
    transition: background-color 5000s ease-in-out 0s;
}

.form-group input::placeholder,
.form-group textarea::placeholder,
input::placeholder,
textarea::placeholder {
    color: #9CA3AF;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #60A5FA;
    box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.75);
    background-color: #FFFFFF !important;
}

/* Autofill reset */
input:-webkit-autofill,
textarea:-webkit-autofill,
select:-webkit-autofill {
    -webkit-box-shadow: 0 0 0px 1000px #FFFFFF inset !important;
    box-shadow: 0 0 0px 1000px #FFFFFF inset !important;
    -webkit-text-fill-color: #111827 !important;
}

/* =========================
   BUTTONS
========================= */

.btn {
    display: inline-block;
    padding: 7px 11px;
    font-size: 12px;
    text-decoration: none;
    border-radius: 999px;
    cursor: pointer;
    border: none;
    transition: transform 0.05s ease, box-shadow 0.1s ease,
                background 0.2s ease, color 0.2s ease;
}

/* ปุ่มหลัก: เทาไล่เฉด */
.btn-primary {
    background: linear-gradient(135deg, #F9FAFB, #D1D5DB);
    color: #111827;
    border: 1px solid #4B5563;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.18);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #E5E7EB, #9CA3AF);
    color: #0F172A;
    border-color: #374151;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.26);
}

/* ปุ่มรอง */
.btn-secondary {
    background: linear-gradient(135deg, #FFFFFF, #F3F4F6);
    color: #374151;
    border: 1px solid #D1D5DB;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #E5E7EB, #D1D5DB);
    border-color: #9CA3AF;
    color: #111827;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 11px;
}

/* =========================
   TABLES
========================= */

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background-color: transparent;
}

table th,
table td {
    border: 1px solid #E0E7F0;
    padding: 5px 7px;
    font-size: 11px;
    text-align: left;
    vertical-align: top;
    color: #111827;
}

table th {
    font-weight: 600;
    white-space: nowrap;
    background-color: #F3F4F6;
}

/* notification-table */
table.notification-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: linear-gradient(145deg, #FFFFFF, #F3F4F6) !important;
    color: #111827 !important;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #D1D5DB;
}

table.notification-table thead th {
    background: linear-gradient(135deg, #E5E7EB, #D4D4D8) !important;
    color: #374151 !important;
    font-weight: 700;
    border-bottom: 1px solid #D1D5DB;
}

table.notification-table th,
table.notification-table td {
    background: transparent !important;
    color: #111827 !important;
    font-weight: 400;
    border: 1px solid #E0E7F0;
}

table.notification-table tbody tr:nth-child(even) td {
    background: rgba(249, 250, 251, 0.9) !important;
}

table.notification-table tbody tr:hover td {
    background: linear-gradient(135deg, #E5E7EB, #F3F4F6) !important;
}

/* =========================
   FOOTER (fixed)
========================= */

footer,
.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;

    height: var(--footer-height);

    background: linear-gradient(135deg, #F9FAFB, #E5E7EB);
    color: #111827;
    text-align: center;
    padding: 6px 10px;
    font-size: 10px;
    font-weight: 500;
    flex-shrink: 0;
    width: 100%;
    border-top: 1px solid #D1D5DB;
    z-index: 900;
    box-shadow: 0 -4px 10px rgba(15, 23, 42, 0.05);
}

.site-footer .footer-inner p {
    margin: 1px 0;
    white-space: nowrap;
}

.site-footer .footer-inner p.footer-main {
    font-size: 10px;
    font-weight: 500;
}

.site-footer .footer-inner p.footer-sub {
    font-size: 9px;
    font-weight: 400;
    opacity: 0.9;
}

/* =========================
   BADGES (ทั่วไป)
========================= */

.badge-status {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: bold;
    color: #fff;
}

.badge-new        { background-color: #F59E0B; }
.badge-inprogress { background-color: #FACC15; color: #92400E; }
.badge-waiting    { background-color: #9CA3AF; }
.badge-done       { background-color: #22C55E; }

/* =========================
   REQUEST LIST (หน้าแจ้งซ่อม)
========================= */

.request-page {
    background-color:#F4F5F7;
}

.request-page .request-manage-container {
    max-width:900px;
    width:100%;
    margin:18px auto 24px auto;
    background:transparent;
    padding:0;
    box-shadow:none;
    border:none;
}

.request-page .request-list-header {
    display:flex;
    flex-direction:column;
    gap:8px;
    margin-bottom:10px;
}

.request-page .request-list-header h2 {
    font-size:18px;
    font-weight:600;
    color:#1F2933;
}

.request-page .request-list-subtitle {
    font-size:13px;
    color:#6B7280;
}

.request-page .request-search-bar {
    margin-top:4px;
    display:flex;
    flex-direction:column;
    gap:6px;
}

.request-page .request-search-inner {
    position:relative;
    width:100%;
    display:flex;
    align-items:center;
}

.request-page .report-search-input {
    flex:1;
    padding:8px 40px 8px 12px;
    border-radius:999px;
    border:1px solid #D1D5DB;
    font-size:14px;
    outline:none;
    background-color:#FFFFFF;
    color:#111827;
    transition:border-color 0.15s ease, box-shadow 0.15s ease;
}
.request-page .report-search-input::placeholder {
    color:#9CA3AF;
}
.request-page .report-search-input:focus {
    border-color:#B0B8C4;
    box-shadow:0 0 0 1px rgba(176,184,196,0.6);
}

.request-page .report-search-button {
    position:absolute;
    right:6px;
    top:50%;
    transform:translateY(-50%);
    border:none;
    background:transparent;
    cursor:pointer;
    padding:4px 8px;
    color:#9CA3AF;
    font-size:16px;
}

.request-page .request-list-wrapper {
    margin-top:10px;
    padding:14px 14px 16px 14px;
    border-radius:16px;
    background: linear-gradient(145deg, #F9FAFB, #E3E6EB);
    border:1px solid #D1D5DD;
    box-shadow:0 10px 24px rgba(15,23,42,0.06);
}

.request-page .request-list-label {
    font-size:12px;
    font-weight:600;
    text-transform:uppercase;
    letter-spacing:0.06em;
    color:#6B7280;
    margin-bottom:6px;
}

.request-page .badge-status {
    display:inline-block;
    padding:2px 10px;
    border-radius:999px;
    font-size:11px;
    line-height:1.4;
    border:1px solid transparent;
    font-weight:500;
}

.request-page .badge-waiting {
    background:#F9FAFB;
    color:#4B5563;
    border-color:#E5E7EB;
}

.request-page .badge-inprogress {
    background:#E5E7EB;
    color:#374151;
    border-color:#D1D5DB;
}

.request-page .badge-done {
    background:#E5E7EB;
    color:#111827;
    border-color:#9CA3AF;
}

.request-page .badge-cancel {
    background:#F3F4F6;
    color:#6B7280;
    border-color:#E5E7EB;
}

.request-page .request-card {
    display:flex;
    align-items:flex-start;
    gap:10px;
    padding:10px 10px;
    border-radius:12px;
    background: linear-gradient(145deg, #FFFFFF, #F3F4F6);
    border:1px solid #E1E4EA;
    box-shadow:0 4px 12px rgba(15,23,42,0.04);
    margin-top:8px;
}

.request-page .request-status-icon {
    width:28px;
    height:28px;
    border-radius:999px;
    background:#E5E7EB;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:13px;
    color:#4B5563;
    flex-shrink:0;
}

.request-page .request-card-body {
    flex:1;
    display:flex;
    flex-direction:column;
}

.request-page .request-card-top-row {
    display:flex;
    align-items:flex-start;
    gap:8px;
    margin-bottom:4px;
}

.request-page .request-meta-right {
    margin-left:auto;
    text-align:right;
    font-size:11px;
}

.request-page .request-datetime {
    color:#9CA3AF;
}

.request-page .request-location {
    font-size:12px;
    color:#6B7280;
    margin-bottom:2px;
}

.request-page .request-title {
    font-weight:600;
    font-size:14px;
    margin:0;
    color:#111827;
}

.request-page .request-description {
    font-size:12px;
    color:#4B5563;
}

.request-page .request-card-actions {
    margin-top:6px;
    display:flex;
    gap:8px;
    flex-wrap:wrap;
}

.request-page .btn-edit-wood {
    display:inline-flex;
    align-items:center;
    padding:4px 12px;
    border-radius:999px;
    border:1px solid #D1D5DB;
    background: linear-gradient(135deg, #F9FAFB, #E5E7EB);
    color:#374151;
    font-size:12px;
    font-weight:500;
    text-decoration:none;
    cursor:pointer;
    box-shadow:0 2px 7px rgba(15,23,42,0.08);
    transition:background-color 0.15s ease, box-shadow 0.15s.ease,
               transform 0.05s ease, border-color 0.15s.ease, color 0.15s.ease;
}
.request-page .btn-edit-wood:hover {
    background: linear-gradient(135deg, #E5E7EB, #D1D5DB);
    border-color:#9CA3AF;
    color:#111827;
    box-shadow:0 3px 10px rgba(15,23,42,0.12);
    transform:translateY(-1px);
}

.request-page .btn-delete-outline {
    display:inline-flex;
    align-items:center;
    padding:4px 12px;
    border-radius:999px;
    border:1px solid #E5E7EB;
    background:#FFFFFF;
    color:#7F1D1D;
    font-size:12px;
    font-weight:500;
    cursor:pointer;
    text-decoration:none;
    transition:background-color 0.15s.ease, color 0.15s.ease,
               box-shadow 0.15s.ease, transform 0.05s.ease, border-color 0.15s.ease;
}
.request-page .btn-delete-outline:hover {
    background:#F9FAFB;
    color:#991B1B;
    border-color:#D1D5DB;
    box-shadow:0 3px 9px rgba(148,163,184,0.25);
    transform:translateY(-1px);
}

.request-page .no-data-text {
    margin-top:8px;
    font-size:13px;
    color:#9CA3AF;
}

@media (max-width: 600px){
    .request-page .request-card-top-row{
        flex-direction:column;
    }
    .request-page .request-meta-right{
        margin-left:0;
        text-align:left;
        margin-top:4px;
    }
}

/* =========================
   BRAND HERO – Luxury Neutral
========================= */

.brand-hero {
    max-width: 960px;
    margin: 8px auto 14px auto;
    padding: 18px 22px;
    border-radius: 20px;
    background: radial-gradient(circle at top left, #FAF4EC, #F1ECE5);
    border: 1px solid #DED2C3;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.10);
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-hero-mark {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, #C7A76A, #8A6A3F);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFDF7;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 0.06em;
    box-shadow: 0 10px 24px rgba(87, 64, 34, 0.45);
}

.brand-hero-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.brand-hero-name {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: #1F2933;
}

.brand-hero-tagline {
    font-size: 15px;
    font-weight: 600;
    color: #292524;
}

.brand-hero-tagline-en {
    font-size: 13px;
    font-weight: 500;
    color: #4B5563;
}

.brand-hero-subline {
    margin-top: 3px;
    font-size: 12px;
    color: #6B7280;
}

/* ย่อหน้าใต้การ์ดล็อกอิน */
.welcome-ops-note {
    margin-top: 8px;
    font-size: 13px;
    color: #4B5563;
}

/* =========================
   MOBILE NAV (Hamburger – แนวตั้ง)
========================= */

@media (max-width: 768px) {

    .site-header {
        padding: 12px 12px;
    }

    .site-header-inner {
        align-items: center;
        gap: 8px;
    }

    .brand-title {
        font-size: 0.85rem;
        letter-spacing: 0.12em;
    }

    .nav-toggle {
        display: block;
    }

    .main-nav {
        position: absolute;
        top: 100%;
        right: 10px;
        left: auto;

        width: 140px;
        max-width: 50vw;

        background: #020617;
        padding: 8px 8px 10px 8px;
        border-radius: 10px;
        border: 1px solid #1F2937;
        box-shadow: 0 10px 30px rgba(15, 23, 42, 0.6);

        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;

        transform-origin: top right;
        transform: scaleY(0);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.16s ease-out, opacity 0.16s ease-out;
    }

    body.nav-open .main-nav {
        transform: scaleY(1);
        opacity: 1;
        pointer-events: auto;
    }

    .main-nav a {
        margin-left: 0;
        font-size: 12px;
    }

    .main-nav .nav-icon {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 6px;
        padding: 4px 6px;
        border-radius: 8px;
        background: rgba(15, 23, 42, 0.9);
    }

    .main-nav .nav-icon i {
        font-size: 14px;
    }

    .main-nav .nav-spacer {
        display: none;
    }

    .main-nav .user-info {
        order: 98;
        display: block;
        font-size: 11px;
        width: 100%;
        padding: 4px 2px;
        color: #E5E7EB;
        border-top: 1px solid rgba(148, 163, 184, 0.4);
        margin-top: 4px;
    }

    .main-nav .logout-link {
        order: 99;
        padding: 5px 10px;
        font-size: 11px;
        width: 100%;
        justify-content: center;
        background: #1D4ED8;
        border-color: #60A5FA;
        text-align: center;
    }

    .container {
        margin: 12px 0 calc(var(--footer-height) + 2px) 0;
        border-radius: 0;
        width: 100%;
        max-width: 100%;
        box-shadow: none;
        padding: 12px 10px;
        border-left: none;
        border-right: none;
    }
}
