/* 固越成型機 - IPO 工單稽核系統 CSS 樣式表 */
:root {
    --bg-dark: #0b0f19;
    --card-bg: #151c2e;
    --card-border: rgba(255, 255, 255, 0.08);
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --primary: #0284c7;
    --accent-green: #10b981;
    --accent-purple: #a855f7;
    --accent-orange: #f59e0b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    padding: 1.5rem;
    min-height: 100vh;
}
.container { max-width: 1440px; margin: 0 auto; }

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--card-border);
    flex-wrap: wrap;
    gap: 1rem;
}

.header-title h1 { font-size: 1.5rem; font-weight: 700; color: #f8fafc; }
.header-actions { display: flex; gap: 0.75rem; }

.tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.75rem;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    padding: 0.55rem 1rem;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab-btn.active {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.filter-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-group { display: flex; align-items: center; gap: 0.5rem; }
.form-group label { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
.form-control {
    background: #0f172a;
    border: 1px solid var(--card-border);
    color: white;
    padding: 0.45rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    outline: none;
}

.btn {
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: white;
    border: none;
    padding: 0.5rem 1.1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4); }
.btn-success { background: linear-gradient(135deg, #059669, #10b981); }
.btn-danger { background: linear-gradient(135deg, #dc2626, #b91c1c); }

.table-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}

.data-table th {
    background: rgba(15, 23, 42, 0.8);
    color: var(--text-muted);
    padding: 0.85rem 1rem;
    font-weight: 600;
    border-bottom: 1px solid var(--card-border);
}

.data-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
}

.data-table tr:hover { background: rgba(255, 255, 255, 0.02); }

.status-badge { display: inline-flex; align-items: center; padding: 0.2rem 0.55rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 700; }
.badge-completed { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-running { background: rgba(56, 189, 248, 0.2); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.badge-adhoc { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.badge-live { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-mock { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }

.accordion-row { background: rgba(15, 23, 42, 0.4); }
.nested-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; background: #0f172a; margin: 0.5rem 0; border-radius: 8px; overflow: hidden; }
.nested-table th { background: #1e293b; color: #94a3b8; padding: 0.5rem 0.75rem; }
.nested-table td { padding: 0.5rem 0.75rem; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }

#toast-container { position: fixed; bottom: 2rem; right: 2rem; z-index: 2000; }
.toast { background: #1e293b; color: white; padding: 0.75rem 1.25rem; border-radius: 8px; border-left: 4px solid var(--primary); box-shadow: 0 10px 25px rgba(0,0,0,0.5); margin-top: 0.5rem; font-size: 0.9rem; }
