:root { --brand-green: #00ad63; --brand-green-dark: #007a46; --brand-green-soft: #e9f8f1; --brand-charcoal: #17211d; }
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif; background: #f3f7f5; color: #1f2430; }
body.modal-open { overflow: hidden; }

.toast-region { position: fixed; top: 18px; right: 18px; z-index: 1200; display: grid; gap: 10px; width: min(390px, calc(100vw - 28px)); pointer-events: none; }
.app-toast { display: grid; grid-template-columns: 26px 1fr 24px; align-items: center; gap: 9px; padding: 12px 11px; border: 1px solid #cbd5e1; border-left: 5px solid var(--brand-green); border-radius: 9px; background: #fff; box-shadow: 0 14px 35px rgba(15,23,42,.18); animation: toast-in .18s ease-out; pointer-events: auto; }
.app-toast.toast-success { border-left-color: #16a34a; }
.app-toast.toast-error { border-left-color: #dc2626; }
.app-toast.toast-warning { border-left-color: #f59e0b; }
.toast-icon { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: var(--brand-green-soft); color: var(--brand-green-dark); font-weight: 800; }
.toast-success .toast-icon { background: #dcfce7; color: #166534; }
.toast-error .toast-icon { background: #fee2e2; color: #b91c1c; }
.toast-warning .toast-icon { background: #fef3c7; color: #92400e; }
.toast-text { min-width: 0; color: #334155; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.toast-close { border: 0; background: transparent; color: #64748b; cursor: pointer; font-size: 20px; line-height: 1; }
.toast-leaving { opacity: 0; transform: translateX(16px); transition: .18s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.confirm-overlay { position: fixed; inset: 0; z-index: 1300; display: grid; place-items: center; padding: 20px; background: rgba(15,23,42,.58); backdrop-filter: blur(2px); }
.confirm-dialog { width: min(100%, 440px); display: grid; grid-template-columns: 46px 1fr; gap: 14px; padding: 22px; border-radius: 13px; background: #fff; box-shadow: 0 24px 70px rgba(15,23,42,.34); }
.confirm-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; background: #fef3c7; color: #92400e; font-size: 22px; font-weight: 800; }
.confirm-danger .confirm-icon { background: #fee2e2; color: #b91c1c; }
.confirm-copy h2 { margin: 1px 0 7px; font-size: 19px; }
.confirm-copy p { margin: 0; color: #64748b; font-size: 13px; line-height: 1.5; }
.confirm-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 9px; margin-top: 8px; }
.confirm-action-button { border: 0; border-radius: 7px; background: #d97706; color: #fff; padding: 9px 16px; cursor: pointer; font-weight: 700; }
.confirm-danger .confirm-action-button { background: #dc2626; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(135deg, #10271f, var(--brand-green)); }
.login-card { width: min(100%, 410px); padding: 30px; border-top: 5px solid var(--brand-green); border-radius: 14px; background: #fff; box-shadow: 0 20px 45px rgba(15, 23, 42, .28); }
.brand-logo-frame { overflow: hidden; background: #fff; }
.brand-logo { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 50%; }
.login-logo-frame { width: 255px; height: 88px; margin: -8px auto 10px; }
.login-brand { color: #1d4ed8; font-size: 13px; font-weight: 800; letter-spacing: .12em; }
.login-card h1 { margin: 8px 0 6px; font-size: 24px; }
.login-card > p { margin: 0 0 22px; color: #64748b; font-size: 13px; }
.login-card label { display: grid; gap: 6px; margin-top: 14px; font-size: 13px; font-weight: 600; }
.login-card input { width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 7px; font-size: 15px; }
.login-card button { width: 100%; margin-top: 20px; padding: 11px; border: 0; border-radius: 7px; background: var(--brand-green); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; }
.login-card button:hover { background: var(--brand-green-dark); }
.login-card button:disabled { opacity: .65; cursor: default; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px; flex: 0 0 230px; padding: 24px 14px; background: var(--brand-charcoal); color: #fff;
}
.sidebar-brand { padding: 0 10px 22px; border-bottom: 1px solid rgba(255,255,255,0.16); }
.sidebar-logo-frame { width: 100%; height: 64px; margin-bottom: 10px; border-radius: 6px; }
.sidebar-brand strong { display: block; font-size: 12px; letter-spacing: 0.4px; color: #fff; }
.sidebar-brand span { display: block; margin-top: 4px; color: #9de3c4; font-size: 12px; }
.sidebar-nav { display: grid; gap: 7px; margin-top: 20px; }
.sidebar-item {
  width: 100%; padding: 11px 12px; border: 0; border-radius: 7px; background: transparent;
  color: #dbeafe; font-size: 14px; text-align: left; cursor: pointer;
}
.sidebar-item.active { background: var(--brand-green); color: #fff; font-weight: 600; }
.sidebar-item:hover:not(.active) { background: rgba(0,173,99,.14); color: #fff; }
.sidebar-item:disabled { color: #93a4c7; cursor: not-allowed; opacity: 0.72; }
.sidebar-user { margin-top: 26px; padding: 14px 10px 0; border-top: 1px solid rgba(255,255,255,.16); }
.sidebar-user strong, .sidebar-user span { display: block; }
.sidebar-user strong { font-size: 13px; }
.sidebar-user span { margin-top: 3px; color: #bfdbfe; font-size: 11px; }
.sidebar-user button { margin-top: 10px; padding: 6px 10px; border: 1px solid rgba(255,255,255,.25); border-radius: 6px; background: transparent; color: #fff; cursor: pointer; font-size: 12px; }
.main-content { min-width: 0; flex: 1; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 24px 20px 60px; }

.topbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.topbar h1 { font-size: 18px; margin: 0; }
.topbar nav button {
  padding: 8px 16px; margin-left: 8px; border: 1px solid #ccc; background: #fff;
  border-radius: 6px; cursor: pointer; font-size: 14px;
}
.topbar nav button.active { background: var(--brand-green); color: #fff; border-color: var(--brand-green); }

.module-header { margin-bottom: 20px; }
.module-header h1 { margin: 0; font-size: 22px; }
.module-header p { margin: 6px 0 0; color: #667085; font-size: 14px; }
.dashboard-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px;
}
.dashboard-header h1 { margin: 0; font-size: 24px; }
.dashboard-header p { margin: 6px 0 0; color: #667085; font-size: 14px; }
.dashboard-actions { display: flex; align-items: center; gap: 12px; color: #667085; font-size: 12px; }
.dashboard-actions button {
  border: 1px solid #b6ddcc; background: #fff; color: var(--brand-green-dark); border-radius: 7px; padding: 8px 14px; cursor: pointer;
}
.dashboard-actions button:disabled { opacity: .6; cursor: default; }
.status-summary { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.summary-card {
  min-width: 0; border: 1px solid #e2e8f0; border-top: 4px solid #64748b; border-radius: 9px; background: #fff;
  padding: 12px; text-align: left; cursor: pointer; color: #334155;
}
.summary-card span { display: block; font-size: 11px; line-height: 1.25; }
.summary-card strong { display: block; margin-top: 5px; font-size: 24px; color: #0f172a; }
.summary-card.available { border-top-color: #16a34a; }
.summary-card.running { border-top-color: #2563eb; }
.summary-card.cutter-change { border-top-color: #7c3aed; }
.summary-card.setting-change { border-top-color: #ea580c; }
.summary-card.handover { border-top-color: #f59e0b; }
.summary-card.breakdown { border-top-color: #dc2626; }
.summary-card.stopped { border-top-color: #64748b; }
.summary-card.is-active { outline: 2px solid var(--brand-green); outline-offset: 1px; }
.machine-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.machine-card {
  border: 1px solid #e2e8f0; border-left: 5px solid #64748b; border-radius: 10px; background: #fff;
  padding: 16px; box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
}
.machine-card.available { border-left-color: #16a34a; }
.machine-card.running { border-left-color: #2563eb; }
.machine-card.cutter-change { border-left-color: #7c3aed; }
.machine-card.setting-change { border-left-color: #ea580c; }
.machine-card.handover-pending { border-left-color: #f59e0b; }
.machine-card.breakdown { border-left-color: #dc2626; }
.machine-card.stopped { border-left-color: #64748b; }
.machine-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.machine-card-head h2 { margin: 0; font-size: 19px; }
.machine-card-head p { margin: 4px 0 0; color: #64748b; font-size: 12px; }
.machine-status { border-radius: 999px; background: #f1f5f9; color: #334155; padding: 5px 9px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.machine-card.available .machine-status { background: #dcfce7; color: #166534; }
.machine-card.running .machine-status { background: #dbeafe; color: #1d4ed8; }
.machine-card.cutter-change .machine-status { background: #ede9fe; color: #6d28d9; }
.machine-card.setting-change .machine-status { background: #ffedd5; color: #c2410c; }
.machine-card.handover-pending .machine-status { background: #fef3c7; color: #92400e; }
.machine-card.breakdown .machine-status { background: #fee2e2; color: #991b1b; }
.machine-available-text { min-height: 58px; margin: 18px 0; color: #667085; font-size: 13px; }
.machine-details { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 12px; margin: 16px 0; }
.machine-details div { min-width: 0; }
.machine-details dt { color: #64748b; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.machine-details dd { margin: 2px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.machine-action { width: 100%; border: 1px solid #a8dfc8; background: var(--brand-green-soft); color: var(--brand-green-dark); border-radius: 7px; padding: 8px 10px; cursor: pointer; font-weight: 600; }
.dashboard-empty { grid-column: 1 / -1; padding: 42px 20px; border: 1px dashed #cbd5e1; border-radius: 10px; background: #fff; color: #64748b; text-align: center; }
.error-text { color: #b91c1c; }
.alerts-panel { margin-bottom: 18px; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; padding: 15px; }
.alerts-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.alerts-heading h2 { margin: 0; font-size: 17px; }
.alerts-heading p { margin: 4px 0 0; color: #64748b; font-size: 12px; }
.alert-count { display: inline-grid; min-width: 24px; height: 24px; place-items: center; margin-left: 5px; border-radius: 999px; background: #e2e8f0; color: #475569; font-size: 12px; }
.alert-count.has-alerts { background: #fee2e2; color: #b91c1c; }
.alert-thresholds { color: #64748b; font-size: 11px; }
.alerts-list { display: grid; gap: 8px; margin-top: 13px; }
.alerts-empty { padding: 13px; border-radius: 7px; background: #f8fafc; color: #64748b; text-align: center; font-size: 13px; }
.alerts-empty.ok { background: #f0fdf4; color: #166534; }
.alert-item { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border: 1px solid #fed7aa; border-left: 4px solid #f59e0b; border-radius: 8px; background: #fffbeb; color: #78350f; text-align: left; cursor: pointer; }
.alert-item.critical { border-color: #fecaca; border-left-color: #dc2626; background: #fef2f2; color: #991b1b; }
.alert-icon { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; background: rgba(245, 158, 11, .16); font-weight: 800; }
.alert-item.critical .alert-icon { background: rgba(220, 38, 38, .12); }
.alert-copy { min-width: 0; }
.alert-copy strong, .alert-copy span { display: block; }
.alert-copy strong { font-size: 13px; }
.alert-copy span { margin-top: 2px; font-size: 12px; }
.alert-time { font-size: 11px; font-weight: 700; white-space: nowrap; }
.management-grid { grid-template-columns: repeat(4, 1fr); }
.compact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 720px; }
.list-card { margin-top: 20px; }
.list-card h2 { margin: 0 0 14px; font-size: 17px; }
.active-job-header { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 20px; }
.active-job-header h1 { margin: 0; font-size: 24px; }
.active-job-header p { margin: 6px 0 0; color: #667085; font-size: 14px; }
.secondary-button { border: 1px solid #b6ddcc; border-radius: 7px; background: #fff; color: var(--brand-green-dark); padding: 9px 14px; cursor: pointer; }
.management-form-actions { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.backup-summary-card { display: flex; justify-content: space-between; align-items: center; gap: 20px; border-left: 5px solid var(--brand-green); }
.backup-summary-card h2, .backup-restore-card h2 { margin: 0; font-size: 18px; }
.backup-summary-card p, .backup-restore-card > p { margin: 6px 0 0; color: #64748b; font-size: 13px; line-height: 1.5; }
.backup-restore-card { margin-top: 18px; border-left: 5px solid #dc2626; background: #fff7f7; }
.backup-schedule-card { margin-top: 18px; border-left: 5px solid #16a34a; }
.backup-schedule-card h2 { margin: 0; font-size: 18px; }
.danger-button { background: #dc2626; }
.list-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.table-actions { white-space: nowrap; }
.table-action { border: 0; border-radius: 5px; padding: 6px 10px; margin-right: 6px; cursor: pointer; font-weight: 600; }
.table-action.edit { background: #dbeafe; color: #1d4ed8; }
.table-action.delete { background: #fee2e2; color: #b91c1c; }
.table-action.restore { background: #dcfce7; color: #166534; }
.table-action:hover { filter: brightness(.96); }
.table-action:disabled { opacity: .6; cursor: default; }

.active-job-title { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid #e2e8f0; }
.active-job-title div span { display: block; color: #64748b; font-size: 11px; text-transform: uppercase; }
.active-job-title div strong { display: block; margin-top: 4px; font-size: 22px; }
.active-job-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 18px 0 0; }
.active-job-summary div { min-width: 0; }
.active-job-summary dt { color: #64748b; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
.active-job-summary dd { margin: 4px 0 0; font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.end-shift-card { margin-top: 18px; }
.end-shift-card h2 { margin: 0; font-size: 19px; }
.end-shift-card > p { margin: 6px 0 18px; color: #64748b; font-size: 13px; }
#endShiftReadOnlyMessage { margin-top: 18px; }
.handover-summary-card { margin-top: 18px; border-left: 5px solid #f59e0b; }
.handover-summary-card h2 { margin: 0; font-size: 19px; }
.accept-handover-card { margin-top: 18px; border-left: 5px solid #2563eb; }
.accept-handover-card h2 { margin: 0; font-size: 19px; }
.accept-handover-card > p { margin: 6px 0 18px; color: #64748b; font-size: 13px; }
.handover-button { background: #16a34a; }
.machine-action-card { margin-top: 18px; border-left: 5px solid #0f766e; }
.machine-action-card h2 { margin: 0; font-size: 19px; }
.machine-action-card p { margin: 6px 0 14px; color: #64748b; font-size: 13px; }
.machine-action-card label { display: block; max-width: 460px; font-weight: 600; color: #334155; }
.machine-action-card select { margin-top: 6px; width: 100%; }

.cutter-change-card { margin-top: 18px; border-left: 5px solid #7c3aed; }
.cutter-change-card h2 { margin: 0; font-size: 19px; }
.cutter-change-card > p { margin: 6px 0 18px; color: #64748b; font-size: 13px; }
.cutter-change-card.in-progress { background: #faf5ff; }
.cutter-complete-button { background: #16a34a; }
.job-status-cutter-change { background: #ede9fe; color: #6d28d9; }
.setting-change-card { margin-top: 18px; border-left: 5px solid #ea580c; }
.setting-change-card h2 { margin: 0; font-size: 19px; }
.setting-change-card h3 { margin: 18px 0 10px; font-size: 15px; color: #9a3412; }
.setting-change-card > p { margin: 6px 0 18px; color: #64748b; font-size: 13px; }
.setting-change-card.in-progress { background: #fff7ed; }
.setting-start-button { background: #ea580c; }
.setting-complete-button { background: #16a34a; }
.job-status-setting-change { background: #ffedd5; color: #c2410c; }

.job-status-running { background: #dbeafe; color: #1d4ed8; }
.job-status-handover-pending { background: #fef3c7; color: #92400e; }
.job-status-breakdown { background: #fee2e2; color: #991b1b; }
.job-status-stopped { background: #f1f5f9; color: #475569; }
.report-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.report-header h1 { margin: 0; font-size: 24px; }
.report-header p { margin: 6px 0 0; color: #64748b; font-size: 14px; }
.report-actions { display: flex; gap: 8px; }
.report-actions button { border: 1px solid #a8dfc8; border-radius: 7px; background: var(--brand-green-soft); color: var(--brand-green-dark); padding: 9px 12px; cursor: pointer; font-weight: 600; }
.report-actions button:disabled { opacity: .55; cursor: default; }
.report-controls { margin-bottom: 18px; }
.report-tabs { display: flex; gap: 7px; margin-bottom: 15px; }
.report-tabs button { border: 1px solid #cbd5e1; border-radius: 7px; background: #fff; color: #475569; padding: 8px 18px; cursor: pointer; }
.report-tabs button.active { border-color: var(--brand-green); background: var(--brand-green); color: #fff; }
.plan-module-tabs { width: fit-content; margin-bottom: 18px; padding: 8px; }
.plan-module-tabs button { min-width: 140px; }
.report-filter-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.report-filter-row label { display: grid; gap: 5px; color: #475569; font-size: 12px; font-weight: 600; }
.report-filter-row input, .report-filter-row select { min-width: 155px; padding: 9px 10px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; font-size: 14px; }
.report-load-button { margin-top: 0; }
.report-print-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 12px; }
.report-print-heading strong { font-size: 18px; }
.report-print-heading span { color: #475569; font-size: 13px; }
.report-brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 0; }
.report-brand-lockup > div { min-width: 0; }
.report-brand-lockup strong, .report-brand-lockup span { display: block; }
.report-brand-lockup span { margin-top: 3px; }
.report-brand-logo { width: 145px; height: 48px; flex: 0 0 auto; object-fit: cover; object-position: center 50%; background: #fff; }
.plan-print-brand { margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--brand-green); }
.report-kpis { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 9px; margin-bottom: 16px; }
.report-kpis div { padding: 11px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; }
.report-kpis span { display: block; color: #64748b; font-size: 10px; text-transform: uppercase; }
.report-kpis strong { display: block; margin-top: 4px; font-size: 18px; }
.report-table-card { padding: 0; overflow: hidden; }
.report-table { font-size: 11px; }
.report-table th, .report-table td { padding: 8px; vertical-align: top; }
.table-subtext { color: #64748b; font-size: 10px; }
.report-generated { margin-top: 10px; color: #64748b; font-size: 11px; text-align: right; }
.analysis-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.analysis-source-note { margin: -5px 0 14px; color: #64748b; font-size: 12px; }
.analysis-section { margin-top: 16px; }
.analysis-section h2 { margin: 0; padding: 14px 16px; border-bottom: 1px solid #e2e8f0; font-size: 16px; }
.analysis-overdue-row { background: #fff7ed; }
.weekly-plan-filter { display: grid; gap: 5px; color: #475569; font-size: 12px; font-weight: 600; }
.weekly-plan-filter input { padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; font-size: 14px; }
tfoot th { border-top: 2px solid #cbd5e1; background: #f8fafc; }
.monthly-plan-controls { margin-bottom: 18px; }
.monthly-plan-note { margin: 13px 0 0; color: #64748b; font-size: 12px; }
.monthly-plan-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.monthly-plan-summary div { padding: 13px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; }
.monthly-plan-summary span { display: block; color: #64748b; font-size: 10px; text-transform: uppercase; }
.monthly-plan-summary strong { display: block; margin-top: 4px; font-size: 18px; }


.card { background: #fff; border-radius: 10px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid label { display: flex; flex-direction: column; font-size: 13px; font-weight: 500; gap: 4px; }
.grid label.full { grid-column: 1 / -1; }
.grid input, .grid select {
  padding: 8px 10px; border: 1px solid #d0d3d8; border-radius: 6px; font-size: 14px; background: #fff;
}
.grid input:disabled, .grid select:disabled { background: #f1f5f9; color: #94a3b8; cursor: not-allowed; }
.grid input:focus, .grid select:focus, .login-card input:focus { border-color: var(--brand-green); outline: 3px solid rgba(0,173,99,.13); }
.hint { font-weight: 400; color: #888; font-size: 11px; }
.err { color: #c0392b; font-size: 12px; font-weight: 400; display: none; }

.submit {
  margin-top: 20px; padding: 10px 24px; background: var(--brand-green); color: #fff; border: none;
  border-radius: 6px; font-size: 14px; cursor: pointer;
}
.submit:hover:not(:disabled) { background: var(--brand-green-dark); }
.submit:disabled { opacity: 0.6; cursor: default; }

.banner { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 14px; display: none; }
.banner.success { background: #e6f4ea; color: #1e7b34; display: block; }
.banner.error { background: #fdecea; color: #c0392b; display: block; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 10px; border-bottom: 1px solid #eee; text-align: left; white-space: nowrap; }
th { background: #f8f9fb; font-weight: 600; }
.empty { text-align: center; color: #999; padding: 20px; }

.tag { padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 500; }
.tag.running { background: #e6f4ea; color: #1e7b34; }
.tag.idle { background: #fff4e0; color: #a3690a; }
.tag.breakdown { background: #fdecea; color: #c0392b; }

.hidden { display: none !important; }

@media (max-width: 800px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; flex-basis: auto; padding: 14px; }
  .sidebar-brand { padding: 0 4px 12px; }
  .sidebar-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
  .sidebar-item { padding: 9px 8px; text-align: center; font-size: 12px; }
  .status-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .machine-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .management-grid { grid-template-columns: repeat(2, 1fr); }
  .active-job-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-header { align-items: flex-start; flex-direction: column; }
  .report-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .analysis-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
  .toast-region { top: 10px; right: 10px; width: calc(100vw - 20px); }
  .confirm-dialog { grid-template-columns: 38px 1fr; padding: 18px; }
  .confirm-icon { width: 36px; height: 36px; font-size: 18px; }
  .confirm-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .sidebar-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wrap { padding: 18px 12px 40px; }
  .dashboard-header { align-items: flex-start; flex-direction: column; }
  .alerts-heading { align-items: flex-start; flex-direction: column; }
  .alert-item { grid-template-columns: 28px 1fr; }
  .alert-time { grid-column: 2; }
  .active-job-header { align-items: flex-start; flex-direction: column; }
  .backup-summary-card { align-items: stretch; flex-direction: column; }
  .status-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .machine-grid { grid-template-columns: 1fr; }
  .topbar nav button { margin-left: 0; }
  .management-grid { grid-template-columns: 1fr; }
  .active-job-summary { grid-template-columns: 1fr; }
  .report-actions, .report-filter-row { align-items: stretch; flex-direction: column; width: 100%; }
  .report-filter-row input, .report-filter-row select { min-width: 0; width: 100%; }
  .report-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analysis-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { grid-template-columns: 1fr; }
  .monthly-plan-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media print {
  @page { size: landscape; margin: 10mm; }
  body { background: #fff; }
  body * { visibility: hidden; }
  #reportModule, #reportModule * { visibility: visible; }
  #reportModule { position: absolute; inset: 0; width: 100%; }
  .report-header, .report-controls, #reportMessage, .report-actions { display: none !important; }
  .report-kpis { grid-template-columns: repeat(8, 1fr); gap: 4px; }
  .report-kpis div { padding: 6px; box-shadow: none; }
  .report-table-card { box-shadow: none; }
  .report-table { font-size: 8px; }
  .report-table th, .report-table td { padding: 4px; white-space: normal; }
  body.weekly-plan-print #reportModule { display: none !important; }
  body.weekly-plan-print #productionPlanModule { display: block !important; }
  body.weekly-plan-print .plan-module-tabs { display: none !important; }
  body.weekly-plan-print #weeklyPlanModule, body.weekly-plan-print #weeklyPlanModule * { visibility: visible; }
  body.weekly-plan-print #weeklyPlanModule { display: block !important; position: absolute; inset: 0; width: 100%; }
  body.weekly-plan-print #weeklyPlanModule > .report-header,
  body.weekly-plan-print #weeklyPlanForm,
  body.weekly-plan-print .weekly-plan-filter,
  body.weekly-plan-print .weekly-plan-actions-column { display: none !important; }
  body.weekly-plan-print .weekly-plan-print-area { margin: 0; padding: 0; box-shadow: none; }
  body.weekly-plan-print .weekly-plan-print-area table { font-size: 9px; }
  body.weekly-plan-print .weekly-plan-print-area th, body.weekly-plan-print .weekly-plan-print-area td { padding: 5px; white-space: normal; }
  body.monthly-plan-print #reportModule { display: none !important; }
  body.monthly-plan-print #productionPlanModule { display: block !important; }
  body.monthly-plan-print .plan-module-tabs { display: none !important; }
  body.monthly-plan-print #monthlyPlanModule, body.monthly-plan-print #monthlyPlanModule * { visibility: visible; }
  body.monthly-plan-print #monthlyPlanModule { display: block !important; position: absolute; inset: 0; width: 100%; }
  body.monthly-plan-print #monthlyPlanModule > .report-header,
  body.monthly-plan-print .monthly-plan-controls,
  body.monthly-plan-print #monthlyPlanMessage,
  body.monthly-plan-print .monthly-plan-summary { display: none !important; }
  body.monthly-plan-print .monthly-plan-print-area { margin: 0; padding: 0; box-shadow: none; }
  body.monthly-plan-print .monthly-plan-print-area table { font-size: 10px; }
  body.monthly-plan-print .monthly-plan-print-area th, body.monthly-plan-print .monthly-plan-print-area td { padding: 6px; white-space: normal; }
  body.admin-analysis-print #reportModule { display: none !important; }
  body.admin-analysis-print #adminAnalysisModule, body.admin-analysis-print #adminAnalysisModule * { visibility: visible; }
  body.admin-analysis-print #adminAnalysisModule { display: block !important; position: absolute; inset: 0; width: 100%; }
  body.admin-analysis-print #adminAnalysisModule > .report-header,
  body.admin-analysis-print #adminAnalysisModule > .report-controls,
  body.admin-analysis-print #adminAnalysisMessage { display: none !important; }
  body.admin-analysis-print .admin-analysis-print-area { margin: 0; padding: 0; }
  body.admin-analysis-print .analysis-kpis { grid-template-columns: repeat(5, 1fr); gap: 4px; }
  body.admin-analysis-print .analysis-section { box-shadow: none; break-inside: auto; }
  body.admin-analysis-print .analysis-section table { font-size: 7px; }
  body.admin-analysis-print .analysis-section th,
  body.admin-analysis-print .analysis-section td { padding: 4px; white-space: normal; }
}
