/* KATO POWER Security — theme and component styles (moved out of base.html so the browser caches them).
   Cascade order is preserved: style.css -> this file. */
:root{--kato-black:#111;--kato-gold:#d4af37;--kato-cream:#f7f4eb}.topbar{gap:1rem}.topbar nav{display:flex;align-items:center;gap:clamp(.55rem,1.5vw,1.15rem);flex-wrap:wrap}.button,.nav-cta{cursor:pointer}.admin-links{display:flex;gap:.65rem;flex-wrap:wrap;margin:1rem 0 1.5rem}.admin-links a,.quick-link{display:inline-flex;align-items:center;padding:.7rem .9rem;border:1px solid #d9d4c4;border-radius:10px;text-decoration:none;color:#161616;background:#fff;font-weight:600}.admin-links a:hover,.quick-link:hover{border-color:var(--kato-gold);background:#fbf7e9}.form-card label,.login-card label{display:block;margin:.75rem 0}.form-card input,.form-card select,.form-card textarea,.login-card input{width:100%;margin-top:.35rem}.data-note{border-left:4px solid var(--kato-gold);background:#faf7ee;padding:1rem;border-radius:0 8px 8px 0}.status-pill{white-space:nowrap}.table-wrap{overflow-x:auto}.inline-form{display:inline-flex;gap:.4rem;align-items:center}.inline-form select{max-width:170px}.small-button{padding:.45rem .65rem;border-radius:7px;border:0;background:#171717;color:white;cursor:pointer}.danger-button{background:#8f2626}.muted{color:#686868}.app-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:1rem}.app-card{border:1px solid #e3dfd4;border-radius:12px;padding:1rem;background:white}.app-card h3{margin:.3rem 0}.form-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:.8rem}.button.full{width:100%}.records-head{gap:1rem}
.quick-menu{position:relative}.quick-menu summary{list-style:none;cursor:pointer;padding:.55rem .8rem;border:1px solid var(--gold);border-radius:8px;color:inherit;font-weight:700}.quick-menu summary::-webkit-details-marker{display:none}.quick-menu-panel{position:absolute;right:0;top:calc(100% + 8px);z-index:1000;min-width:210px;padding:.5rem;background:var(--surface,#fff);color:var(--text,#202124);border:1px solid var(--line);border-radius:12px;box-shadow:0 12px 35px #0002;display:grid;gap:.2rem}.quick-menu-panel a{padding:.65rem .7rem;border-radius:7px;white-space:nowrap}.quick-menu-panel a:hover{background:var(--gold);color:#111}.theme-toggle{width:40px;height:40px;display:inline-grid;place-items:center;cursor:pointer;border:1px solid var(--gold);border-radius:50%;padding:0;background:transparent;color:inherit;font-size:20px;line-height:1}.theme-toggle svg{width:20px;height:20px;display:block}.theme-dark{--paper:#121212;--white:#1d1d1d;--surface:#1d1d1d;--text:#f4f1e8;--muted:#b8b8b8;--line:#383838;color:#f4f1e8;background:#121212}.theme-dark .section,.theme-dark .form-card,.theme-dark .records-card,.theme-dark .login-card,.theme-dark .app-card,.theme-dark .stat,.theme-dark .service,.theme-dark .contact-card,.theme-dark .page-head{background:#1d1d1d;color:#f4f1e8;border-color:#393939}.theme-dark .muted,.theme-dark .section p,.theme-dark .page-head p{color:#c2c2c2}.theme-dark input,.theme-dark select,.theme-dark textarea{background:#111;color:#fff;border-color:#555}.theme-dark .admin-links a,.theme-dark .quick-link{background:#222;color:#f4f1e8;border-color:#4c4634}.theme-dark .data-note{background:#2a261c;color:#f4f1e8}.theme-dark table th{background:#282828}.theme-dark table td{border-color:#383838}.theme-dark footer{background:#080808;color:#eee}.theme-dark .portal-band{background:#24221d;color:#f4f1e8}.theme-dark .login-wrap{background:#151515}.content-page{min-height:52vh}.content-page .section-heading{max-width:780px}.event-note,.gallery-tile{background:var(--white,#fff);border:1px solid var(--line);border-radius:12px;padding:1.2rem}.gallery-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:1rem}.gallery-art{height:145px;border-radius:9px;background:linear-gradient(135deg,#161616,#3a3325);display:grid;place-items:center;color:#e6c65b;font-size:40px;margin-bottom:1rem}.service-grid .service{transition:transform .15s ease}.service-grid .service:hover{transform:translateY(-2px)}
@media(max-width:800px){.topbar{align-items:flex-start;flex-direction:column}.topbar nav{width:100%;gap:12px}.quick-menu-panel{left:0;right:auto}.hero{grid-template-columns:1fr;padding-top:50px}.hero-logo{grid-row:1;justify-content:flex-start}.hero-logo img{width:150px}.hero h1{font-size:43px}.service-grid{grid-template-columns:repeat(2,1fr)}.portal-band{align-items:flex-start;flex-direction:column}.contact{grid-template-columns:1fr}.module-grid{grid-template-columns:repeat(2,1fr)}.manage-layout{grid-template-columns:1fr}.stats{grid-template-columns:repeat(2,1fr)}.page-head{align-items:flex-start;flex-direction:column}}
@media(max-width:480px){.brand img{width:44px;height:44px}.brand strong{font-size:13px}.topbar nav{font-size:12px;gap:10px}.hero h1{font-size:37px}.service-grid,.module-grid{grid-template-columns:1fr}.service{min-height:0}.section{padding-top:42px;padding-bottom:42px}.stats{gap:8px;padding:15px}.stat{padding:13px}.stat strong{font-size:27px}.stat span{font-size:12px}.records-card,.form-card{padding:14px}.search{width:100%}.search input{flex:1;min-width:0}.page-head{padding-top:26px;padding-bottom:26px}.theme-toggle{width:36px;height:36px}}

/* Reliable light/dark theme tokens used by all pages */
:root{color-scheme:light;--page-bg:#f7f5ef;--card-bg:#fff;--body-text:#202124;--soft-text:#666b73;--border-color:#e2dfd6;--field-bg:#fff;--table-head:#f1eee5}
html[data-theme="dark"]{color-scheme:dark;--page-bg:#111;--card-bg:#1b1b1b;--body-text:#f4f1e8;--soft-text:#c4c0b5;--border-color:#3b3b3b;--field-bg:#121212;--table-head:#282828}
body{background:var(--page-bg);color:var(--body-text);transition:background-color .18s ease,color .18s ease}
html[data-theme="dark"] body,body.theme-dark{background:var(--page-bg);color:var(--body-text)}
html[data-theme="dark"] .section,html[data-theme="dark"] .form-card,html[data-theme="dark"] .records-card,html[data-theme="dark"] .login-card,html[data-theme="dark"] .app-card,html[data-theme="dark"] .stat,html[data-theme="dark"] .service,html[data-theme="dark"] .contact-card,html[data-theme="dark"] .page-head,html[data-theme="dark"] .event-note,html[data-theme="dark"] .gallery-tile,html[data-theme="dark"] .table-wrap{background:var(--card-bg);color:var(--body-text);border-color:var(--border-color)}
html[data-theme="dark"] p,html[data-theme="dark"] .muted,html[data-theme="dark"] .section p,html[data-theme="dark"] .page-head p,html[data-theme="dark"] .stat span,html[data-theme="dark"] .module small{color:var(--soft-text)}
html[data-theme="dark"] input,html[data-theme="dark"] select,html[data-theme="dark"] textarea{background:var(--field-bg);color:var(--body-text);border-color:var(--border-color)}
html[data-theme="dark"] table th{background:var(--table-head);color:var(--body-text)}html[data-theme="dark"] table td{border-color:var(--border-color);color:var(--body-text)}
html[data-theme="dark"] .module,html[data-theme="dark"] .admin-links a,html[data-theme="dark"] .quick-link{background:var(--card-bg);color:var(--body-text);border-color:var(--border-color)}
html[data-theme="dark"] .portal-band{background:#24221d;color:var(--body-text)}html[data-theme="dark"] .login-wrap{background:#141414}
.contact-map{width:100%;min-height:320px;border:0;border-radius:12px;background:#e7e2d7}.social-links{display:flex;flex-wrap:wrap;gap:.6rem;margin-top:1rem}.social-links a{border:1px solid var(--border-color);border-radius:8px;padding:.55rem .8rem;font-weight:700;font-size:.9rem}.social-links a:hover{border-color:var(--gold);background:#d4af3720}.whatsapp-float{position:fixed;right:20px;bottom:20px;z-index:1200;display:flex;align-items:center;gap:9px;padding:12px 16px;border-radius:999px;background:#20b95b;color:#fff;box-shadow:0 8px 24px #0004;font-weight:800}.whatsapp-float svg{width:22px;height:22px;fill:currentColor}.whatsapp-float:hover{filter:brightness(1.05);transform:translateY(-1px)}.developer-credit{font-size:12px;color:#aaa}.privacy-content{max-width:900px;margin:auto}.privacy-content h2{margin-top:28px}

/* Release 3.1 final theme override; kept after component rules so the switch visibly updates every page. */
html[data-theme="light"]{color-scheme:light;--page-bg:#f7f5ef;--card-bg:#fff;--body-text:#202124;--soft-text:#666b73;--border-color:#e2dfd6;--field-bg:#fff;--table-head:#f1eee5}
html[data-theme="dark"]{color-scheme:dark;--page-bg:#111;--card-bg:#1b1b1b;--body-text:#f4f1e8;--soft-text:#c4c0b5;--border-color:#3b3b3b;--field-bg:#121212;--table-head:#282828}
html[data-theme="light"] body,html[data-theme="dark"] body{background:var(--page-bg);color:var(--body-text)}
html[data-theme="dark"] .section,html[data-theme="dark"] .form-card,html[data-theme="dark"] .records-card,html[data-theme="dark"] .login-card,html[data-theme="dark"] .app-card,html[data-theme="dark"] .stat,html[data-theme="dark"] .service,html[data-theme="dark"] .contact-card,html[data-theme="dark"] .page-head,html[data-theme="dark"] .event-note,html[data-theme="dark"] .gallery-tile,html[data-theme="dark"] .table-wrap,html[data-theme="dark"] .empty{background:var(--card-bg);color:var(--body-text);border-color:var(--border-color)}
html[data-theme="light"] .section,html[data-theme="light"] .form-card,html[data-theme="light"] .records-card,html[data-theme="light"] .login-card,html[data-theme="light"] .stat,html[data-theme="light"] .service,html[data-theme="light"] .contact-card,html[data-theme="light"] .page-head,html[data-theme="light"] .event-note,html[data-theme="light"] .gallery-tile,html[data-theme="light"] .table-wrap{background:var(--card-bg);color:var(--body-text);border-color:var(--border-color)}
html[data-theme="dark"] p,html[data-theme="dark"] .muted,html[data-theme="dark"] .section p,html[data-theme="dark"] .page-head p,html[data-theme="dark"] .stat span,html[data-theme="dark"] .module small,html[data-theme="dark"] label{color:var(--soft-text)}
html[data-theme="dark"] input,html[data-theme="dark"] select,html[data-theme="dark"] textarea{background:var(--field-bg);color:var(--body-text);border-color:var(--border-color)}
html[data-theme="dark"] table th{background:var(--table-head);color:var(--body-text)}html[data-theme="dark"] table td{border-color:var(--border-color);color:var(--body-text)}
html[data-theme="dark"] .module,html[data-theme="dark"] .admin-links a,html[data-theme="dark"] .quick-link{background:var(--card-bg);color:var(--body-text);border-color:var(--border-color)}
html[data-theme="dark"] .portal-band{background:#24221d;color:var(--body-text)}html[data-theme="dark"] .login-wrap{background:#141414}

.social-links{align-items:center}.social-link{width:42px;height:42px;padding:0!important;display:inline-flex;align-items:center;justify-content:center;border-radius:10px!important;transition:transform .15s ease,filter .15s ease}.social-link:hover{transform:translateY(-2px);filter:brightness(1.08)}.social-link svg{display:block;width:23px;height:23px}.social-facebook{background:#1877F2!important;color:#fff!important;border-color:#1877F2!important}.social-instagram{background:linear-gradient(135deg,#833ab4,#fd1d1d,#fcb045)!important;color:#fff!important;border-color:#d64a75!important}.social-youtube{background:#fff!important;color:#FF0000!important;border-color:#FF0000!important}.social-youtube .yt-shape{fill:#FF0000}.social-youtube .yt-play{fill:#fff}.social-tiktok{background:#000!important;color:#fff!important;border-color:#000!important}.social-tiktok .tt-cyan{fill:#25F4EE}.social-tiktok .tt-pink{fill:#FE2C55}.social-tiktok .tt-main{fill:#fff}.social-x{background:#000!important;color:#fff!important;border-color:#fff!important}.social-x svg{fill:#fff!important}.social-x svg path{fill:#fff!important}.social-letter{font-family:Arial,sans-serif;font-weight:900;font-size:30px;line-height:1}
html[data-theme="dark"] .button.outline.dark-outline,html[data-theme="dark"] a.button.dark-outline{color:#f4f1e8!important;border-color:#d5a32e!important;background:#242424!important}html[data-theme="dark"] .button.outline.dark-outline:hover,html[data-theme="dark"] a.button.dark-outline:hover{color:#111!important;background:#f0c85c!important}html[data-theme="dark"] .social-x{background:#000!important;color:#fff!important;border-color:#fff!important}html[data-theme="dark"] .social-x svg,html[data-theme="dark"] .social-x svg path{fill:#fff!important}

/* ===================================================================
   Release 3.5 components
   =================================================================== */
a,button,summary,select{touch-action:manipulation}
:focus-visible{outline:2px solid var(--gold2,#f0c85c);outline-offset:2px}
main:focus{outline:none}
.skip-link{position:absolute;left:-9999px;top:8px;z-index:3000;background:#111;color:#fff;padding:10px 14px;border-radius:6px;font-weight:700}
.skip-link:focus{left:8px}

/* Flash messages. Success messages clear themselves after --flash-ms (5 s) purely in CSS,
   so it works even if JavaScript is slow or blocked; app.js then removes the node from the page. */
.messages{padding:10px clamp(18px,5vw,72px) 0}
.messages .flash+.flash{margin-top:8px}
.flash{position:relative;padding:11px 44px 11px 14px;overflow:hidden}
.flash-close{position:absolute;top:50%;right:8px;transform:translateY(-50%);width:28px;height:28px;display:grid;place-items:center;border:0;border-radius:6px;background:transparent;color:inherit;font:inherit;font-size:20px;line-height:1;cursor:pointer;opacity:.7}
.flash-close:hover,.flash-close:focus-visible{opacity:1;background:#00000014}
@keyframes flash-out{0%{opacity:1;max-height:160px}55%{opacity:0;max-height:160px}100%{opacity:0;max-height:0;padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0;visibility:hidden}}
.flash[data-autodismiss]{max-height:160px;animation:flash-out .45s ease var(--flash-ms,5000ms) forwards}
.flash.dismissed{opacity:0;max-height:0;padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0;visibility:hidden;transition:opacity .25s ease,max-height .3s ease,padding .3s ease,margin .3s ease}
html[data-theme="dark"] .flash.success{background:#12372b;color:#a6e6c4}
html[data-theme="dark"] .flash.error{background:#3d1b1b;color:#ffb4b4}

/* Buttons: instant feedback and double-submit protection (see app.js) */
button.is-loading,.button.is-loading{opacity:.75;cursor:progress;pointer-events:none}
button.is-loading::after{content:"";display:inline-block;width:.9em;height:.9em;margin-left:.55em;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:kato-spin .7s linear infinite;vertical-align:-.12em}
@keyframes kato-spin{to{transform:rotate(360deg)}}
button:disabled{cursor:not-allowed}
.small-button,.quick-link{min-height:36px}
a.small-button{display:inline-flex;align-items:center;text-decoration:none}

/* Pagination */
.pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:14px}
.pagination-links{display:inline-flex;align-items:center;gap:10px}

/* Breadcrumbs, footer navigation, service links, error pages */
.breadcrumb{padding:10px clamp(18px,5vw,72px);font-size:12px;background:var(--card-bg,#fff);border-bottom:1px solid var(--border-color,#e2dfd6)}
.breadcrumb ol{display:flex;flex-wrap:wrap;gap:6px;list-style:none;margin:0;padding:0}
.breadcrumb li+li::before{content:"\203A";margin-right:6px;opacity:.6}
.breadcrumb a{text-decoration:underline;text-underline-offset:2px}
.breadcrumb [aria-current]{font-weight:700}
.footer-nav{display:flex;flex-direction:column}
.footer-nav a{line-height:2}
.service h2{margin:17px 0 7px;font-size:18px}
.service{scroll-margin-top:90px}
.service-links{display:flex;flex-wrap:wrap;gap:.6rem;list-style:none;padding:0;margin:1.2rem 0 0}
.service-links a{display:inline-flex;align-items:center;padding:.55rem .85rem;border:1px solid var(--border-color,#e2dfd6);border-radius:999px;font-weight:600;font-size:14px}
.service-links a:hover{border-color:var(--gold);background:#d4af3720}
.area-note{max-width:760px;margin:1.5rem 0 0;color:var(--muted)}
.error-links{display:flex;flex-wrap:wrap;gap:.6rem;list-style:none;padding:0;margin:1.5rem 0 0}
.error-links a{text-decoration:underline;text-underline-offset:3px}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .flash[data-autodismiss]{animation-duration:.01s}
  .flash.dismissed,.service-grid .service,.social-link{transition:none}
  button.is-loading::after{animation-duration:1.6s}
}

/* Gallery (release 3.6): responsive photo grid. aspect-ratio + width/height prevent layout shift. */
.photo-grid{list-style:none;margin:0;padding:0;display:grid;gap:16px;grid-template-columns:1fr}
@media (min-width:600px){.photo-grid{grid-template-columns:repeat(2,1fr)}}
@media (min-width:900px){.photo-grid{grid-template-columns:repeat(3,1fr)}}
.photo-tile figure{margin:0;height:100%;display:flex;flex-direction:column;overflow:hidden;border-radius:14px;background:var(--card-bg,#fff);border:1px solid var(--border-color,#e2dfd6);box-shadow:0 6px 18px #0000000f}
.photo-tile img{display:block;width:100%;height:auto;aspect-ratio:3/2;object-fit:cover;background:#111}
.photo-tile figcaption{display:flex;flex-direction:column;gap:2px;padding:12px 14px 14px}
.photo-tile figcaption span{font-size:14px;color:var(--muted)}
@media (hover:hover){.photo-tile figure{transition:transform .2s ease,box-shadow .2s ease}.photo-tile figure:hover{transform:translateY(-3px);box-shadow:0 12px 26px #00000024}}
.photo-note{margin:1.1rem 0}
@media (prefers-reduced-motion:reduce){.photo-tile figure{transition:none}}

/* Brand lockup: company name with parent-company line */
.brand small{letter-spacing:.06em;font-size:10px;line-height:1.3;white-space:nowrap}
@media(max-width:480px){.brand small{font-size:8px;letter-spacing:.03em}}
/* 3.16 audit: wide tables/forms inside the admin two-column layout must scroll inside their own card, never widen the page */
.manage-layout>*,.records-card,.form-card{min-width:0}.records-card .table-wrap,.manage-layout .table-wrap{max-width:100%}
