/* ===============================
   基礎
================================= */
body {
    background: #f3f6fb;
    font-family: Arial, "Microsoft JhengHei", "Noto Sans TC", sans-serif;
    color: #333;
}

.app-wrapper {
    max-width: 760px;
    margin: 0 auto;
    padding: 16px 12px 30px;
}

/* ===============================
   標題 / 頁首
================================= */
.system-title {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: #0d6efd;
    margin: 10px 0 18px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.page-header h1 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

/* ===============================
   頂部登入列
================================= */
.top-bar {
    background: #fff;
    border-radius: 10px;
    padding: 8px 12px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.welcome-text {
    font-size: 14px;
    font-weight: 600;
}

/* ===============================
   卡片（首頁）
================================= */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.menu-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px 10px;
    text-align: center;
    text-decoration: none;
    color: #333;
    min-height: 110px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
    transition: .15s;
}

.menu-card:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.menu-title {
    font-size: 17px;
    font-weight: 700;
}

.menu-desc {
    font-size: 13px;
    color: #777;
}

/* ===============================
   表單
================================= */
.form-card {
    background: #fff;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
}

.form-label {
    font-weight: 600;
    font-size: 14px;
}

.text-uppercase {
    text-transform: uppercase;
}

/* ===============================
   Login
================================= */
.login-card {
    background: #fff;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
}

.login-title {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
}

.login-desc {
    text-align: center;
    font-size: 13px;
    color: #777;
    margin-bottom: 18px;
}

/* ===============================
   列表（卡片）
================================= */
.record-card {
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.record-top {
    display: flex;
    justify-content: space-between;
}

.record-code {
    font-weight: 800;
    font-size: 16px;
}

.record-info {
    font-size: 13px;
    line-height: 1.6;
}

.record-in {
    background: #e8f2ff;
}

.record-out {
    background: #fff0df;
}

.record-full {
    background: #eaf4df;
}

.record-empty {
    background: #eee;
}

/* ===============================
   卸貨
================================= */
.unload-card {
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.unload-full {
    background: #eaf4df;
}

.unload-empty {
    background: #eee;
}

/* ===============================
   位置地圖（Excel風格）
================================= */
.yard-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    overflow-x: auto;
}

.yard-tab {
    padding: 5px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #ccc;
    text-decoration: none;
    color: #333;
    font-size: 13px;
}

.yard-tab.active {
    background: #0d6efd;
    color: #fff;
}

.position-table-wrap {
    overflow-x: auto;
    background: #fff;
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.position-table {
    border-collapse: collapse;
    min-width: 1100px;
    width: 100%;
    table-layout: fixed;
}

.position-table th,
.position-table td {
    border: 1px solid #ccc;
    text-align: center;
    padding: 2px;
    font-size: 11px;
    height: 32px;
}

.position-table th {
    background: #f0f3f7;
}

.area-head {
    width: 40px;
    background: #eef5ff !important;
    font-weight: 700;
}

.pos-empty {
    background: #f8f8f8;
    color: #bbb;
}

.pos-full {
    background: #dff1ce;
    font-weight: 700;
}

.pos-empty-container {
    background: #e5e5e5;
    font-weight: 700;
}

.pos-multi {
    background: #ffd6d6;
    color: red;
    font-weight: 700;
}

.pos-code {
    font-size: 10px;
    word-break: break-all;
}
.position-table-vertical {
    min-width: 100%;
}

.position-table-vertical th,
.position-table-vertical td {
    height: 28px;
    font-size: 10px;
    padding: 1px 2px;
}

.position-table-vertical .area-head {
    width: 38px;
    position: sticky;
    left: 0;
    z-index: 2;
}
.filter-row {
    margin: 6px 0 10px;
}

.filter-toggle {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #ccc;
    font-size: 13px;
    color: #333;
    text-decoration: none;
}

.filter-toggle.active {
    background: #198754;
    border-color: #198754;
    color: #fff;
}
.position-cell {
    cursor: pointer;
}

.position-cell:hover {
    outline: 2px solid #0d6efd;
    outline-offset: -2px;
}

/* ===============================
   卸貨計劃
================================= */
.unload-wrapper {
    max-width: 100%;
}

.unload-table-wrap {
    width: 100%;
    overflow-x: auto;
    background: #fff;
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.unload-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.unload-table th,
.unload-table td {
    border: 1px solid #d4d4d4;
    padding: 5px 4px;
    font-size: 12px;
    vertical-align: middle;
    word-break: break-word;
}

.unload-table th {
    background: #f0f3f7;
    font-weight: 700;
    text-align: center;
}

.unload-table th:nth-child(1),
.unload-table td:nth-child(1) {
    width: 26%;
}

.unload-table th:nth-child(2),
.unload-table td:nth-child(2) {
    width: 24%;
}

.unload-table th:nth-child(3),
.unload-table td:nth-child(3) {
    width: 26%;
}

.unload-table th:nth-child(4),
.unload-table td:nth-child(4) {
    width: 24%;
}

.unload-date-input {
    width: 100%;
    min-width: 0;
    font-size: 12px;
    padding: 3px;
}

.unload-filter-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ===============================
   頁腳
================================= */
.footer {
    text-align: center;
    font-size: 12px;
    color: #999;
    margin-top: 20px;
}

/* ===============================
   手機優化
================================= */
@media (max-width: 420px) {

    .app-wrapper {
        padding: 12px 8px 25px;
    }

    .menu-card {
        padding: 16px 6px;
        min-height: 95px;
    }

    .menu-title {
        font-size: 15px;
    }

    .record-code {
        font-size: 14px;
    }

    .position-table th,
    .position-table td {
        font-size: 10px;
        height: 28px;
    }
    .unload-table th,
    .unload-table td {
        font-size: 11px;
        padding: 4px 3px;
    }

    .unload-date-input {
        font-size: 11px;
    }
}