/* Secure24 Platform UI Standard — authoritative visual layer, 2026-10-07 */
:root{
  --s24-module:#1976d2;
  --s24-module-soft:#edf5ff;
  --s24-control-radius:9px;
  --s24-card-radius:12px;
  --s24-border:#dfe7ef;
  --s24-text:#173653;
  --s24-muted:#718096;
}

/* module accents: restrained orientation, Secure24 navy remains the brand */
body[data-s24-view="employees"],body[data-s24-view="attendance"],body[data-s24-view="scheduling"],body[data-s24-view="academy"]{--s24-module:#5b5bd6;--s24-module-soft:#f1f0ff}
body[data-s24-view="finance"],body[data-s24-view="payroll"],body[data-s24-view="payment_requests"]{--s24-module:#167a86;--s24-module-soft:#edf8f8}
body[data-s24-view="fleet"],body[data-s24-view="inventory"]{--s24-module:#a86b08;--s24-module-soft:#fff7e8}
body[data-s24-view="incidents"]{--s24-module:#c9363f;--s24-module-soft:#fff0f1}
body[data-s24-view="clients"],body[data-s24-view="contracts"],body[data-s24-view="tenders"],body[data-s24-view="website_enquiries"]{--s24-module:#1473a9;--s24-module-soft:#edf7fc}
body[data-s24-view="control_room"],body[data-s24-view="zone_map"],body[data-s24-view="sites"]{--s24-module:#0d2b57;--s24-module-soft:#eef3f8}
body[data-s24-view="reception"]{--s24-module:#7a4da3;--s24-module-soft:#f7f0fb}
body[data-s24-view="reports"]{--s24-module:#3f6f5a;--s24-module-soft:#eef7f2}

/* one page rhythm */
#content{display:block}
#content>.card,#content>.panel,#content>.section-card,#content>.table-wrap{margin-bottom:14px}
#content .section-head{min-height:40px}
#content .section-head h2,#content .section-head h3{margin:0}
#content .section-head>div>span,#content .section-head>div>small{display:block;margin-top:3px}

/* module identity without rainbow chrome */
#viewTitle:after{content:"";display:block;width:34px;height:3px;border-radius:999px;background:var(--s24-module);margin-top:7px}
#content .workspace-header,#content .simple-workspace-header,#content .detail-heading{border-top:3px solid var(--s24-module)}
#content .simple-workspace-header,#content .workspace-header{background:linear-gradient(90deg,var(--s24-module-soft),#fff 34%)}

/* authoritative button system */
#content button,.modal-card button,.side-bottom button{
  min-height:40px;
  padding:9px 14px;
  border:1px solid var(--s24-border);
  border-radius:var(--s24-control-radius);
  background:#fff;
  color:var(--s24-text);
  font-size:12.5px;
  font-weight:750;
  line-height:1.15;
  box-shadow:none;
  white-space:nowrap;
}
#content button:hover:not(:disabled),.modal-card button:hover:not(:disabled){border-color:#b9c9d9;background:#f8fafc}
#content button:active:not(:disabled),.modal-card button:active:not(:disabled){transform:translateY(1px)}
#content button.primary,#content button.s24-primary,.modal-card button.primary,.modal-card button.s24-primary{
  background:var(--s24-module)!important;border-color:var(--s24-module)!important;color:#fff!important
}
#content button.success,#content button.s24-success,.modal-card button.s24-success{
  background:#edf8f3!important;border-color:#b9decf!important;color:#116c4a!important
}
#content button.warning,#content button.s24-warning,.modal-card button.s24-warning{
  background:#fff7e8!important;border-color:#ead7aa!important;color:#855604!important
}
#content button.danger,#content button.s24-danger,.modal-card button.danger,.modal-card button.s24-danger{
  background:#fff0f1!important;border-color:#efc7cc!important;color:#b52f38!important
}
#content button:disabled,.modal-card button:disabled{opacity:.48!important;cursor:not-allowed!important;filter:grayscale(.15)}
#content .record-actions,#content .ux-section-tools,#content .toolbar-actions,#content [class*="toolbar-actions"]{
  display:flex;align-items:center;gap:7px;flex-wrap:wrap
}
#content .record-actions button{min-height:34px;padding:7px 10px;font-size:11px}

/* standardized tabs */
#content .employee-profile-tabs,#content .finance-tabs,#content .fleet-tabs,#content .fuel-control-tabs,
#content .academy-tabs,#content .status-filters,#content .employee-tabs,#content .payroll-tabs,
#content .inventory-tabs,#content .s24-tabs,[data-s24-tabs]{
  display:flex!important;align-items:center!important;gap:6px!important;overflow-x:auto!important;
  padding:4px!important;margin:10px 0 14px!important;background:#f3f6f9!important;
  border:1px solid var(--s24-border)!important;border-radius:11px!important;scrollbar-width:thin
}
#content .employee-profile-tabs button,#content .finance-tabs button,#content .fleet-tabs button,#content .fuel-control-tabs button,
#content .academy-tabs button,#content .status-filters button,#content .employee-tabs button,#content .payroll-tabs button,
#content .inventory-tabs button,#content .s24-tabs button,[data-s24-tabs] button{
  flex:0 0 auto!important;min-height:36px!important;padding:8px 12px!important;border:0!important;
  border-radius:8px!important;background:transparent!important;color:#53677b!important;font-weight:750!important
}
#content .employee-profile-tabs button.active,#content .finance-tabs button.active,#content .fleet-tabs button.active,#content .fuel-control-tabs button.active,
#content .academy-tabs button.active,#content .status-filters button.active,#content .employee-tabs button.active,#content .payroll-tabs button.active,
#content .inventory-tabs button.active,#content .s24-tabs button.active,[data-s24-tabs] button.active,
#content [role="tab"][aria-selected="true"]{
  background:#fff!important;color:var(--s24-module)!important;box-shadow:0 1px 4px rgba(13,43,87,.09)!important
}

/* status language: same meaning platform-wide */
#content .pill,#content .badge,#content .status,.modal-card .pill,.modal-card .badge,.modal-card .status{
  display:inline-flex;align-items:center;gap:5px;min-height:25px;padding:4px 8px;border-radius:999px;
  font-size:10px;font-weight:800;line-height:1;border:1px solid transparent
}
.s24-status-success{background:#edf8f3!important;color:#116c4a!important;border-color:#c8e5d7!important}
.s24-status-warning{background:#fff7e8!important;color:#855604!important;border-color:#ead7aa!important}
.s24-status-danger{background:#fff0f1!important;color:#b52f38!important;border-color:#efc7cc!important}
.s24-status-info{background:#edf5ff!important;color:#1769aa!important;border-color:#cfe0f2!important}
.s24-status-neutral{background:#f1f5f9!important;color:#64748b!important;border-color:#e2e8f0!important}

/* forms */
#content label,.modal-card label{display:grid;gap:6px;color:#40546b;font-size:11.5px;font-weight:750}
#content input,#content select,#content textarea,.modal-card input,.modal-card select,.modal-card textarea{
  width:100%;min-height:40px;border:1px solid #d7e0e9;border-radius:var(--s24-control-radius);
  background:#fff;color:#172f49;padding:9px 11px;font-size:13px
}
#content input:focus,#content select:focus,#content textarea:focus,.modal-card input:focus,.modal-card select:focus,.modal-card textarea:focus{
  border-color:var(--s24-module)!important;box-shadow:0 0 0 3px color-mix(in srgb,var(--s24-module) 12%,transparent)!important;outline:0!important
}
#content .form-grid,.modal-card form{column-gap:12px;row-gap:12px}
#content .form-section-title,.modal-card .form-section-title{
  color:var(--s24-module);font-weight:850;font-size:12px;padding:8px 0 6px;border-bottom:1px solid var(--s24-border)
}

/* tables: consistent, readable */
#content .table-wrap{overflow:auto;border:1px solid var(--s24-border);border-radius:11px;background:#fff}
#content table{width:100%;border-collapse:separate;border-spacing:0}
#content thead th{background:#f7f9fb!important;color:#687b8e!important;font-size:9.5px!important;text-transform:uppercase!important;letter-spacing:.04em!important;padding:10px 11px!important}
#content tbody td{padding:10px 11px!important;border-bottom:1px solid #edf1f5!important;font-size:12px!important}
#content tbody tr:last-child td{border-bottom:0!important}
#content tbody tr:hover{background:#fafcff!important}

/* clear cards and empty states */
#content .card,#content .panel,#content .section-card,#content .report-card{
  border:1px solid var(--s24-border)!important;border-radius:var(--s24-card-radius)!important;
  box-shadow:0 1px 4px rgba(13,43,87,.045)!important
}
#content .empty-state{padding:28px 18px!important;text-align:center!important;color:var(--s24-muted)!important;background:#fbfcfd!important;border:1px dashed #cfd9e3!important;border-radius:11px!important}

/* visual feedback: controls are never ambiguous */
#content button[data-s24-busy="1"]{position:relative;pointer-events:none;opacity:.72}
#content button[data-s24-busy="1"]:after{content:"";width:12px;height:12px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;display:inline-block;margin-left:7px;vertical-align:-2px;animation:s24spin .7s linear infinite}
@keyframes s24spin{to{transform:rotate(360deg)}}

/* mobile = no giant horizontal tab bars */
@media(max-width:700px){
  #content{padding:13px!important}
  #content .employee-profile-tabs,#content .finance-tabs,#content .fleet-tabs,#content .fuel-control-tabs,
  #content .academy-tabs,#content .status-filters,#content .employee-tabs,#content .payroll-tabs,
  #content .inventory-tabs,#content .s24-tabs,[data-s24-tabs]{margin-left:0!important;margin-right:0!important}
  #content .section-head{align-items:stretch!important}
  #content .section-head>button,#content .section-head>.ux-section-tools{width:100%}
  #content .section-head>.ux-section-tools{display:grid!important;grid-template-columns:1fr}
  #content .record-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;width:100%}
  #content .record-actions button{white-space:normal!important}
  #content table{min-width:680px}
}
@media(max-width:430px){
  #content .record-actions{grid-template-columns:1fr!important}
}

/* printing */
@media print{
  #content .record-actions,#content [class*="tabs"],#content [data-s24-tabs]{display:none!important}
}

/* workspace loading, errors and unavailable controls */
.s24-loading-state{display:flex;align-items:center;justify-content:center;min-height:120px;color:var(--s24-muted);font-weight:750}
.s24-loading-state:before{content:"";width:18px;height:18px;border:2px solid #cbd7e3;border-top-color:var(--s24-module);border-radius:50%;margin-right:9px;animation:s24spin .75s linear infinite}
.s24-workspace-error{display:grid!important;justify-items:center;gap:8px}
.s24-workspace-error strong{color:#173653;font-size:14px}
.s24-workspace-error span{color:var(--s24-muted);font-size:12px}
#nav button[data-view][aria-disabled="true"],#nav button[data-view]:disabled{opacity:.42!important;cursor:not-allowed!important}
#nav button[data-view][aria-current="page"]{background:var(--s24-blue)!important;color:#fff!important}

/* unified dialogs + toast feedback */
.s24-dialog-overlay{position:fixed;inset:0;z-index:12000;display:grid;place-items:center;padding:18px;background:rgba(13,43,87,.46);backdrop-filter:blur(2px);opacity:0;transition:opacity .16s ease}
.s24-dialog-overlay.open{opacity:1}
.s24-dialog{width:min(500px,100%);background:#fff;border:1px solid var(--s24-border);border-radius:14px;box-shadow:0 24px 70px rgba(13,43,87,.24);overflow:hidden}
.s24-dialog-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;padding:17px 18px 12px;border-bottom:1px solid #edf1f5}
.s24-dialog-head h3{margin:2px 0 0!important;font-size:17px!important;color:#173653!important}
.s24-dialog-eyebrow{font-size:9px;font-weight:850;letter-spacing:.08em;color:#7a8b9d}
.s24-dialog-close{width:34px;min-height:34px!important;height:34px;padding:0!important;border:1px solid #dce4ec!important;border-radius:8px!important;background:#f7f9fb!important;font-size:20px!important;line-height:1!important}
.s24-dialog-body{padding:16px 18px}.s24-dialog-message{margin:0;color:#52677b;font-size:12.5px;line-height:1.55}
.s24-dialog-input-host{margin-top:13px}.s24-dialog-field{display:grid;gap:6px}.s24-dialog-field>span{font-size:11px;font-weight:750;color:#40546b}.s24-dialog-field textarea{min-height:100px}
.s24-dialog-field .invalid{border-color:#c9363f!important;box-shadow:0 0 0 3px rgba(201,54,63,.1)!important}
.s24-dialog-actions{display:flex;justify-content:flex-end;gap:8px;padding:12px 18px 17px}
.s24-dialog-danger{border-top:4px solid #c9363f}.s24-dialog-warning{border-top:4px solid #a36a08}.s24-dialog-success{border-top:4px solid #17845c}
.s24-toast-host{position:fixed;z-index:13000;right:18px;bottom:18px;display:grid;gap:8px;width:min(390px,calc(100vw - 28px));pointer-events:none}
.s24-toast{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:12px 13px;border:1px solid #dce5ed;border-radius:11px;background:#fff;box-shadow:0 12px 35px rgba(13,43,87,.17);opacity:0;transform:translateY(10px);transition:.18s ease;pointer-events:auto}
.s24-toast.visible{opacity:1;transform:none}.s24-toast.leaving{opacity:0;transform:translateY(6px)}
.s24-toast>div{display:grid;gap:2px}.s24-toast strong{font-size:11px;color:#173653}.s24-toast span{font-size:10.5px;color:#607386;line-height:1.4}
.s24-toast button{width:26px;height:26px;min-height:26px!important;padding:0!important;border:0!important;background:transparent!important;color:#718096!important;font-size:17px!important}
.s24-toast-success{border-left:4px solid #17845c}.s24-toast-danger{border-left:4px solid #c9363f}.s24-toast-warning{border-left:4px solid #a36a08}.s24-toast-info{border-left:4px solid #1976d2}
@media(max-width:600px){.s24-dialog-overlay{padding:10px}.s24-dialog-actions{display:grid;grid-template-columns:1fr 1fr}.s24-toast-host{right:14px;bottom:14px}}

/* Users & Roles permission catalog */
.users-role-tabs{margin-top:0!important}
.role-catalog-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:4px 0 12px}
.role-catalog-toolbar>div{display:flex;align-items:baseline;gap:6px}
.role-catalog-toolbar strong{font-size:18px;color:#173653}
.role-catalog-toolbar span{font-size:10px;color:#718096}
.role-catalog-toolbar input{max-width:320px}
.role-catalog-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.role-catalog-card{display:grid;gap:12px;padding:14px!important}
.role-catalog-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.role-catalog-head h3{margin:0;font-size:14px;color:#173653}
.role-catalog-head>div:first-child>span{display:block;margin-top:3px;font-size:9.5px;color:#718096}
.role-catalog-flags{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.role-permission-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.role-permission-grid section{padding:10px;border:1px solid #e1e8ef;border-radius:10px;background:#f8fafc}
.role-permission-grid h4{margin:0 0 7px;font-size:10px;color:#52677b;text-transform:uppercase;letter-spacing:.04em}
.role-chip-list{display:flex;flex-wrap:wrap;gap:5px}
.role-chip-list span{display:inline-flex;padding:5px 7px;border:1px solid #d7e4f1;border-radius:999px;background:#fff;color:#41627f;font-size:9px;font-weight:750}
.role-chip-list.write span{border-color:#c9dfd5;background:#f4fbf7;color:#2d6c53}
.role-chip-list em{font-size:9.5px;color:#8795a5;font-style:normal}
.role-governance-notes{padding:9px 10px;border-left:3px solid var(--s24-module);background:var(--s24-module-soft);border-radius:8px}
.role-governance-notes p{margin:3px 0;font-size:9.5px;color:#52677b}
@media(max-width:900px){.role-catalog-list{grid-template-columns:1fr}}
@media(max-width:600px){.role-catalog-toolbar{align-items:stretch;flex-direction:column}.role-catalog-toolbar input{max-width:none}.role-permission-grid{grid-template-columns:1fr}}

/* required fields and inline validation */
#content label,.modal-card label{position:relative}
.s24-required{display:inline-flex!important;align-items:center!important;width:max-content;margin-left:6px;padding:2px 5px;border-radius:999px;background:#fff0f1;color:#b52f38;font-size:8px!important;font-weight:850!important;line-height:1!important;text-transform:uppercase;letter-spacing:.035em}
#content .s24-invalid,.modal-card .s24-invalid{border-color:#c9363f!important;box-shadow:0 0 0 3px rgba(201,54,63,.10)!important}
.s24-field-error{display:block!important;margin-top:1px;color:#b52f38!important;font-size:9.5px!important;font-weight:650!important;line-height:1.35}

/* submit processing state */
form[data-s24-submitting="1"]{cursor:progress}
form[data-s24-submitting="1"] button[type="submit"],form[data-s24-submitting="1"] button:not([type]){cursor:progress!important}

/* standardized table/list behavior */
#content .table-wrap{position:relative}
#content .table-wrap:focus{outline:2px solid color-mix(in srgb,var(--s24-module) 24%,transparent);outline-offset:2px}
#content thead th{position:sticky;top:0;z-index:2;box-shadow:0 1px 0 #e7edf3}
#content .table-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
#content .table-actions button{min-height:32px!important;padding:6px 9px!important;font-size:10.5px!important}
#content .s24-table-empty td{padding:30px 16px!important;text-align:center!important;background:#fbfcfd!important}
#content .s24-table-empty strong,#content .s24-table-empty span{display:block}
#content .s24-table-empty strong{color:#52677b;font-size:12px}
#content .s24-table-empty span{margin-top:4px;color:#8a98a7;font-size:10px}
@media(max-width:700px){
 #content .table-wrap:after{content:"Scroll horizontally to see more";display:block;position:sticky;left:0;padding:6px 10px;border-top:1px solid #edf1f5;background:#fafcff;color:#8a98a7;font-size:8.5px;text-align:right}
 #content .table-actions{display:grid!important;grid-template-columns:1fr!important}
 #content .table-actions button{width:100%!important;white-space:normal!important}
}

/* standardized search and filters */
#content .s24-search{display:flex;align-items:center;gap:6px;min-width:min(360px,100%);padding:4px;border:1px solid #dfe7ef;border-radius:11px;background:#fff}
#content .s24-search svg{flex:0 0 auto;width:18px;height:18px;margin-left:7px;fill:none;stroke:#7c8da0;stroke-width:1.8}
#content .s24-search input{min-width:0;min-height:34px!important;border:0!important;box-shadow:none!important;padding:7px 4px!important;background:transparent!important}
#content .s24-search button{min-height:32px!important;padding:6px 9px!important;font-size:10.5px!important}
#content .s24-search [data-search-clear]{background:#f4f7fa!important;color:#607386!important}
#content .s24-filter-group{display:flex!important;align-items:center!important;gap:5px!important;flex-wrap:wrap!important}
#content .s24-filter-group button{min-height:34px!important;padding:7px 10px!important;font-size:10.5px!important}
#content .s24-filter-group button.active{background:var(--s24-module)!important;border-color:var(--s24-module)!important;color:#fff!important}
#content .simple-list-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
#content .simple-list-count{color:#718096;font-size:10.5px}
#content .simple-list-count b{color:#173653;font-size:13px}
@media(max-width:700px){
 #content .simple-list-toolbar{display:grid!important;grid-template-columns:1fr!important;align-items:stretch!important}
 #content .s24-search{width:100%;min-width:0}
 #content .s24-filter-group{width:100%}
 #content .s24-filter-group button{flex:1 1 auto}
}

/* modal form actions */
#modalForm .s24-form-actions{display:flex;justify-content:flex-end;gap:8px;grid-column:1/-1;margin-top:4px;padding-top:12px;border-top:1px solid #edf1f5}
#modalForm .s24-form-actions>button{min-width:96px}
@media(max-width:600px){#modalForm .s24-form-actions{display:grid;grid-template-columns:1fr 1fr}#modalForm .s24-form-actions>button{width:100%}}

/* standardized record/detail pages */
#content .s24-back-button{display:inline-flex;align-items:center;gap:6px;min-height:34px!important;margin:0 0 10px;padding:6px 10px!important;border-color:#dfe7ef!important;background:#f8fafc!important;color:#52677b!important;font-size:10.5px!important}
#content .s24-back-button:hover{background:#eef4f8!important;color:#173653!important}
#content .s24-detail-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;padding:15px 16px!important;margin-bottom:12px;border:1px solid var(--s24-border);border-top:3px solid var(--s24-module);border-radius:12px;background:linear-gradient(90deg,var(--s24-module-soft),#fff 34%)}
#content .s24-detail-heading>div:first-child{min-width:0}
#content .s24-detail-heading h3{margin:0!important;color:#173653!important;font-size:18px!important;line-height:1.2}
#content .s24-detail-heading>div:first-child>span,#content .s24-detail-heading>span:not(.pill){display:block;margin-top:4px;color:#718096;font-size:10.5px}
#content .s24-detail-status{flex:0 0 auto}
#content .s24-detail-actions{display:flex;align-items:center;gap:7px;flex-wrap:wrap;justify-content:flex-end}
#content .s24-detail-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
#content .s24-detail-grid>div{padding:10px 11px;border:1px solid #e1e8ef;border-radius:9px;background:#f8fafc}
#content .s24-detail-grid>div>b{display:block;margin-bottom:4px;color:#718096;font-size:9px;text-transform:uppercase;letter-spacing:.035em}
#content .s24-detail-grid>div>span{display:block;color:#173653;font-size:11.5px;line-height:1.4;word-break:break-word}
#content .s24-detail-section{margin-top:12px}
@media(max-width:900px){#content .s24-detail-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:650px){
 #content .s24-detail-heading{display:grid}
 #content .s24-detail-actions{justify-content:stretch;display:grid;grid-template-columns:1fr}
 #content .s24-detail-actions button{width:100%}
 #content .s24-detail-grid{grid-template-columns:1fr}
 #content .s24-back-button{width:max-content}
}

/* accessibility, keyboard focus and touch targets */
:where(button,a,input,select,textarea,[tabindex]):focus-visible{outline:3px solid color-mix(in srgb,var(--s24-module) 28%,transparent)!important;outline-offset:2px!important}
#nav button:focus-visible,.side-bottom button:focus-visible{outline-color:rgba(255,255,255,.55)!important}
button[disabled],button[aria-disabled="true"],input[disabled],select[disabled],textarea[disabled]{cursor:not-allowed!important;opacity:.5!important}
#modal .modal-card[role="dialog"]{outline:0}
@media(max-width:700px){
 #content button,.modal-card button{min-height:44px}
 #nav button,.side-bottom button{min-height:44px}
 #content input,#content select,#content textarea,.modal-card input,.modal-card select,.modal-card textarea{min-height:44px;font-size:16px}
}
@media(prefers-reduced-motion:reduce){
 *,*::before,*::after{scroll-behavior:auto!important;animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}
}
