:root {
    --brand: #e8590c;          /* 主橙 */
    --brand-dark: #c44504;     /* 深橙 */
    --brand-light: #fd7e14;    /* 亮橙 */
    --brand-soft: #fff4ec;     /* 淡橙底 */
    --ink: #1f2933;            /* 主文字 */
    --muted: #6b7280;          /* 次文字 */
    --line: #e9ecef;
    --sidebar-bg: #1d2330;     /* 側邊深色 */
    --sidebar-hover: #2a3142;
    --radius: .75rem;
}

body {
    background-color: #f4f5f7;
    color: var(--ink);
    font-family: "Noto Sans TC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ===== 通用 ===== */
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-outline-brand { color: var(--brand); border-color: var(--brand); }
.btn-outline-brand:hover { background: var(--brand); color: #fff; }
.text-brand { color: var(--brand) !important; }
.bg-brand { background: var(--brand) !important; }

a { color: var(--brand); }
a:hover { color: var(--brand-dark); }

.card { border: none; border-radius: var(--radius); box-shadow: 0 1px 4px rgba(16, 24, 40, .06); }
.table-responsive { background: #fff; border-radius: var(--radius); }

.photo-thumb {
    width: 120px; height: 120px; object-fit: cover;
    border-radius: .5rem; border: 1px solid var(--line);
}

/* ===== 後台 Admin 版型（側邊導覽） ===== */
.admin-layout { display: flex; min-height: 100vh; overflow-x: hidden; }

/* 側邊欄預設隱藏（由 JS 決定是否展開） */
.admin-sidebar {
    width: 248px; flex-shrink: 0;
    background: var(--sidebar-bg); color: #cbd3e1;
    display: flex; flex-direction: column;
    position: fixed; top: 0; bottom: 0; left: -248px; z-index: 1040;
    transition: left .25s ease;
}
/* 展開狀態 */
.admin-layout.sidebar-on .admin-sidebar { left: 0; }

.admin-sidebar .brand {
    padding: 1.1rem 1.25rem; font-size: 1.2rem; font-weight: 800; color: #fff;
    display: flex; align-items: center; gap: .5rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.admin-sidebar .brand .logo-dot {
    width: 30px; height: 30px; border-radius: 8px;
    background: linear-gradient(135deg, var(--brand-light), var(--brand-dark));
    display: inline-flex; align-items: center; justify-content: center; color: #fff;
}
.admin-nav { padding: .75rem .5rem; overflow-y: auto; flex: 1; }
.admin-nav .nav-section {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
    color: #6b7589; padding: .85rem .9rem .3rem;
}
.admin-nav a {
    display: flex; align-items: center; gap: .7rem;
    padding: .6rem .9rem; margin: .12rem 0; border-radius: .5rem;
    color: #cbd3e1; text-decoration: none; font-size: .95rem;
    transition: background .15s, color .15s;
}
.admin-nav a i { font-size: 1.05rem; width: 1.3rem; text-align: center; }
.admin-nav a:hover { background: var(--sidebar-hover); color: #fff; }
.admin-nav a.active {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff; box-shadow: 0 4px 10px rgba(232,89,12,.35);
}
.admin-sidebar .sidebar-foot { padding: .75rem; border-top: 1px solid rgba(255,255,255,.08); }

/* 主內容：無 sidebar 時滿版；桌機展開時讓出寬度（由 JS 同步加上 push-main） */
.admin-main { flex: 1; margin-left: 0; min-width: 0; transition: margin-left .25s ease; }
.admin-layout.sidebar-on.push-main .admin-main { margin-left: 248px; }

.admin-topbar {
    background: #fff; border-bottom: 1px solid var(--line);
    padding: .6rem 1.25rem; display: flex; align-items: center; gap: 1rem;
    position: sticky; top: 0; z-index: 1030;
}
.admin-topbar .page-title { font-weight: 700; margin: 0; }
.admin-content { padding: 1.25rem; }

.sidebar-toggle { display: inline-flex; }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1039; }
.sidebar-backdrop.show { display: block; }

/* ===== 統計卡 ===== */
.stat-card { border-radius: var(--radius); overflow: hidden; }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 800; line-height: 1.1; }
.stat-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.4rem;
}

/* ===== 登入頁 ===== */
.auth-wrapper {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #2a1206 0%, #7a2c06 55%, #e8590c 100%);
    padding: 1rem;
}
.auth-card {
    max-width: 410px; width: 100%; border-radius: 1rem; overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,.35);
}
.auth-card .auth-head {
    background: linear-gradient(135deg, var(--brand-light), var(--brand-dark));
    color: #fff; padding: 2rem 1.5rem; text-align: center;
}

/* ===== 公開官網 ===== */
.site-nav { background: rgba(29,35,48,.96); backdrop-filter: blur(6px); }
.site-nav .navbar-brand { font-weight: 800; color: #fff; }
.site-nav .nav-link { color: #d7dbe3; font-weight: 500; }
.site-nav .nav-link:hover { color: var(--brand-light); }

.hero {
    position: relative; color: #fff; padding: 6rem 0 7rem;
    background: linear-gradient(rgba(20,12,6,.72), rgba(20,12,6,.78)),
        url('https://images.unsplash.com/photo-1558981403-c5f9899a28bc?auto=format&fit=crop&w=1600&q=80') center/cover;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; }
.hero .lead { font-size: 1.2rem; opacity: .92; }

.feature-icon {
    width: 64px; height: 64px; border-radius: 16px;
    background: var(--brand-soft); color: var(--brand);
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.7rem;
}
.plate-search-box {
    background: #fff; border-radius: 1rem; box-shadow: 0 10px 30px rgba(0,0,0,.12);
    padding: 1.5rem; margin-top: -3.5rem; position: relative; z-index: 2;
}
.service-img { height: 200px; object-fit: cover; width: 100%; border-radius: var(--radius) var(--radius) 0 0; }
.site-footer { background: var(--sidebar-bg); color: #aeb6c4; padding: 2.5rem 0 1.5rem; }
.site-footer a { color: #d7dbe3; }

/* 時間軸（維修進度） */
.timeline { position: relative; padding-left: 1.75rem; }
.timeline::before {
    content: ""; position: absolute; left: .5rem; top: .3rem; bottom: .3rem;
    width: 2px; background: var(--line);
}
.timeline-item { position: relative; padding-bottom: 1.25rem; }
.timeline-item::before {
    content: ""; position: absolute; left: -1.32rem; top: .25rem;
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--brand); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--brand);
}

@@media (max-width: 576px) {
    .stat-card .stat-value { font-size: 1.4rem; }
    .hero { padding: 4rem 0 5rem; }
}
