:root {
  --bg: #eef3f9;
  --panel: #ffffff;
  --panel-2: #f2f6fb;
  --line: #d6e0ec;
  --text: #1e2a3a;
  --muted: #64748b;
  --accent: #0f9d82;
  --accent-2: #0b7f69;
  --danger: #d9384a;
  --warning: #b7791f;
  --shadow: 0 10px 30px rgba(30,42,58,.10);
  --radius: 16px;
}
* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; background: linear-gradient(135deg,#f7fafd 0%,#eaf1f9 55%,#eef3f9 100%); color: var(--text); font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
.app-shell { min-height: 100vh; }
.topbar { height: 76px; padding: 0 28px; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid var(--line); background:rgba(255,255,255,.9); backdrop-filter: blur(16px); position:sticky; top:0; z-index:20; }
.brand { display:flex; align-items:center; gap:12px; }
.brand-mark { width:42px; height:42px; display:grid; place-items:center; border-radius:12px; background:linear-gradient(135deg,var(--accent),#2ec4a6); color:#fff; font-weight:900; box-shadow:0 8px 20px rgba(15,157,130,.22); }
.brand strong { display:block; font-size:16px; letter-spacing:.2px; }
.brand small { display:block; color:var(--muted); font-size:11px; margin-top:1px; }
.topbar-right { display:flex; align-items:center; gap:12px; }
.user-pill { color:#334155; background:#f1f5fb; border:1px solid var(--line); border-radius:999px; padding:7px 11px; font-size:12px; }
.layout { display:grid; grid-template-columns:230px minmax(0,1fr); min-height:calc(100vh - 76px); }
.sidebar { border-right:1px solid var(--line); padding:24px 14px; background:rgba(255,255,255,.6); }
nav { display:grid; gap:6px; }
.nav-link { padding:11px 12px; border-radius:11px; color:#55657a; display:flex; align-items:center; gap:10px; font-weight:600; }
.nav-link span { width:20px; text-align:center; font-size:16px; }
.nav-link:hover { background:#e8f0f8; color:#0f172a; }
.nav-link.active { background:rgba(15,157,130,.12); color:var(--accent-2); border:1px solid rgba(15,157,130,.22); }
.sidebar-note { margin:28px 4px 0; padding:14px; border:1px solid var(--line); border-radius:13px; background:#f8fafc; }
.sidebar-note strong,.sidebar-note span,.sidebar-note small { display:block; }
.sidebar-note strong { font-size:11px; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); }
.sidebar-note span { margin-top:4px; font-weight:700; word-break:break-all; }
.sidebar-note small { color:var(--muted); margin-top:6px; font-size:11px; }
.content { padding:30px; max-width:1700px; width:100%; margin:0 auto; }
.page-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin-bottom:24px; }
.page-heading h1 { margin:0; font-size:30px; letter-spacing:-.03em; }
.page-heading p { margin:5px 0 0; color:var(--muted); }
.actions { display:flex; flex-wrap:wrap; gap:9px; }
.btn { display:inline-flex; align-items:center; justify-content:center; gap:7px; border:1px solid transparent; border-radius:10px; padding:10px 14px; font-weight:700; cursor:pointer; transition:.15s ease; }
.btn.disabled, .btn[aria-disabled="true"] { pointer-events:none; opacity:.65; }
.btn:hover { transform:translateY(-1px); }
.btn-primary { background:var(--accent); color:#fff; }
.btn-primary:hover { background:var(--accent-2); }
.btn-secondary { background:#eef3f9; border-color:#d3deea; color:#334155; }
.btn-danger { background:rgba(217,56,74,.08); border-color:rgba(217,56,74,.25); color:#c02c3d; }
.btn-warning { background:rgba(183,121,31,.1); border-color:rgba(183,121,31,.28); color:#96600f; }
.btn-ghost { background:transparent; border-color:var(--line); color:#475569; }
.btn-small { padding:7px 10px; font-size:12px; }
.alert { margin-bottom:18px; padding:12px 14px; border-radius:12px; border:1px solid var(--line); background:#fff; }
.alert.success { border-color:rgba(15,157,130,.3); color:var(--accent-2); }
.alert.error { border-color:rgba(217,56,74,.3); color:#b32533; }
.alert.warning { border-color:rgba(183,121,31,.3); color:#8a5a10; }
.alert a { text-decoration:underline; font-weight:700; }
.steps { margin:0; padding-left:22px; }
.steps li { margin-bottom:12px; padding-left:4px; }
.steps li:last-child { margin-bottom:0; }
.help-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:14px; margin-bottom:18px; }
.help-card { display:block; padding:18px; border:1px solid var(--line); border-radius:14px; background:#f8fafc; }
.help-card:hover { border-color:#9fb3c8; background:#fff; }
.help-card h2 { margin:0 0 6px; font-size:16px; }
.help-card p { margin:0; color:var(--muted); font-size:13px; }
.help-card-art { display:block; width:100%; height:130px; object-fit:contain; margin-bottom:10px; }
.help-figure { margin:18px 0; padding:16px; border:1px solid var(--line); border-radius:16px; background:linear-gradient(145deg,#f8fbfe,#eef5fb); }
.help-figure img { display:block; width:100%; max-width:760px; height:auto; margin:0 auto; }
.help-figure figcaption { margin-top:10px; text-align:center; color:var(--muted); font-size:12px; }
.flow-figure img { max-width:680px; }
.stat-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin-bottom:22px; }
.stat { padding:18px; background:linear-gradient(145deg,#ffffff,#f5f8fc); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); }
.stat .label { color:var(--muted); font-size:12px; }
.stat .value { font-size:28px; font-weight:800; margin-top:3px; }
.card { background:#fff; border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); overflow:hidden; }
.card-head { padding:18px 20px; border-bottom:1px solid var(--line); display:flex; justify-content:space-between; gap:12px; align-items:center; }
.card-head h2 { margin:0; font-size:16px; }
.card-body { padding:20px; }
.table-wrap { overflow:auto; }
table { width:100%; border-collapse:separate; border-spacing:0; min-width:1060px; }
th { text-align:left; padding:12px 10px; color:var(--muted); background:#f4f7fb; font-size:11px; text-transform:uppercase; letter-spacing:.07em; position:sticky; top:0; }
td { padding:12px 10px; border-top:1px solid #e7edf5; vertical-align:middle; }
tbody tr:hover { background:rgba(15,23,42,.02); }
.profile-name { font-weight:800; color:#111827; }
.time-group { display:flex; align-items:center; gap:5px; white-space:nowrap; }
.time-input { width:88px; color:var(--text); background:#fff; border:1px solid #cbd5e1; border-radius:8px; padding:7px 6px; }
.time-input:focus, input:focus, select:focus { outline:2px solid rgba(15,157,130,.25); border-color:var(--accent); }
.statuses { display:flex; flex-direction:column; gap:5px; min-width:100px; }
.badge { display:inline-flex; width:max-content; border-radius:999px; padding:4px 8px; font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.05em; }
.badge-on { background:rgba(15,157,130,.12); color:var(--accent-2); }
.badge-off { background:rgba(217,56,74,.1); color:#b32533; }
.badge-muted { background:#e9eef5; color:var(--muted); }
.row-actions { display:flex; flex-direction:column; gap:6px; min-width:120px; }
.row-actions .btn { width:100%; }
.profile-list { display:grid; gap:14px; }
.profile-card { display:grid; gap:14px; padding:16px; border:1px solid var(--line); border-radius:14px; background:#f8fafc; }
.profile-card-head { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px 16px; }
.profile-card .statuses { flex-direction:row; flex-wrap:wrap; min-width:0; }
.profile-actions { display:flex; flex-wrap:wrap; gap:8px; }
.apply-all { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:10px 12px; border:1px dashed var(--line); border-radius:11px; background:#fff; color:var(--muted); font-size:12px; }
.apply-all select { background:#fff; border:1px solid #cbd5e1; border-radius:8px; padding:6px 8px; color:var(--text); }
.schedule-mode { display:flex; flex-wrap:wrap; align-items:center; gap:10px 14px; padding:10px 12px; border:1px solid var(--line); border-radius:11px; background:#fff; }
.schedule-mode-label { font-size:11px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); }
.mode-option { display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:600; color:#334155; cursor:pointer; }
.mode-option input { accent-color:var(--accent); }
.schedule-mode .help { margin:0; }
.time-controls { display:grid; gap:10px; }
.time-controls[hidden] { display:none; }
.schedule-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:10px; }
.day-block { padding:11px; border:1px solid var(--line); border-radius:11px; background:var(--panel-2); }
.day-label { margin-bottom:8px; color:var(--accent-2); font-size:11px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.day-block .time-group { gap:8px; }
.time-field { display:flex; flex-direction:column; gap:4px; min-width:0; flex:1; }
.time-field span { color:var(--muted); font-size:10px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; }
.day-block .time-input { width:100%; min-width:0; }
.blocked-note { padding:10px 12px; border:1px solid #334155; border-radius:10px; background:#334155; color:#fff; font-size:12px; font-weight:600; }
.form-grid { display:grid; gap:18px; max-width:620px; }
.field label { display:block; font-size:12px; font-weight:700; color:#475569; margin-bottom:7px; }
.field input, .field select { width:100%; background:#fff; border:1px solid #cbd5e1; border-radius:10px; padding:11px 12px; color:var(--text); }
.help { color:var(--muted); font-size:12px; margin-top:6px; }
.table-wrap { overflow-x:auto; }
.table { width:100%; border-collapse:collapse; min-width:880px; }
.table th, .table td { text-align:left; padding:10px 12px; border-bottom:1px solid var(--line); font-size:12px; vertical-align:top; }
.table th { background:#f8fafc; color:var(--muted); font-weight:700; text-transform:uppercase; letter-spacing:.05em; font-size:11px; }
.table td code { display:inline-block; max-width:420px; white-space:pre-wrap; word-break:break-word; font-size:11px; }
.form-inline { display:flex; align-items:center; gap:8px; }
.form-inline select { background:#fff; border:1px solid #cbd5e1; border-radius:9px; padding:7px 10px; color:var(--text); }
.device-list { display:grid; gap:10px; }
.device-card { display:grid; grid-template-columns:28px 1.2fr 1fr 1.1fr auto; gap:14px; align-items:center; padding:14px; border:1px solid #dbe3ee; border-radius:12px; background:#f8fafc; }
.device-card:hover { border-color:#9fb3c8; }
.device-title { font-weight:800; }
.device-meta { color:var(--muted); font-size:12px; word-break:break-word; }
select { appearance:auto; }
.empty { padding:38px; text-align:center; color:var(--muted); }
.login-page { min-height:100vh; display:grid; place-items:center; padding:20px; }
.login-card { width:min(440px,100%); padding:32px; background:#fff; border:1px solid var(--line); border-radius:22px; box-shadow:0 24px 60px rgba(30,42,58,.14); }
.login-brand { text-align:center; margin-bottom:26px; }
.login-brand .brand-mark { margin:0 auto 14px; width:56px; height:56px; font-size:17px; }
.login-brand h1 { margin:0; font-size:27px; }
.login-brand p { color:var(--muted); margin:6px 0 0; }
.login-error { color:#b32533; background:rgba(217,56,74,.07); border:1px solid rgba(217,56,74,.25); padding:10px 12px; border-radius:10px; margin-bottom:15px; }
.login-card .btn { width:100%; margin-top:8px; }
.footer-note { color:var(--muted); font-size:11px; text-align:center; margin-top:18px; }
@media (max-width: 1100px) { .layout { grid-template-columns:1fr; } .sidebar { border-right:0; border-bottom:1px solid var(--line); padding:10px 14px; } nav { display:flex; overflow:auto; } .nav-link { white-space:nowrap; } .sidebar-note { display:none; } .content { padding:20px; } }
@media (max-width: 700px) { .topbar { height:auto; min-height:70px; padding:12px 16px; } .user-pill { display:none; } .page-heading { align-items:flex-start; flex-direction:column; } .page-heading h1 { font-size:25px; } .stat-grid { grid-template-columns:1fr; } .content { padding:15px; } .card-body { padding:15px; } }
