/* Residence OS facilities operations layer */
:root {
  --facility-critical: #ff6b63;
  --facility-overdue: #f2a65a;
  --facility-info: #66c7d1;
  --facility-surface: rgba(255, 255, 255, 0.055);
}

.content { font-size: 14px; }
.page-in { max-width: 1500px; }
.ph { display:flex; align-items:flex-end; justify-content:space-between; gap:24px; flex-wrap:wrap; }
.ph-copy { max-width:780px; }
.ph-title { font-size:clamp(25px,3vw,42px); }
.ph-sub { max-width:760px; font-size:14px; line-height:1.7; }
.ph-actions { display:flex; gap:10px; flex-wrap:wrap; }

.facility-button {
  min-height:42px; padding:0 16px; border:1px solid rgba(212,175,55,.3); border-radius:7px;
  background:transparent; color:var(--gold); font:700 11px/1 Montserrat,Arial,sans-serif;
  letter-spacing:.07em; text-transform:uppercase; cursor:pointer;
}
.facility-button:hover,.facility-button:focus-visible { border-color:var(--aqua); color:var(--aqua); }
.facility-button.primary { background:var(--gold); color:#171412; border-color:var(--gold); }
.facility-button.aqua { background:var(--aqua); color:#102326; border-color:var(--aqua); }
.facility-button.small { min-height:32px; padding:0 10px; font-size:9px; }
.facility-button:disabled { opacity:.38; cursor:not-allowed; }

.ops-banner {
  margin-bottom:18px; padding:14px 16px; display:flex; align-items:center; justify-content:space-between; gap:15px;
  border:1px solid rgba(64,199,199,.28); border-radius:8px; background:rgba(64,199,199,.08);
}
.ops-banner strong { display:block; margin-bottom:3px; color:var(--aqua); font-size:12px; }
.ops-banner span { color:var(--muted); font-size:12px; line-height:1.5; }
.sync-chip { flex:0 0 auto; padding:7px 10px; border-radius:999px; background:rgba(46,204,113,.13); color:#76dda1!important; font-size:10px!important; font-weight:700; }
.sync-chip.local { background:rgba(242,166,90,.14); color:#f2b77f!important; }

.ops-metrics { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:12px; margin:18px 0; }
.ops-metric { min-height:124px; padding:18px; border:1px solid var(--line); border-radius:9px; background:var(--facility-surface); }
.ops-metric span { color:var(--muted); font-size:10px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; }
.ops-metric strong { display:block; margin:18px 0 6px; font-family:'Cinzel Display',Georgia,serif; font-size:29px; font-weight:400; }
.ops-metric small { color:var(--muted); font-size:11px; line-height:1.45; }
.ops-metric[data-tone="bad"] strong { color:var(--facility-critical); }
.ops-metric[data-tone="warn"] strong { color:var(--facility-overdue); }
.ops-metric[data-tone="ok"] strong { color:#76dda1; }

.ops-grid { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(320px,.6fr); gap:16px; }
.ops-panel { border:1px solid var(--line); border-radius:9px; background:var(--facility-surface); overflow:hidden; }
.ops-panel-head { min-height:58px; padding:14px 16px; display:flex; align-items:center; justify-content:space-between; gap:15px; border-bottom:1px solid var(--line); }
.ops-panel-head h3 { margin:0; font-family:'Cinzel Display',Georgia,serif; font-size:17px; font-weight:400; }
.ops-panel-head span { color:var(--muted); font-size:11px; }
.ops-panel-body { padding:16px; }

.attention-list,.activity-list,.ppm-list,.handover-list,.booking-list,.vendor-list { display:grid; gap:10px; }
.attention-row,.activity-row,.ppm-row,.handover-row,.booking-row,.vendor-row {
  padding:13px; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:12px; align-items:center;
  border:1px solid rgba(247,243,238,.08); border-radius:7px; background:rgba(0,0,0,.12);
}
.attention-row strong,.activity-row strong,.ppm-row strong,.handover-row strong,.booking-row strong,.vendor-row strong { display:block; margin-bottom:4px; font-size:12px; }
.attention-row small,.activity-row small,.ppm-row small,.handover-row small,.booking-row small,.vendor-row small { color:var(--muted); font-size:10px; line-height:1.5; }

.ops-toolbar { margin:18px 0 13px; display:flex; gap:9px; align-items:center; flex-wrap:wrap; }
.ops-toolbar input,.ops-toolbar select,.ops-form input,.ops-form select,.ops-form textarea {
  min-height:42px; padding:9px 11px; border:1px solid var(--line); border-radius:7px;
  background:rgba(255,255,255,.055); color:var(--text); font:500 12px/1.4 Montserrat,Arial,sans-serif;
}
.ops-toolbar input { min-width:250px; flex:1 1 280px; }
.ops-toolbar select { min-width:150px; }
.ops-toolbar option,.ops-form option { background:#1c1c1e; color:#f7f3ee; }

.data-table-wrap { overflow:auto; border:1px solid var(--line); border-radius:9px; }
.data-table { width:100%; min-width:1040px; border-collapse:collapse; }
.data-table th { padding:12px; text-align:left; background:rgba(247,243,238,.06); color:var(--muted); font-size:9px; letter-spacing:.08em; text-transform:uppercase; }
.data-table td { padding:13px 12px; border-top:1px solid var(--line); vertical-align:top; font-size:11px; line-height:1.5; }
.data-table tbody tr:hover { background:rgba(64,199,199,.035); }
.data-table strong { font-size:12px; }
.data-table small { color:var(--muted); font-size:10px; }
[dir="rtl"] .data-table th { text-align:right; }

.ops-pill { display:inline-flex; align-items:center; min-height:25px; padding:4px 8px; border-radius:999px; background:rgba(247,243,238,.08); color:var(--muted); font-size:9px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; }
.ops-pill.open,.ops-pill.overdue,.ops-pill.critical { background:rgba(229,84,75,.16); color:#ff8a82; }
.ops-pill.in_progress,.ops-pill.due,.ops-pill.high { background:rgba(242,166,90,.16); color:#f2bd85; }
.ops-pill.completed,.ops-pill.pass,.ops-pill.active,.ops-pill.on_track { background:rgba(46,204,113,.14); color:#78dda2; }
.ops-pill.waiting_approval,.ops-pill.scheduled,.ops-pill.medium { background:rgba(64,199,199,.14); color:#74d6de; }
.ops-pill.low,.ops-pill.closed { background:rgba(247,243,238,.08); color:var(--muted); }
.ops-pill.unread { background:rgba(242,166,90,.16); color:#f2bd85; }
.ops-pill.read { background:rgba(64,199,199,.14); color:#74d6de; }
.ops-pill.resolved { background:rgba(46,204,113,.14); color:#78dda2; }

.work-card-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.work-card { padding:16px; border:1px solid var(--line); border-radius:9px; background:var(--facility-surface); }
.work-card-head { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; }
.work-card-id { color:var(--aqua); font-size:10px; font-weight:700; letter-spacing:.07em; }
.work-card h3 { margin:10px 0 8px; font-size:13px; line-height:1.45; }
.work-card-meta { display:grid; gap:6px; margin:13px 0; color:var(--muted); font-size:10px; }
.work-card-actions { display:flex; gap:7px; align-items:center; flex-wrap:wrap; padding-top:12px; border-top:1px solid var(--line); }
.sla-line { height:5px; margin-top:10px; border-radius:5px; overflow:hidden; background:rgba(247,243,238,.08); }
.sla-line i { display:block; height:100%; background:#76dda1; }
.sla-line.overdue i { background:var(--facility-critical); }

.asset-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.asset-card { padding:16px; border:1px solid var(--line); border-radius:9px; background:var(--facility-surface); }
.asset-code { color:var(--aqua); font-size:9px; font-weight:700; letter-spacing:.08em; }
.asset-card h3 { min-height:38px; margin:9px 0 5px; font-size:13px; line-height:1.45; }
.asset-card p { margin:0 0 13px; color:var(--muted); font-size:10px; line-height:1.5; }
.asset-facts { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.asset-facts div { padding:8px; background:rgba(0,0,0,.13); border-radius:6px; }
.asset-facts span { display:block; margin-bottom:3px; color:var(--muted); font-size:8px; text-transform:uppercase; }
.asset-facts strong { font-size:10px; }

.progress-track { height:7px; overflow:hidden; border-radius:7px; background:rgba(247,243,238,.08); }
.progress-track i { display:block; height:100%; background:var(--aqua); }

.alert-list { display:grid; gap:10px; }
.alert-card {
  min-height:112px; padding:16px; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:18px; align-items:center;
  border:1px solid var(--line); border-left:3px solid var(--aqua); border-radius:9px; background:var(--facility-surface);
}
[dir="rtl"] .alert-card { border-left:1px solid var(--line); border-right:3px solid var(--aqua); }
.alert-card.critical { border-left-color:var(--facility-critical); }
[dir="rtl"] .alert-card.critical { border-right-color:var(--facility-critical); }
.alert-card.high { border-left-color:var(--facility-overdue); }
[dir="rtl"] .alert-card.high { border-right-color:var(--facility-overdue); }
.alert-card h3 { margin:10px 0 5px; font-size:14px; line-height:1.45; }
.alert-card p { margin:0 0 7px; color:var(--muted); font-size:12px; }
.alert-card small { color:var(--muted); font-size:11px; }
.audit-panel { margin-top:16px; }
.evidence-table { min-width:980px; }
.evidence-chips { display:flex; gap:7px; flex-wrap:wrap; }
.evidence-chip { padding:8px 10px; border:1px solid var(--line); border-radius:7px; background:rgba(0,0,0,.14); }
.evidence-chip strong,.evidence-chip small { display:block; }
.evidence-chip strong { font-size:11px; }
.evidence-chip small { margin-top:3px; color:var(--muted); font-size:9px; }
.ops-field input[type="file"] { padding:8px; }
.ops-field input[type="file"]::file-selector-button { margin-right:10px; padding:8px 10px; border:0; border-radius:5px; background:var(--gold); color:#171412; font:700 10px Montserrat,Arial,sans-serif; cursor:pointer; }
[dir="rtl"] .ops-field input[type="file"]::file-selector-button { margin-right:0; margin-left:10px; }

.ops-modal-layer { position:fixed; inset:0; z-index:1000; display:grid; place-items:center; padding:20px; background:rgba(0,0,0,.68); }
.ops-modal-layer[hidden] { display:none; }
.ops-modal { width:min(760px,100%); max-height:calc(100vh - 40px); overflow:auto; border:1px solid rgba(212,175,55,.25); border-radius:12px; background:#191716; box-shadow:0 30px 90px rgba(0,0,0,.5); }
.ops-modal-head { padding:18px 20px; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid var(--line); }
.ops-modal-head h2 { margin:0; font-family:'Cinzel Display',Georgia,serif; font-size:22px; font-weight:400; }
.ops-modal-close { border:0; background:transparent; color:var(--text); font-size:24px; cursor:pointer; }
.ops-form { padding:20px; display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.ops-field { display:grid; gap:6px; }
.ops-field.wide { grid-column:1/-1; }
.ops-field label { color:var(--muted); font-size:9px; font-weight:700; letter-spacing:.07em; text-transform:uppercase; }
.ops-form textarea { min-height:90px; resize:vertical; }
.ops-form-actions { grid-column:1/-1; display:flex; justify-content:flex-end; gap:9px; padding-top:8px; }
.ops-message { min-height:20px; grid-column:1/-1; color:var(--aqua); font-size:11px; }

.role-select { min-height:36px; max-width:180px; padding:0 9px; border:1px solid var(--line); border-radius:6px; background:#211f1d; color:var(--text); font-size:10px; }
.sb-item{font:inherit;cursor:pointer;width:100%;text-align:start;border:0;background:transparent;color:var(--text-mut)}.sb-item.active{background:rgba(212,175,55,.12);color:var(--gold)}
.topbar{height:auto;min-height:72px;padding-block:12px;flex-wrap:wrap}.tb-right{flex-wrap:wrap;gap:10px}.role-select{min-height:44px;font-size:13px}.lang-btn,.facility-button,.showcase-steps button{min-height:44px}.tb-menu{min-width:44px;min-height:44px}.ops-field input,.ops-field select,.ops-field textarea{font-size:16px}.ops-field[hidden]{display:none}
@media(max-width:900px){.data-table{min-width:0;display:block}.data-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}.data-table tbody{display:grid;gap:14px}.data-table tr{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);border:1px solid var(--line);border-radius:8px;overflow:hidden}.data-table td{display:block;border:0;padding:12px;min-width:0;overflow-wrap:anywhere;font-size:14px}.data-table td:first-child,.data-table td:last-child{grid-column:1/-1}.data-table td:before{content:attr(data-label);display:block;margin-bottom:5px;font-size:12px;color:var(--muted);font-weight:600}.data-table strong{font-size:14px}.data-table small{font-size:12px}.data-table-wrap{border:0;overflow:visible}.data-table .facility-button{width:100%;font-size:14px}.tb-left{min-width:0}.tb-right{width:100%;justify-content:space-between}.tb-title{font-size:14px}.ops-toolbar{flex-wrap:wrap}.ops-toolbar input,.ops-toolbar select{max-width:100%;min-height:44px;font-size:14px}}
.audit-note { margin-top:16px; padding:13px 15px; border-left:3px solid var(--aqua); background:rgba(64,199,199,.06); color:var(--muted); font-size:11px; line-height:1.6; }
[dir="rtl"] .audit-note { border-left:0; border-right:3px solid var(--aqua); }

@media (max-width:1180px) {
  .ops-metrics { grid-template-columns:repeat(3,1fr); }
  .work-card-grid { grid-template-columns:repeat(2,1fr); }
  .asset-grid { grid-template-columns:repeat(3,1fr); }
}
@media (max-width:900px) {
  .ops-grid { grid-template-columns:1fr; }
  .asset-grid { grid-template-columns:repeat(2,1fr); }
  .role-select { display:block; min-height:44px; max-width:210px; font-size:14px; }
}
@media (max-width:640px) {
  .content { font-size:14px; }
  .ops-banner { align-items:flex-start; flex-direction:column; }
  .ops-metrics,.work-card-grid,.asset-grid { grid-template-columns:1fr; }
  .ops-form { grid-template-columns:1fr; }
  .ops-field.wide,.ops-form-actions,.ops-message { grid-column:1; }
  .ph-actions { width:100%; }
  .ph-actions .facility-button { flex:1 1 auto; }
  .ops-toolbar input,.ops-toolbar select { width:100%; min-width:0; }
  .alert-card { grid-template-columns:1fr; }
  .alert-card .facility-button { width:100%; }
}
