/* 首頁樣式 - 深色主題（對齊萬昌系統風格） */

body {
    margin: 0;
    padding: 0;
    font-family: "Microsoft JhengHei", "Noto Sans TC", sans-serif;
    background: #020617; /* slate-950 */
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    max-width: 448px; /* max-w-md */
    width: 90%;
    background: #0f172a; /* slate-900 */
    border-radius: 24px; /* rounded-3xl */
    overflow: hidden;
    border: 1px solid #1e293b; /* slate-800 */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* 標題區塊 */
.container-header {
    background: #1e293b; /* slate-800 */
    padding: 24px;
    text-align: center;
    border-bottom: 1px solid #334155; /* slate-700 */
}

h1 {
    text-align: center;
    color: #60a5fa; /* blue-400 */
    margin: 0;
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 0.15em;
}

.container-body {
    padding: 24px;
}

/* ========== 首頁入口按鈕 ========== */
.home-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.entry-btn {
    width: 100%;
    padding: 20px;
    background: #1e293b; /* slate-800 */
    color: #f1f5f9; /* slate-100 */
    border: 2px solid #334155; /* slate-700 */
    border-radius: 16px; /* rounded-2xl */
    font-size: 1.15rem;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 2px;
}

.entry-btn:hover {
    background: #334155; /* slate-700 */
}

.entry-btn:active {
    transform: scale(0.95);
}

/* ========== 步驟畫面 ========== */
.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.step {
    margin-bottom: 20px;
}

.step h2 {
    color: #f1f5f9; /* slate-100 */
    font-size: 1.1rem;
    font-weight: 900;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
}

.step-number {
    background: #2563eb; /* blue-600 */
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-right: 10px;
    font-weight: bold;
    font-size: 0.85rem;
}

/* ========== 卡片格線 ========== */
.user-grid, .project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.user-card, .project-card {
    background: #1e293b; /* slate-800 */
    border: 2px solid #334155; /* slate-700 */
    border-radius: 16px;
    padding: 18px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    color: #f1f5f9;
}

.user-card:hover, .project-card:hover {
    background: #334155;
    transform: translateY(-2px);
}

.user-card:active, .project-card:active {
    transform: scale(0.95);
}

.user-card.selected, .project-card.selected {
    border-color: #60a5fa; /* blue-400 */
    background: rgba(96, 165, 250, 0.15);
}

.user-icon, .project-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.user-name, .project-name {
    font-weight: 900;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.user-role {
    font-size: 0.75rem;
    color: #64748b; /* slate-500 */
}

.user-card.selected .user-role {
    color: rgba(255, 255, 255, 0.7);
}

/* 簡化人員卡片（報帳流程：只顯示人名） */
.user-card-simple {
    padding: 14px 12px;
}

.user-card-simple .user-name {
    margin-bottom: 0;
}

/* 新增按鈕卡片 */
.add-btn {
    background: rgba(15, 23, 42, 0.6);
    border: 2px dashed #334155;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #475569; /* slate-600 */
    font-size: 1.8rem;
}

.add-btn:hover {
    border-color: #60a5fa;
    color: #60a5fa;
    background: rgba(30, 41, 59, 0.5);
}

/* ========== 目前選擇顯示 ========== */
.current-user, .current-info {
    background: #1e293b;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 15px;
    text-align: center;
    color: #94a3b8; /* slate-400 */
    font-weight: bold;
    font-size: 0.9rem;
    border: 1px solid #334155;
}

/* ========== 樓層格線 ========== */
.floor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.floor-card {
    background: #1e293b;
    border: 2px solid #334155;
    border-radius: 16px;
    padding: 18px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.floor-card:hover {
    background: #334155;
    transform: translateY(-2px);
}

.floor-number {
    font-size: 1.6rem;
    font-weight: 900;
    color: #f1f5f9;
}

.floor-label {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 4px;
}

/* ========== 刪除按鈕 ========== */
.delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ef4444; /* red-500 */
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 0.75rem;
    display: none;
    line-height: 24px;
    text-align: center;
}

.user-card:hover .delete-btn,
.project-card:hover .delete-btn {
    display: block;
}

/* ========== 導航按鈕 ========== */
.nav-btn {
    width: 100%;
    padding: 12px;
    background: #1e293b;
    color: #94a3b8;
    border: 1px solid #334155;
    border-radius: 16px;
    font-size: 0.95rem;
    font-weight: 900;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: #334155;
    color: #f1f5f9;
}

.nav-btn:active {
    transform: scale(0.95);
}

/* ========== Modal 彈窗 ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #0f172a; /* slate-900 */
    padding: 28px;
    border-radius: 24px;
    max-width: 400px;
    width: 90%;
    border: 1px solid #334155;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.modal h3 {
    margin: 0 0 18px 0;
    color: #f1f5f9;
    font-size: 1.1rem;
    font-weight: 900;
}

/* ========== 表單元素 ========== */
.input-group {
    margin-top: 12px;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 5px;
}

.input-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #334155;
    border-radius: 12px;
    font-size: 1rem;
    box-sizing: border-box;
    background: #1e293b;
    color: #f1f5f9;
    transition: border-color 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: #60a5fa;
}

.input-group input::placeholder {
    color: #475569;
}

.input-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #334155;
    border-radius: 12px;
    font-size: 1rem;
    box-sizing: border-box;
    background: #1e293b;
    color: #f1f5f9;
    -webkit-appearance: none;
    appearance: none;
}

.input-group select option {
    background: #1e293b;
    color: #f1f5f9;
}

/* ========== 按鈕 ========== */
.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 900;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn:active {
    transform: scale(0.95);
}

.btn-primary {
    background: #2563eb; /* blue-600 */
    color: white;
}

.btn-primary:hover {
    background: #3b82f6; /* blue-500 */
}

.btn-secondary {
    background: #1e293b;
    color: #94a3b8;
    border: 1px solid #334155;
}

.btn-secondary:hover {
    background: #334155;
    color: #f1f5f9;
}

/* ========== 載入訊息 ========== */
.loading-msg {
    grid-column: 1 / -1;
    text-align: center;
    color: #94a3b8;
    padding: 30px 10px;
    font-size: 0.95rem;
}

/* ========== 首頁樓層彈跳視窗 ========== */
.home-floor-popup-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.home-floor-popup-content {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 24px;
    padding: 28px;
    max-width: 420px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.home-floor-popup-title {
    color: #f1f5f9;
    font-size: 1.1rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 12px;
}

.home-floor-popup-info {
    background: #1e293b;
    padding: 10px;
    border-radius: 12px;
    margin-bottom: 16px;
    text-align: center;
    color: #94a3b8;
    font-weight: bold;
    font-size: 0.85rem;
    border: 1px solid #334155;
}

.home-floor-popup-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.home-floor-popup-grid .floor-card {
    background: #1e293b;
    border: 2px solid #334155;
    border-radius: 16px;
    padding: 16px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.home-floor-popup-grid .floor-card:hover {
    background: #334155;
    transform: translateY(-2px);
}

.floor-popup-btn {
    width: 100%;
    padding: 12px 8px;
    border-radius: 16px;
    border: 2px solid #334155;
    background: #1e293b;
    color: #f1f5f9;
    font-size: 1rem;
    font-weight: 900;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 1px;
}

.floor-popup-btn:hover {
    background: #334155;
    border-color: #60a5fa;
    color: #fff;
    transform: translateY(-1px);
}

.floor-popup-btn:active {
    transform: scale(0.95);
}
