/* ========================================
   南達貨運行 - 全域樣式
   ======================================== */

/* === 頂部導覽列 === */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #1a3a5c;
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 16px;
    z-index: 1030;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.menu-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 26px;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 4px;
    line-height: 1;
    transition: background 0.2s;
    flex-shrink: 0;
}

.menu-btn:hover {
    background: rgba(255,255,255,0.15);
}

.top-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 auto;
    white-space: nowrap;
    letter-spacing: 2px;
}

.top-spacer {
    width: 44px; /* 與 menu-btn 同寬，保持標題置中 */
    flex-shrink: 0;
}

/* === 側邊遮罩 === */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.menu-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* === 側邊抽屜 === */
.side-drawer {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: #fff;
    z-index: 1050;
    box-shadow: 2px 0 12px rgba(0,0,0,0.2);
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.side-drawer.open {
    left: 0;
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #1a3a5c;
    color: #fff;
}

.drawer-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.drawer-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.drawer-menu li {
    border-bottom: 1px solid #eee;
}

.drawer-menu li a {
    display: block;
    padding: 14px 20px;
    color: #333;
    text-decoration: none;
    font-size: 16px;
    transition: background 0.2s, padding-left 0.2s;
}

.drawer-menu li a:hover {
    background: #e8f0fe;
    padding-left: 26px;
    color: #1a3a5c;
}

.drawer-divider-top {
    border-top: none;
    border-bottom: 2px solid #1a3a5c;
    margin-top: 0;
}

.drawer-divider-top a {
    font-weight: 600;
}

/* === 主要內容區 === */
.main-content {
    margin-top: 56px;  /* 頂欄高度 */
    min-height: calc(100vh - 56px);
    padding: 20px 0;
}

/* === 首頁歡迎區 === */
.welcome-page {
    padding-top: 40px;
}

.welcome-icon {
    font-size: 72px;
    margin-bottom: 16px;
}

/* === 響應式微調 === */
@media (max-width: 576px) {
    .top-title {
        font-size: 17px;
        letter-spacing: 1px;
    }

    .side-drawer {
        width: 260px;
        left: -260px;
    }
}

/* === 保留原有 Bootstrap 相容樣式 === */
html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 0;
    background: #f8f9fa;
}

/* === 浮動圓形 [+] 按鈕（共用） === */
.btn-add {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #1a3a5c;
    color: #fff;
    font-size: 30px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    cursor: pointer;
    text-decoration: none;
    z-index: 999;
    transition: background 0.2s, transform 0.2s;
}

.btn-add:hover {
    background: #2c5a8c;
    color: #fff;
    transform: scale(1.08);
}

.btn-add.loading {
    pointer-events: none;
    opacity: 0.8;
    transform: scale(1.08);
}

.btn-add .spinner {
    display: none;
    width: 28px;
    height: 28px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.7s linear infinite;
}

.btn-add.loading .spinner {
    display: inline-block;
}

.btn-add.loading .plus-text {
    display: none;
}

@keyframes btn-spin {
    to { transform: rotate(360deg); }
}
