/* 
 * 院前外傷 MIST-AMBO 標準交班單 - 專業醫療風格
 * 設計理念：沉穩、專業、易讀
 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;600;700&display=swap');

/* ========== 色彩系統 ========== */
:root {
    /* 主色調 - 專業深藍 */
    --primary-color: #1e3a5f;
    --primary-dark: #152a45;
    --primary-light: #2d5a87;
    
    /* 輔助色 */
    --accent-color: #3b82f6;
    --accent-light: #60a5fa;
    
    /* 狀態色 */
    --success-color: #16a34a;
    --warning-color: #ca8a04;
    --danger-color: #dc2626;
    --info-color: #0284c7;
    
    /* 中性色 */
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* 語意變數 */
    --bg-page: var(--gray-100);
    --bg-card: var(--white);
    --border-color: var(--gray-200);
    --text-primary: var(--gray-800);
    --text-secondary: var(--gray-600);
    --text-muted: var(--gray-400);
    
    /* 陰影 */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 4px 20px rgba(30, 58, 95, 0.08);
    
    /* 圓角 */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* 過渡 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
}

/* ========== 基礎重設 ========== */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    margin: 0;
    padding: 0;
    background: var(--bg-page);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

/* ========== 導覽列 ========== */
.navbar {
    background: var(--primary-color);
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-brand a {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-brand a::before {
    content: "🚑";
    font-size: 1.25rem;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.nav-link.active {
    background: var(--white);
    color: var(--primary-color);
}

/* ========== 主容器 ========== */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* ========== 頁面標題 ========== */
.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-light);
}

.page-title::before {
    content: "📋 ";
}

/* ========== 卡片樣式 ========== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border-color);
}

.card-header {
    background: var(--primary-color);
    color: var(--white);
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.card-header .letter {
    background: var(--white);
    color: var(--primary-color);
    width: 26px;
    height: 26px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border-radius: var(--radius-sm);
    font-weight: 800;
    font-family: 'Courier New', monospace;
    font-size: 0.9375rem;
}

.card-body {
    padding: 1.25rem;
}

/* ========== 表單樣式 ========== */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.375rem;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-family: inherit;
    background: var(--white);
    color: var(--text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control-sm {
    width: auto;
    min-width: 80px;
    padding: 0.5rem 0.625rem;
    font-size: 0.875rem;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.form-row .form-group {
    flex: 1;
    min-width: 150px;
}

/* ========== Checkbox 與 Radio ========== */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-color);
    cursor: pointer;
}

.form-check-inline {
    display: inline-flex;
    margin-right: 1.25rem;
}

/* ========== 按鈕 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-normal);
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: var(--success-color);
    color: var(--white);
}

.btn-success:hover {
    background: #15803d;
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--white);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-danger {
    background: var(--danger-color);
    color: var(--white);
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-sm {
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
}

.btn-group {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

/* ========== Alert ========== */
.alert {
    padding: 0.875rem 1.125rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9375rem;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.alert-warning {
    background: #fef9c3;
    color: #854d0e;
    border: 1px solid #fef08a;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.5;
    padding: 0;
    line-height: 1;
}

.alert-close:hover {
    opacity: 1;
}

/* ========== 表格 ========== */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table tbody tr:hover {
    background: var(--gray-50);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ========== 生命徵象表格 ========== */
.vitals-input-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.vitals-input-table th,
.vitals-input-table td {
    padding: 0.625rem 0.5rem;
    border: 1px solid var(--border-color);
    text-align: center;
}

.vitals-input-table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.vitals-input-table input {
    width: 60px;
    text-align: center;
    padding: 0.375rem 0.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: inherit;
}

.vitals-input-table input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

/* ========== Grid ========== */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* ========== 分隔線 ========== */
.divider {
    border: none;
    border-top: 1px dashed var(--gray-300);
    margin: 1.25rem 0;
}

/* ========== 子區塊 ========== */
.subsection {
    background: var(--gray-50);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.subsection-title {
    font-weight: 600;
    margin-bottom: 0.625rem;
    color: var(--primary-color);
    font-size: 0.9375rem;
}

/* ========== 空狀態 ========== */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1rem;
    margin: 0;
}

/* ========== Footer ========== */
.footer {
    text-align: center;
    padding: 1.25rem;
    color: var(--text-muted);
    font-size: 0.8125rem;
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
}

/* ========== 輔助類別 ========== */
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary-color { color: var(--primary-color); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.mr-2 { margin-right: 0.5rem; }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

/* ========== Badge ========== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-primary {
    background: rgba(30, 58, 95, 0.1);
    color: var(--primary-color);
}

.badge-success {
    background: rgba(22, 163, 74, 0.1);
    color: var(--success-color);
}

.badge-warning {
    background: rgba(202, 138, 4, 0.1);
    color: var(--warning-color);
}

.badge-danger {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger-color);
}

/* ========== 快速操作按鈕 ========== */
.quick-action-btn {
    background: var(--gray-100);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.quick-action-btn:hover {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* ========== 響應式調整 ========== */
@media (max-width: 640px) {
    .navbar {
        padding: 0 1rem;
    }
    
    .nav-brand a {
        font-size: 1rem;
    }
    
    .nav-link {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .container {
        padding: 1rem 0.75rem;
    }
    
    .page-title {
        font-size: 1.25rem;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
        font-size: 0.9375rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        width: 100%;
    }
}
