:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: #0d111a;
  color: #e8edf7;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --bg: #0d111a;
  --surface: #151b27;
  --surface-raised: #1a2230;
  --line: #283244;
  --muted: #8b96aa;
  --blue: #38bdf8;
  --blue-strong: #168bd2;
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: radial-gradient(ellipse at 80% -20%, #172e4b 0, transparent 36%), var(--bg); }
button, input, select, textarea { font: inherit; }
a { color: inherit; }
.app-shell, .form-page { min-height: 100vh; }

.topbar { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 12px 32px; border-bottom: 1px solid rgba(118, 140, 174, .15); background: rgba(13, 17, 26, .84); backdrop-filter: blur(14px); }
.brand { display: inline-flex; align-items: center; gap: 11px; flex: 0 0 220px; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: linear-gradient(145deg, #38bdf8, #1679c2); color: #062238; font-size: 22px; font-weight: 850; box-shadow: 0 6px 18px #0785ca33; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: .02em; }
.brand small { margin-top: 3px; color: #8290a8; font-size: 9px; font-weight: 750; letter-spacing: .16em; }
.global-search { width: min(520px, 45vw); height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: #121823; color: var(--muted); }
.global-search > span { font-size: 22px; line-height: 1; }
.global-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: #eef4ff; font-size: 13px; }
.global-search input::placeholder { color: #778299; }
.clear-search { color: var(--blue); font-size: 11px; text-decoration: none; white-space: nowrap; }
.account-menu { display: flex; align-items: center; gap: 10px; }
.account-avatar { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid #276899; border-radius: 50%; background: #12304a; color: #80d5ff; font-weight: 750; }
.account-copy strong, .account-copy small { display: block; }
.account-copy strong { max-width: 145px; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.account-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.logout-link { margin-left: 10px; padding-left: 15px; border-left: 1px solid var(--line); color: #a9b4c7; font-size: 12px; text-decoration: none; }
.logout-link:hover { color: #fff; }

.workspace { max-width: 1700px; min-height: calc(100vh - 74px); display: grid; grid-template-columns: 260px minmax(0, 1fr); margin: 0 auto; }
.sidebar { display: flex; flex-direction: column; min-height: calc(100vh - 74px); padding: 26px 16px 18px; border-right: 1px solid rgba(118, 140, 174, .14); background: rgba(17, 23, 34, .65); }
.sidebar-title { display: flex; align-items: center; justify-content: space-between; margin: 0 9px 12px; color: #7f8ba1; font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.folder-total { min-width: 22px; padding: 3px 6px; border-radius: 6px; background: #202a3a; color: #b7c5da; font-size: 10px; text-align: center; letter-spacing: 0; }
.folder-link { min-height: 38px; display: flex; align-items: center; gap: 9px; padding: 7px 9px; border: 1px solid transparent; border-radius: 7px; color: #b4bfd1; font-size: 12px; text-decoration: none; transition: background .15s ease, color .15s ease; }
.folder-link:hover { background: #1a2534; color: #eef6ff; }
.folder-link.selected { border-color: #1e5076; background: linear-gradient(90deg, #14344f, #132638); color: #82d8ff; }
.folder-icon { width: 17px; color: #6e9bb9; font-size: 14px; text-align: center; }
.folder-icon-root { color: #d5dbe5; }
.folder-icon-child { color: #8e9aad; font-size: 12px; }
.folder-icon.is-open { color: #fff; }
.folder-admin-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0 0 12px; }
.folder-menu-action { min-height: 32px; padding: 5px 7px; border: 1px solid #303b4e; border-radius: 6px; background: #171e2a; color: #c5cfde; font-family: inherit; font-size: 10px; font-weight: 650; cursor: pointer; }
.folder-menu-action:hover { border-color: #596579; background: #202a39; color: #fff; }
.folder-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-count { min-width: 20px; color: #78869c; font-size: 10px; text-align: right; }
.folder-children { margin-left: 13px; padding-left: 7px; border-left: 1px solid #29384b; }
.new-folder { margin-top: 30px; padding-top: 18px; border-top: 1px solid #263143; }
.new-folder input, .new-folder select { width: 100%; min-height: 35px; margin-bottom: 8px; padding: 7px 9px; border: 1px solid #303b4e; border-radius: 6px; outline: none; background: #111722; color: #e8edf7; font-size: 11px; }
.new-folder input:focus, .new-folder select:focus { border-color: #2387bd; }
.sidebar-foot { margin-top: auto; padding: 20px 9px 0; color: #657289; font-size: 10px; line-height: 1.7; }
.sidebar-foot strong { color: #8e9bb1; }

.main-content { min-width: 0; padding: 32px clamp(20px, 3vw, 48px) 22px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.eyebrow { color: #56b8ea; font-size: 9px; font-weight: 850; letter-spacing: .15em; }
.page-heading h1, .form-intro h1 { margin: 7px 0 5px; color: #f1f5fc; font-size: clamp(23px, 2.3vw, 30px); letter-spacing: -.04em; }
.page-heading p, .form-intro p { margin: 0; color: #8692a7; font-size: 12px; }
.button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; border: 1px solid transparent; border-radius: 7px; font-size: 12px; font-weight: 700; text-decoration: none; cursor: pointer; transition: transform .15s ease, background .15s ease, border-color .15s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: linear-gradient(120deg, #1588c6, #1469aa); color: #f2fbff; box-shadow: 0 5px 18px #087cb522; }
.button-primary:hover { background: linear-gradient(120deg, #20a0e3, #167ac1); }
.button-muted { border-color: #303c50; background: #1a2230; color: #bdc9db; }
.button-muted:hover { border-color: #46627e; background: #202b3b; }
.button-full { width: 100%; min-height: 34px; font-size: 11px; }
.button-small { min-height: 34px; margin-top: 15px; font-size: 11px; }
.flash-message { margin: -9px 0 18px; padding: 11px 14px; border: 1px solid #21623f; border-radius: 8px; background: #123121; color: #95e9b3; font-size: 12px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 16px; }
.stat-card { min-height: 98px; display: flex; align-items: center; gap: 14px; padding: 17px; border: 1px solid #273246; border-radius: 10px; background: linear-gradient(145deg, #182130, #141a26); box-shadow: 0 12px 24px #00000010; }
.stat-icon { width: 38px; height: 38px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 9px; font-size: 17px; }
.stat-icon.blue { background: #12344c; color: #4ec8ff; }
.stat-icon.violet { background: #292344; color: #b49bff; }
.stat-icon.green { background: #14382e; color: #66ddb0; }
.stat-icon.amber { background: #3a3020; color: #f1bf68; }
.stat-label, .stat-card small { display: block; color: #8b97ab; font-size: 10px; }
.stat-card strong { display: inline-block; margin: 4px 7px 2px 0; color: #f1f5fc; font-size: 24px; line-height: 1; }
.stat-card small { display: inline-block; font-size: 9px; }

.panel { margin-bottom: 16px; overflow: hidden; border: 1px solid #273246; border-radius: 10px; background: #151b27; box-shadow: 0 10px 26px #00000012; }
.panel-heading { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 20px; border-bottom: 1px solid #252f40; }
.panel-heading h2 { margin: 5px 0 0; color: #e7edf7; font-size: 14px; letter-spacing: -.01em; }
.panel-note, .result-count { color: #8290a5; font-size: 10px; }
.category-chart { display: grid; gap: 12px; padding: 17px 20px 20px; }
.chart-row { display: grid; grid-template-columns: minmax(110px, 210px) minmax(50px, 1fr) 32px; align-items: center; gap: 12px; }
.chart-label { overflow: hidden; color: #aab6c9; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.chart-track { height: 9px; overflow: hidden; border-radius: 10px; background: #222c3b; }
.chart-bar { min-width: 2px; height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, #1487ca, #45c5e9); box-shadow: 0 0 12px #138ec833; }
.chart-value { color: #dce7f5; font-size: 10px; text-align: right; }
.empty-chart { padding: 25px; color: var(--muted); font-size: 12px; text-align: center; }

.equipment-heading { min-height: 70px; }
.table-wrap { width: 100%; overflow-x: auto; }
.equipment-table { width: 100%; min-width: 920px; border-collapse: collapse; }
.equipment-table th { padding: 11px 13px; background: #182130; color: #7f8da4; font-size: 9px; font-weight: 800; letter-spacing: .06em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.equipment-table td { padding: 12px 13px; border-top: 1px solid #232d3c; color: #b9c4d5; font-size: 10px; vertical-align: middle; }
.equipment-table tbody tr:hover { background: #192232; }
.equipment-name { display: block; color: #e0e9f5; font-size: 11px; }
.equipment-maker, .table-subline { display: block; margin-top: 4px; color: #7f8da3; font-size: 9px; }
.category-chip { display: inline-block; max-width: 180px; overflow: hidden; padding: 4px 7px; border: 1px solid #293a4c; border-radius: 5px; background: #1b2938; color: #8dbfe0; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.equipment-table code { padding: 3px 5px; border-radius: 4px; background: #101722; color: #87d8ad; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; white-space: nowrap; }
.observations { max-width: 190px; color: #8793a6 !important; line-height: 1.45; }
.password-field { display: flex; align-items: center; gap: 3px; }
.password-input { width: 90px; min-width: 0; padding: 4px 5px; border: 1px solid #2b374a; border-radius: 4px; outline: 0; background: #101722; color: #d5deeb; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.icon-button { width: 26px; height: 25px; display: inline-grid; place-items: center; padding: 0; border: 1px solid #344055; border-radius: 5px; background: #202a39; color: #9eacc0; font-size: 12px; text-decoration: none; cursor: pointer; }
.icon-button:hover { border-color: #4f7696; background: #26394b; color: #d8f2ff; }
.row-actions { display: flex; align-items: center; gap: 5px; }
.row-actions form { display: inline-flex; margin: 0; }
.delete-action:hover { border-color: #86464c; background: #45252e; color: #ff9a9e; }
.muted { color: #657287; }
.empty-row { height: 205px; text-align: center !important; }
.empty-row > * { display: block; margin-right: auto; margin-left: auto; }
.empty-icon { margin-bottom: 10px; color: #52708e; font-size: 26px; }
.empty-row strong { color: #d2dbea; font-size: 12px; }
.empty-row small { margin-top: 6px; color: #7e8ba0; font-size: 10px; }
.page-footer { padding: 8px 0 3px; color: #5f6c80; font-size: 9px; text-align: right; }
.page-footer span { padding: 0 4px; color: #354357; }

.form-page .topbar { max-width: 1500px; margin: 0 auto; }
.form-main { width: min(850px, calc(100% - 40px)); margin: 42px auto; }
.form-intro { margin-bottom: 20px; }
.form-panel { padding: 24px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 20px; }
.field { min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 7px; color: #b8c4d6; font-size: 11px; font-weight: 650; }
.field label span { color: #55c7f4; }
.input { width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid #303c50; border-radius: 7px; outline: none; background: #101722; color: #edf3fa; font-size: 12px; }
.input:focus { border-color: #279bd1; box-shadow: 0 0 0 3px #1686bd22; }
.input::placeholder { color: #647187; }
.textarea { min-height: 90px; resize: vertical; }
.field-help { display: block; margin-top: 6px; color: #7f8da3; font-size: 10px; }
.field-error { display: block; margin-top: 6px; color: #ff9b9e; font-size: 10px; }
.form-actions { display: flex; justify-content: end; gap: 9px; margin-top: 23px; padding-top: 18px; border-top: 1px solid #273246; }

.login-wrapper { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(390px, 100%); padding: 34px; border: 1px solid #2a374b; border-radius: 14px; background: linear-gradient(145deg, #1a2433, #141a26); box-shadow: 0 24px 70px #0008; }
.login-card .logo { color: #5acaff; font-size: 20px; font-weight: 850; letter-spacing: .07em; }
.logo-sub { margin: 6px 0 25px; color: #8794a9; font-size: 11px; }
.login-card .field { margin: 15px 0; }
.login-card .btn { width: 100%; margin-top: 7px; }
.login-card .footer-note { margin-top: 18px; color: #68768c; font-size: 10px; text-align: center; }
.login-card .error { margin-top: 12px; color: #ff9b9e; font-size: 11px; text-align: center; }

@media (max-width: 1080px) {
  .workspace { grid-template-columns: 225px minmax(0, 1fr); }
  .sidebar { padding-right: 12px; padding-left: 12px; }
  .main-content { padding-right: 20px; padding-left: 20px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .topbar { min-height: 65px; flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
  .brand { flex: 1 1 auto; }
  .global-search { order: 3; width: 100%; max-width: none; }
  .account-menu { gap: 7px; }
  .account-avatar { width: 30px; height: 30px; }
  .account-copy strong { max-width: 95px; }
  .logout-link { margin-left: 4px; padding-left: 8px; }
  .workspace { display: block; }
  .sidebar { min-height: 0; padding: 15px 14px; border-right: 0; border-bottom: 1px solid #273246; }
  .sidebar nav { max-height: 190px; overflow: auto; }
  .folder-link { min-height: 34px; }
  .new-folder { margin-top: 12px; padding-top: 12px; }
  .sidebar-foot { display: none; }
  .main-content { padding: 23px 14px 18px; }
  .page-heading { align-items: start; flex-direction: column; gap: 15px; }
  .page-heading .button { width: 100%; }
  .stat-grid { gap: 9px; }
  .stat-card { min-height: 83px; gap: 9px; padding: 11px; }
  .stat-icon { width: 32px; height: 32px; }
  .stat-card strong { font-size: 21px; }
  .stat-card small { display: block; margin-top: 2px; }
  .panel-heading { padding-right: 14px; padding-left: 14px; }
  .category-chart { padding-right: 14px; padding-left: 14px; }
  .chart-row { grid-template-columns: minmax(90px, 38%) minmax(30px, 1fr) 25px; gap: 8px; }
  .table-wrap { overflow: visible; }
  .equipment-table { min-width: 0; display: block; }
  .equipment-table thead { display: none; }
  .equipment-table tbody, .equipment-table tr, .equipment-table td { width: 100%; display: block; }
  .equipment-table tr { padding: 9px 13px; border-top: 1px solid #273246; }
  .equipment-table td { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 8px; padding: 7px 0; border: 0; font-size: 10px; overflow-wrap: anywhere; }
  .equipment-table td::before { content: attr(data-label); color: #76849b; font-size: 9px; font-weight: 750; text-transform: uppercase; }
  .equipment-table .empty-row { display: block; height: auto; padding: 26px 8px; }
  .equipment-table .empty-row::before { display: none; }
  .row-actions { justify-content: start; }
  .form-main { width: calc(100% - 28px); margin: 26px auto; }
  .form-panel { padding: 17px; }
}

@media (max-width: 480px) {
  .account-copy { display: none; }
  .account-menu { margin-left: auto; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-card { align-items: flex-start; flex-direction: column; gap: 6px; }
  .stat-card strong { margin-top: 5px; }
  .form-grid { grid-template-columns: 1fr; gap: 14px; }
  .field-wide { grid-column: auto; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .button { width: 100%; }
}

.credential-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.credential-heading > div { display: grid; gap: 5px; }
.credential-row { display: grid; grid-template-columns: minmax(120px, .8fr) minmax(160px, 1fr) minmax(160px, 1fr) 34px; align-items: end; gap: 12px; padding: 12px; margin-bottom: 10px; border: 1px solid var(--line, #d8d8d8); border-radius: 10px; }
.credential-row .field { min-width: 0; }
.credential-row input[type="hidden"] { display: none; }
.ip-row { display: grid; grid-template-columns: minmax(150px, .8fr) minmax(200px, 1.2fr) 34px; align-items: end; gap: 12px; padding: 12px; margin-bottom: 10px; border: 1px solid var(--line, #d8d8d8); border-radius: 10px; }
.ip-row .field { min-width: 0; }
.remove-credential { margin-bottom: 2px; font-size: 20px; }
.credential-display { display: grid; gap: 8px; }
.credential-display > div { display: grid; gap: 3px; }
.credential-display small, .password-field > small { color: var(--muted, #707070); font-size: 11px; }
.password-field { margin-bottom: 6px; }
@media (max-width: 760px) { .credential-row { grid-template-columns: 1fr 1fr; } .credential-row .field:nth-child(3) { grid-column: 1 / 2; } .remove-credential { justify-self: end; } }

/* Monochrome inventory theme */
:root { color-scheme: light; background: #fff; color: #111; --bg: #fff; --surface: #fff; --surface-raised: #f5f5f5; --line: #dedede; --muted: #666; --blue: #222; --blue-strong: #111; }
body { background: #fff; color: #111; }
.topbar, .sidebar { background: #fff; border-color: #e5e5e5; }
.topbar { backdrop-filter: none; }
.brand-mark { background: #111; color: #fff; box-shadow: none; }
.brand small, .sidebar-title, .sidebar-foot, .sidebar-foot strong, .account-copy small, .page-heading p, .form-intro p { color: #666; }
.global-search, .new-folder input, .new-folder select { background: #fafafa; color: #111; border-color: #d8d8d8; }
.global-search input, .page-heading h1, .form-intro h1 { color: #111; }
.global-search input::placeholder { color: #888; }
.clear-search, .eyebrow, .folder-icon { color: #333; }
.account-avatar { border-color: #bbb; background: #f3f3f3; color: #111; }
.folder-total, .button-muted, .icon-button { border-color: #d8d8d8; background: #f5f5f5; color: #333; }
.folder-link { color: #444; }
.folder-link:hover, .folder-link.selected, .icon-button:hover, .button-muted:hover { border-color: #bbb; background: #eee; color: #111; }
.folder-link.selected { border-color: #aaa; background: #eee; }
.folder-children, .new-folder, .panel-heading, .form-actions { border-color: #e3e3e3; }
.button-primary, .button-primary:hover { background: #111; color: #fff; box-shadow: none; }
.flash-message { border-color: #ccc; background: #f5f5f5; color: #222; }
.panel { border-color: #e1e1e1; background: #fff; box-shadow: 0 3px 12px #00000008; }
.panel-heading h2, .equipment-name, .empty-row strong { color: #111; }
.panel-note, .result-count, .equipment-maker, .table-subline, .observations { color: #666 !important; }
.equipment-table th { background: #f5f5f5; color: #555; }
.equipment-table td { border-color: #e8e8e8; color: #333; }
.equipment-table tbody tr:hover { background: #fafafa; }
.category-chip { border-color: #ddd; background: #f5f5f5; color: #333; }
.equipment-table code { background: #f3f3f3; color: #111; }
.password-input, .input { border-color: #d3d3d3; background: #fff; color: #111; }
.input:focus, .new-folder input:focus, .new-folder select:focus { border-color: #555; box-shadow: 0 0 0 3px #00000010; }
.input::placeholder { color: #888; }
.field label { color: #333; }
.field-help, .muted, .empty-row small, .page-footer { color: #666; }
.field-error { color: #8b1c1c; }
.login-card { border-color: #ddd; background: #fff; box-shadow: 0 12px 38px #00000012; }
.login-card .logo { color: #111; }
.folder-permissions { min-width: 0; margin: 0; padding: 14px; border: 1px solid #ddd; border-radius: 8px; }
.folder-permissions legend { padding: 0 6px; font-size: 12px; font-weight: 700; }
.folder-permissions p { margin: 0 0 12px; color: #666; font-size: 11px; }
.permission-option { display: flex !important; align-items: center; gap: 8px; min-height: 32px; margin: 0 !important; border-top: 1px solid #eee; font-weight: 450 !important; }
.permission-option input { accent-color: #111; }
.admin-main { width: min(980px, calc(100% - 40px)); }
.users-table { min-width: 650px; }
.users-table .category-chip { margin: 2px; }
.inventory-tools { display: flex; align-items: center; gap: 15px; }
.view-switcher { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid #ddd; border-radius: 8px; background: #f7f7f7; }
.view-switcher a { padding: 6px 9px; border-radius: 6px; color: #555; font-size: 11px; text-decoration: none; }
.view-switcher a:hover { color: #111; background: #eee; }
.view-switcher a.active { background: #111; color: #fff; }
.equipment-grid.view-list { display: flex; flex-direction: column; gap: 9px; }
.view-list .equipment-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.view-list .equipment-card-open { display: grid; grid-template-columns: 125px minmax(0, 1fr); align-items: center; }
.view-list .card-photo { width: 125px; height: 96px; aspect-ratio: auto; }
.view-list .card-main { grid-template-columns: minmax(150px, 1.4fr) minmax(120px, 1fr) repeat(3, minmax(85px, 1fr)); align-items: center; gap: 9px 12px; }
.view-list .card-main .equipment-name { font-size: 13px; }
.view-list .card-actions { flex-direction: column; }
.detail-addresses dd { display: grid; gap: 7px; }
.detail-addresses dd > div { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.detail-addresses dd strong { min-width: 75px; color: #555; font-size: 10px; }
.detail-addresses dd code { overflow-wrap: anywhere; white-space: normal; }

/* Readable NOC typography */
:root { font-size: 15px; }
body { line-height: 1.55; }
.global-search input { font-size: 14px; }
.account-copy strong { font-size: 13px; }
.sidebar-title, .new-folder input, .new-folder select { font-size: 11px; }
.folder-link { font-size: 13px; }
.folder-count { font-size: 11px; }
.eyebrow { font-size: 10px; letter-spacing: .1em; }
.button { font-size: 13px; }
.page-heading p, .form-intro p { font-size: 13px; }
.panel-heading h2 { font-size: 16px; }
.result-count { font-size: 11px; }
.card-main .equipment-name { font-size: 14px; line-height: 1.35; }
.card-meta { font-size: 12px; line-height: 1.4; }
.category-chip { font-size: 10px; }
.field label { font-size: 12px; }
.input { font-size: 13px; }
.field-help { font-size: 11px; line-height: 1.45; }
.detail-grid dd, .detail-notes p { font-size: 13px; line-height: 1.55; }
.detail-credential { font-size: 12px; }
.detail-credential > strong { font-size: 13px; }

.sidebar-toggle { width: 100%; border: 0; background: transparent; cursor: pointer; text-align: left; }
.heading-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: end; gap: 9px; }
.heading-actions .button { width: auto !important; }
.collapse-glyph { margin-left: auto; font-size: 18px; transition: transform .2s ease; }
.sidebar-collapsed .collapse-glyph { transform: rotate(180deg); }
.folder-item { display: flex; align-items: center; gap: 2px; }
.folder-item .folder-link { flex: 1; min-width: 0; }
.folder-item-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 2px; opacity: .72; }
.folder-item-actions form { margin: 0; }
.folder-item-action { width: 24px; height: 26px; display: grid; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #aab5c5; font-family: inherit; font-size: 14px; cursor: pointer; }
.folder-item-action:hover { border-color: #435066; background: #232c3b; color: #fff; }
.folder-delete-action:hover { border-color: #814747; background: #442a2a; color: #ffdada; }
.folder-link.is-dragging { opacity: .4; }
.folder-link.drop-target { border-color: #111; background: #e8e8e8; color: #111; box-shadow: inset 0 0 0 1px #111; }
.folder-link[draggable="true"] { cursor: grab; }
.folder-link[draggable="true"]:active { cursor: grabbing; }
.equipment-card[draggable="true"] { cursor: grab; }
.equipment-card[draggable="true"]:active { cursor: grabbing; }
.equipment-card.is-dragging { opacity: .48; }
.folder-expander { width: 25px; height: 28px; border: 0; border-radius: 5px; background: transparent; color: #444; cursor: pointer; }
.folder-expander:hover { background: #eee; }
.folder-expander[aria-expanded="false"] { transform: rotate(-90deg); }
.folder-children[hidden] { display: none; }
.workspace.sidebar-collapsed { grid-template-columns: 64px minmax(0, 1fr); }
.sidebar-collapsed .sidebar { padding-right: 8px; padding-left: 8px; }
.sidebar-collapsed .sidebar-title { justify-content: center; margin-right: 0; margin-left: 0; }
.sidebar-collapsed .sidebar-title > span:not(.collapse-glyph), .sidebar-collapsed .folder-name, .sidebar-collapsed .folder-count, .sidebar-collapsed .folder-expander, .sidebar-collapsed .folder-children, .sidebar-collapsed .new-folder, .sidebar-collapsed .sidebar-foot { display: none; }
.sidebar-collapsed .folder-link { justify-content: center; padding-right: 4px; padding-left: 4px; }
.sidebar-collapsed .folder-icon { width: auto; font-size: 17px; }
.equipment-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; padding: 18px; }
.equipment-card { min-width: 0; overflow: hidden; border: 1px solid #e1e1e1; border-radius: 10px; background: #fff; transition: box-shadow .18s ease, transform .18s ease; }
.equipment-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px #00000012; }
.equipment-card-open { width: 100%; display: block; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; text-align: left; }
.card-photo { display: block; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; background: #f2f2f2; }
.card-photo img { width: 100%; height: 100%; display: block; object-fit: cover; }
.card-main { display: grid; gap: 8px; padding: 13px 14px 15px; }
.card-main .equipment-name { overflow-wrap: anywhere; font-size: 13px; }
.card-main .category-chip { width: fit-content; max-width: 100%; }
.card-meta { overflow: hidden; color: #666; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.card-actions { display: flex; justify-content: end; gap: 6px; padding: 0 13px 12px; }
.card-actions form { margin: 0; }
.card-footer { display: flex; align-items: end; justify-content: space-between; gap: 8px; padding: 0 12px 11px; }
.card-copy-list { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.card-copy-account { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 4px 5px; border: 1px solid #eee; border-radius: 6px; }
.card-copy-account small { flex-basis: 100%; color: #666; font-size: 10px; line-height: 1.25; }
.copy-chip { padding: 4px 6px; border: 1px solid #ddd; border-radius: 5px; background: #f5f5f5; color: #333; font-family: inherit; font-size: 10px; cursor: pointer; }
.copy-chip:hover { border-color: #aaa; background: #eee; color: #111; }
.card-footer .card-actions { flex: 0 0 auto; padding: 0; }
.view-list .card-footer { flex-direction: column; align-items: end; padding: 8px; }
.view-list .card-copy-list { justify-content: end; }
.empty-cards { display: grid; justify-items: center; gap: 8px; padding: 45px 15px; text-align: center; }
.empty-cards strong { color: #111; font-size: 14px; }
.empty-cards small { color: #666; font-size: 12px; }
.detail-modal { position: fixed; width: min(900px, calc(100vw - 32px)); max-width: none; max-height: min(90dvh, 900px); padding: 0; overflow: auto; border: 1px solid #ddd; border-radius: 14px; background: #fff; color: #111; box-shadow: 0 24px 90px #0005; }
.detail-modal::backdrop { background: #0008; backdrop-filter: blur(2px); }
.modal-close { position: sticky; z-index: 2; top: 10px; float: right; width: 36px; height: 36px; margin: 10px 10px -46px 0; border: 1px solid #ddd; border-radius: 50%; background: #fff; color: #111; font-size: 23px; cursor: pointer; }
.modal-body { min-height: 180px; }
.modal-loading, .modal-error { padding: 40px; color: #555; text-align: center; }
.equipment-detail { display: grid; grid-template-columns: minmax(190px, .72fr) minmax(0, 1.5fr); min-height: 370px; }
.detail-cover { min-height: 100%; overflow: hidden; background: #f2f2f2; }
.detail-cover img { position: sticky; top: 0; width: 100%; max-height: 82dvh; display: block; object-fit: cover; object-position: center center; border-radius: 14px; }
.detail-content { padding: 27px; }
.detail-title-row { display: flex; align-items: start; justify-content: space-between; gap: 12px; padding-right: 30px; }
.detail-title-row h2 { margin: 7px 0 16px; overflow-wrap: anywhere; font-size: 22px; }
.detail-host-copy { display: flex; align-items: flex-start; gap: 6px; }
.detail-host-copy h2 { min-width: 0; }
.detail-category-copy { display: flex; align-items: center; gap: 5px; }
.detail-copy-button { width: 25px; height: 25px; display: inline-grid; flex: 0 0 auto; place-items: center; padding: 0; border: 1px solid #ddd; border-radius: 6px; background: #fafafa; color: #444; font-family: inherit; font-size: 13px; cursor: pointer; }
.detail-copy-button:hover { border-color: #aaa; background: #eee; color: #111; }
.detail-copy-field { min-width: 0; display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; }
.detail-copy-field > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.detail-copy-field code { overflow-wrap: anywhere; }
.detail-copy-field[role="button"] { cursor: copy; border-radius: 4px; }
.detail-copy-field[role="button"]:hover { background: #f0f0f0; }
.detail-copy-field[role="button"]:focus-visible { outline: 2px solid #333; outline-offset: 2px; }
.detail-copy-icon { flex: 0 0 auto; color: #777; font-size: 12px; }
.detail-note-copy { display: flex; align-items: flex-start; gap: 8px; }
.detail-note-copy p { flex: 1 1 auto; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin: 0; }
.detail-grid > div { min-width: 0; padding: 10px; border: 1px solid #eee; border-radius: 7px; }
.detail-grid dt { margin-bottom: 5px; color: #666; font-size: 10px; text-transform: uppercase; }
.detail-grid dd { margin: 0; overflow-wrap: anywhere; font-size: 12px; }
.detail-grid a { color: #222; }
.detail-credentials, .detail-notes { margin-top: 20px; }
.detail-credentials h3, .detail-notes h3 { margin: 0 0 9px; font-size: 13px; }
.detail-credential { display: grid; gap: 7px; padding: 11px; border: 1px solid #e7e7e7; border-radius: 8px; margin-bottom: 8px; font-size: 11px; }
.detail-credential > strong { font-size: 12px; }
.detail-credential .password-field { flex-wrap: wrap; }
.detail-credential .password-input { width: min(220px, 55vw); }
.detail-notes p { margin: 0; color: #444; font-size: 12px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.photo-upload-form { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 20px; padding-top: 15px; border-top: 1px solid #e5e5e5; }
.photo-upload-form label { font-size: 11px; font-weight: 700; }
.photo-upload-form input[type="file"] { max-width: 250px; font-size: 10px; }
.photo-upload-status { color: #444; font-size: 11px; }
.photo-field { display: grid; align-content: start; gap: 8px; }
.form-photo-preview { width: min(320px, 100%); max-height: 180px; border-radius: 8px; background: #f2f2f2; object-fit: cover; }
.folder-modal { position: fixed; width: min(440px, calc(100vw - 32px)); max-width: none; padding: 26px; border: 1px solid #ddd; border-radius: 12px; background: #fff; color: #111; box-shadow: 0 24px 90px #0004; }
.folder-modal::backdrop { background: #0007; backdrop-filter: blur(2px); }
.folder-modal h2 { margin: 7px 0 22px; font-size: 22px; }
.folder-modal label { display: block; margin: 13px 0 6px; color: #333; font-size: 11px; font-weight: 700; }
.folder-modal .form-actions { margin-bottom: 0; }
.folder-modal-help { margin: -13px 0 17px; color: #555; font-size: 12px; }
.folder-modal-close.modal-close { position: absolute; top: 10px; right: 10px; margin: 0; }
.folder-modal .form-actions .button { width: auto; }
@media (max-width: 760px) {
  .workspace.sidebar-collapsed { display: block; }
  .workspace.sidebar-collapsed .sidebar nav { display: none; }
  .sidebar-collapsed .sidebar-title { justify-content: space-between; }
  .sidebar-collapsed .sidebar-title > span:first-child, .sidebar-collapsed .sidebar-title .folder-total { display: inline; }
  .sidebar-collapsed .sidebar-title .collapse-glyph { margin-left: auto; }
  .equipment-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; padding: 12px; }
  .equipment-detail { grid-template-columns: 1fr; }
  .detail-cover { max-height: 240px; }
  .detail-cover img { position: static; max-height: 240px; border-radius: 12px; }
  .detail-content { padding: 19px; }
  .heading-actions { width: 100%; justify-content: start; }
  .heading-actions .button { flex: 1; }
  .inventory-tools { align-items: end; flex-direction: column; gap: 7px; }
  .view-list .equipment-card { grid-template-columns: minmax(0, 1fr) auto; }
  .view-list .equipment-card-open { grid-template-columns: 82px minmax(0, 1fr); }
  .view-list .card-photo { width: 82px; height: 100%; min-height: 100px; }
  .view-list .card-main { grid-template-columns: 1fr 1fr; gap: 5px 9px; }
  .view-list .card-actions { padding: 8px; }
  .view-list .card-footer { padding: 7px; }
  .ip-row { grid-template-columns: 1fr 1fr 32px; gap: 8px; padding: 9px; }
}
@media (max-width: 480px) {
  .equipment-grid { grid-template-columns: 1fr; }
  .card-photo { aspect-ratio: 16 / 8; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .inventory-tools { width: 100%; align-items: stretch; }
  .inventory-tools .view-switcher { justify-content: space-between; }
  .inventory-tools .view-switcher a { flex: 1; text-align: center; }
  .ip-row { grid-template-columns: 1fr 32px; }
  .ip-row .field:first-child { grid-column: 1 / -1; }
}

/* Cleaner equipment cards and direct copy rows */
.equipment-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 12px; padding: 14px; }
.equipment-card { border-color: #e5e5e5; border-radius: 14px; box-shadow: 0 3px 12px #00000008; }
.equipment-card:hover { border-color: #ccc; box-shadow: 0 9px 24px #00000012; }
.equipment-card-open { width: 100%; display: flex; flex-direction: column; align-items: stretch; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; text-align: left; }
.card-photo { width: auto; height: 152px; min-height: 0; margin: 0 12px; padding: 6px; border: 0; border-radius: 12px; background: #f5f5f3; }
.card-photo img { border-radius: 9px; object-fit: contain; mix-blend-mode: multiply; }
.card-main { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 14px 11px; text-align: center; }
.card-title-line { display: flex; align-items: flex-start; justify-content: center; gap: 7px; min-width: 0; padding: 13px 14px 8px; text-align: center; }
.card-type-badge { flex: 0 0 auto; padding: 3px 5px; border-radius: 4px; background: #111; color: #fff; font-size: 9px; font-weight: 700; line-height: 1.25; }
.card-main .equipment-name { min-width: 0; display: block; overflow: visible; color: #111; font-size: 14px; font-weight: 700; line-height: 1.4; letter-spacing: -.015em; overflow-wrap: break-word; word-break: normal; }
.card-title-line .equipment-name { flex: 0 1 auto; text-align: center; }
.card-pop-line { padding: 7px 12px 0; color: #222; font-size: 12px; font-weight: 700; line-height: 1.35; text-align: center; overflow-wrap: anywhere; }
.card-main .meta-device { color: #606060; font-size: 11px; font-weight: 650; }
.card-context-line { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 9px; }
.card-folder-label { min-width: 0; display: inline-flex; align-items: center; gap: 5px; color: #666; font-size: 10px; font-weight: 650; }
.card-folder-label > span { color: #777; font-size: 12px; }
.card-location { color: #333; font-size: 11px; font-weight: 650; line-height: 1.35; }
.card-main .meta-device { color: #777; font-size: 10px; }
.card-footer { display: grid; justify-content: stretch; align-items: stretch; gap: 8px; padding: 0 12px 12px; }
.card-ip-list { display: grid; gap: 4px; }
.card-copy-row { width: 100%; display: grid; grid-template-columns: 52px minmax(0, 1fr) 25px; align-items: center; gap: 7px; padding: 7px 8px; border: 1px solid #e9e9e9; border-radius: 7px; background: #fafafa; color: #222; text-align: left; cursor: pointer; }
.card-copy-row:hover, .card-secret-value:hover { border-color: #bbb; background: #f1f1f1; }
.card-copy-row span { color: #555; font-size: 10px; font-weight: 750; letter-spacing: .02em; }
.card-copy-row code { overflow: hidden; color: #111; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.card-copy-row b, .card-secret-value b { color: #777; font-size: 12px; text-align: center; }
.card-copy-list { display: grid; gap: 5px; }
.card-credential-line { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.card-credential-label { grid-column: 1 / -1; color: #666; font-size: 10px; font-weight: 650; }
.card-secret-value { min-width: 0; display: grid; grid-template-columns: 1fr 20px; align-items: center; gap: 2px 5px; padding: 5px 7px; border: 1px solid #e9e9e9; border-radius: 7px; background: #fff; text-align: left; cursor: pointer; }
.card-secret-value small { grid-column: 1 / -1; color: #777; font-size: 8px; font-weight: 750; letter-spacing: .05em; }
.card-secret-value code { overflow: hidden; color: #111; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.card-secret-value b { grid-column: 2; grid-row: 2; }
.card-actions { justify-content: end; padding: 2px 0 0; }
.card-footer .card-actions { border-top: 1px solid #eee; padding-top: 7px; }
.equipment-grid.view-list .equipment-card { grid-template-columns: minmax(0, 1fr); }
.view-list .equipment-card-open { display: grid; grid-template-columns: 112px minmax(0, 1fr); grid-template-rows: auto auto auto; min-height: 132px; align-items: center; }
.view-list .card-title-line { grid-column: 2; grid-row: 1; justify-content: flex-start; padding: 10px 12px 0; text-align: left; }
.view-list .card-title-line .equipment-name { text-align: left; }
.view-list .card-photo { grid-column: 1; grid-row: 1 / 4; width: auto; height: 112px; min-height: 0; margin: 10px; }
.view-list .card-pop-line { grid-column: 2; grid-row: 2; padding: 4px 12px; text-align: left; }
.view-list .card-main { grid-column: 2; grid-row: 3; align-items: flex-start; padding: 3px 12px 10px; text-align: left; }
.view-list .card-context-line { justify-content: flex-start; }
.view-list .card-footer { grid-template-columns: minmax(150px, .8fr) minmax(240px, 1.2fr) auto; align-items: center; }
.view-list .card-copy-list { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.view-list .card-credential-line { align-content: start; }
.view-list .card-footer .card-actions { border-top: 0; padding-top: 0; }

/* Collapse the sidebar without squeezing the inventory grid */
.workspace { min-width: 0; grid-template-columns: 260px minmax(0, 1fr); transition: grid-template-columns .2s ease; }
.sidebar { min-width: 0; overflow: hidden; }
.workspace.sidebar-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
.workspace.sidebar-collapsed .sidebar { width: 0; min-width: 0; padding: 0; border: 0; }
.sidebar-toggle-button { min-height: 36px; display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid #ddd; border-radius: 7px; background: #f6f6f6; color: #222; font-family: inherit; font-size: 11px; font-weight: 650; cursor: pointer; }
.sidebar-toggle-button:hover { background: #eee; }
.toggle-menu-icon { font-size: 16px; }
@media (max-width: 760px) {
  .equipment-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
  .equipment-grid.view-list .card-footer { grid-template-columns: 1fr; }
  .view-list .card-copy-list { grid-template-columns: 1fr 1fr; }
  .workspace { display: grid; grid-template-columns: minmax(0, 1fr); }
  .workspace .sidebar { display: flex; width: auto; min-height: 0; padding: 15px 14px; border-right: 0; border-bottom: 1px solid #e5e5e5; }
  .workspace.sidebar-collapsed { display: grid; grid-template-columns: minmax(0, 1fr); }
  .workspace.sidebar-collapsed .sidebar { display: none; }
  .topbar { justify-content: flex-start; }
  .sidebar-toggle-button { order: 2; }
}
@media (max-width: 480px) {
  .equipment-grid { grid-template-columns: 1fr; padding: 10px; }
  .equipment-grid.view-list .equipment-card-open { grid-template-columns: 86px minmax(0, 1fr); }
  .equipment-grid.view-list .card-photo { width: auto; }
  .view-list .card-copy-list { grid-template-columns: 1fr; }
  .view-list .card-credential-line { grid-template-columns: 1fr 1fr; }
  .card-copy-row { grid-template-columns: 48px minmax(0, 1fr) 22px; }
}

/* Copy feedback stays fixed so card controls never resize or shift. */
.copy-toast { position: fixed; z-index: 3000; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); padding: 10px 18px; border: 1px solid #333; border-radius: 999px; background: #111; color: #fff; box-shadow: 0 8px 28px #0003; font-size: 13px; font-weight: 650; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity .18s ease, transform .18s ease; }
.copy-toast.visible { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 760px) {
  .equipment-grid.view-list .equipment-card-open { grid-template-columns: 98px minmax(0, 1fr); }
  .equipment-grid.view-list .card-photo { height: 98px; }
}
@media (max-width: 480px) {
  .equipment-grid { grid-template-columns: minmax(0, 1fr); padding: 10px; }
  .equipment-grid.view-list .equipment-card-open { grid-template-columns: 82px minmax(0, 1fr); }
  .equipment-grid.view-list .card-photo { height: 82px; margin: 6px; }
  .equipment-grid:not(.view-list) .card-photo { height: 140px; }
}

/* Modal photo uses a tighter panel and a closer crop. */
.equipment-detail { grid-template-columns: minmax(245px, .9fr) minmax(0, 1.5fr); min-height: 320px; }
.detail-cover { max-height: min(68dvh, 560px); min-height: 320px; align-self: start; }
.detail-cover img { width: 100%; height: 100%; min-height: 320px; max-height: min(68dvh, 560px); object-fit: cover; object-position: center center; border-radius: 14px; }
.detail-content { padding: 23px; }
@media (max-width: 760px) {
  .equipment-detail { grid-template-columns: minmax(0, 1fr); }
  .detail-cover { min-height: 250px; max-height: 250px; }
  .detail-cover img { min-height: 250px; max-height: 250px; border-radius: 12px; }
}

/* Wider folder rail keeps names clear of the action buttons. */
.workspace { grid-template-columns: 330px minmax(0, 1fr); }
.folder-item { gap: 6px; }
.folder-item .folder-link { gap: 8px; }
.folder-item-actions { gap: 3px; opacity: 1; }
.folder-item-action { width: 25px; flex: 0 0 25px; }
.folder-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-title { gap: 8px; }
.sidebar-toggle-button { min-width: 28px; width: 28px; height: 28px; min-height: 28px; display: grid; flex: 0 0 28px; place-items: center; padding: 0; border: 1px solid #ccc; border-radius: 6px; background: #fff; color: #222; font-size: 20px; line-height: 1; cursor: pointer; }
.sidebar-toggle-button:hover { background: #eee; }
.toggle-menu-icon { display: block; font-size: 24px; line-height: 1; }
.folder-edit-button { min-height: 26px; padding: 0 8px; border: 1px solid #d4d4d4; border-radius: 6px; background: #fff; color: #333; font-family: inherit; font-size: 10px; font-weight: 700; cursor: pointer; }
.folder-edit-button:hover { border-color: #999; background: #eee; color: #111; }
.folder-edit-modal { width: min(500px, calc(100vw - 32px)); }
.folder-edit-modal form + form { margin-top: 18px; padding-top: 14px; border-top: 1px solid #e5e5e5; }
.folder-edit-inline { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.folder-edit-inline .button { width: auto; white-space: nowrap; }
.folder-edit-delete .button-danger { border-color: #b33; background: #fff; color: #a22; }
.folder-edit-delete .button-danger:hover { background: #fff0f0; }
.folder-edit-modal .form-actions { margin-top: 15px; }
.card-quick-access { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) 18px; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid #dedede; border-radius: 7px; background: #f7f7f7; color: #222; text-align: left; cursor: pointer; }
.card-quick-access:hover { border-color: #aaa; background: #eee; }
.card-quick-access span { color: #555; font-size: 9px; font-weight: 750; text-transform: uppercase; }
.card-quick-access code { overflow: hidden; color: #111; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.card-quick-access b { color: #777; font-size: 12px; text-align: center; }
.card-photo { height: 168px; }
.card-photo img { object-fit: cover; object-position: center center; border-radius: 12px; }
.view-list .equipment-card-open { min-height: 112px; }
.view-list .card-photo { height: 120px; }
.view-list .card-title-line { padding: 6px 9px 2px; }
.view-list .card-pop-line { padding: 1px 9px; font-size: 11px; }
.view-list .card-main { padding-top: 1px; padding-bottom: 4px; }
.view-list .card-footer { gap: 4px; padding: 4px 7px; }
.view-list .card-ip-list, .view-list .card-copy-list { gap: 3px; }
.view-list .card-copy-row, .view-list .card-secret-value, .view-list .card-quick-access { padding-top: 4px; padding-bottom: 4px; }
.view-list .card-copy-row code, .view-list .card-secret-value code, .view-list .card-quick-access code { font-size: 9px; }
.workspace.sidebar-collapsed { grid-template-columns: 48px minmax(0, 1fr); }
.workspace.sidebar-collapsed .sidebar { width: 48px; min-width: 48px; padding: 13px 7px; border-right: 1px solid #e5e5e5; }
.sidebar-collapsed .sidebar-title { justify-content: center; margin: 0 0 12px; }
.sidebar-collapsed .sidebar-title > span { display: none; }
.sidebar-collapsed .sidebar-toggle-button { width: 32px; flex-basis: 32px; }
.sidebar-collapsed .sidebar nav, .sidebar-collapsed .folder-admin-actions, .sidebar-collapsed .sidebar-foot { display: none; }
@media (max-width: 1100px) and (min-width: 761px) {
  .workspace { grid-template-columns: 300px minmax(0, 1fr); }
  .workspace.sidebar-collapsed { grid-template-columns: 48px minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .card-photo { height: 160px; }
  .view-list .card-photo { height: 104px; }
  .folder-edit-inline { grid-template-columns: minmax(0, 1fr); }
  .folder-edit-inline .button { width: 100%; }
  .workspace { display: grid; grid-template-columns: minmax(0, 1fr); }
  .workspace .sidebar { width: auto; min-width: 0; padding: 15px 14px; border-right: 0; border-bottom: 1px solid #e5e5e5; }
  .workspace.sidebar-collapsed { grid-template-columns: 48px minmax(0, 1fr); }
  .workspace.sidebar-collapsed .sidebar { width: 48px; min-width: 48px; display: block; padding: 13px 7px; border-right: 1px solid #e5e5e5; border-bottom: 0; }
  .workspace.sidebar-collapsed .sidebar-title { justify-content: center; margin: 0; }
  .workspace.sidebar-collapsed .sidebar-title > span { display: none; }
  .workspace.sidebar-collapsed .sidebar nav, .workspace.sidebar-collapsed .folder-admin-actions, .workspace.sidebar-collapsed .sidebar-foot { display: none; }
}

/* Botao discreto de criar pasta no cabecalho da sidebar */
.folder-add-button {
  min-width: 22px; width: 22px; height: 22px; display: grid; flex: 0 0 22px; place-items: center;
  padding: 0; margin-left: auto; border: 1px solid #303b4e; border-radius: 6px;
  background: transparent; color: #8b97ab; font-family: inherit; font-size: 14px; line-height: 1;
  cursor: pointer; opacity: .7;
}
.folder-add-button:hover { opacity: 1; border-color: #596579; background: #202a39; color: #fff; }
.sidebar-collapsed .folder-add-button { display: none; }

/* Acesso restrito por usuario (card e modal) */
.card-credential-restricted { color: #7f8ba1; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.access-restricted-note { margin-top: 8px; font-size: 11px; }

/* Foto do card: inteira, centralizada e sem corte/zoom */
.card-photo {
  display: grid; place-items: center;
  width: auto; height: 168px; min-height: 0;
  margin: 0 12px; padding: 10px; overflow: hidden;
  border: 0; border-radius: 12px;
  background: linear-gradient(180deg, #f8f8f6 0%, #eeece8 100%);
}
.card-photo img {
  width: 100%; height: 100%; display: block;
  object-fit: contain; object-position: center;
  transform: none; border-radius: 8px; mix-blend-mode: normal;
}
.view-list .card-photo { height: 120px; padding: 8px; }

/* Acesso rapido: presente em todo equipamento com IP e com visual limpo */
.card-quick-access {
  min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) 20px;
  align-items: center; gap: 8px; padding: 6px 8px 6px 6px;
  border: 1px solid #e3e6ec; border-radius: 8px; background: #fff;
  color: #111; text-align: left; cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.card-quick-access:hover { border-color: #111; background: #fbfbfb; box-shadow: 0 2px 8px #00000010; }
.card-quick-access .card-quick-label {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 48px; padding: 3px 7px; border-radius: 999px;
  background: #111; color: #fff; font-size: 9px; font-weight: 800;
  letter-spacing: .06em; line-height: 1.2; text-transform: uppercase;
}
.card-quick-access code {
  min-width: 0; overflow: hidden; color: #1b1b1b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px; font-weight: 600; letter-spacing: -.01em;
  text-overflow: ellipsis; white-space: nowrap;
}
.card-quick-access .card-quick-copy { color: #a2aab8; font-size: 12px; line-height: 1; text-align: center; }
.card-quick-access:hover .card-quick-copy { color: #111; }

@media (max-width: 900px) {
  .card-photo { height: 160px; }
  .view-list .card-photo { height: 104px; }
}
@media (max-width: 480px) {
  .card-photo { height: 140px; padding: 8px; }
  .view-list .card-photo { height: 82px; padding: 6px; }
}


/* Form modal: fits the screen, scrollable, FECHAR always reachable */
.form-modal { width: min(900px, calc(100vw - 32px)); max-height: min(88dvh, 900px); display: flex; flex-direction: column; overflow: hidden; border-radius: 14px; background: #fff; color: #111; box-shadow: 0 24px 90px #0005; }
.form-modal::backdrop { background: #0008; backdrop-filter: blur(2px); }
.form-modal #form-modal-body { min-height: 180px; overflow: auto; }
.equip-form-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 18px; border-bottom: 1px solid #e5e5e5; background: #fff; }
.equip-form-bar h2 { margin: 3px 0 0; font-size: 17px; }
.equip-form-scroll { max-height: calc(min(88dvh, 900px) - 116px); overflow-y: auto; }
.equip-form-actions { position: sticky; bottom: 0; z-index: 2; display: flex; justify-content: flex-end; gap: 9px; padding: 12px 16px; border-top: 1px solid #e5e5e5; background: #fff; }
.equip-form-embed .equipment-form { padding: 16px 18px 4px; }
.equip-form-embed .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.equip-form-embed .field-wide { grid-column: 1 / -1; }
.equip-form-embed .credential-row, .equip-form-embed .ip-row { grid-template-columns: 1fr; gap: 8px; padding: 10px; }
.equip-form-embed .credential-row .field:nth-child(3) { grid-column: auto; }
.modal-close { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid #e2e2e2; border-radius: 50%; background: #f7f7f7; color: #444; font-size: 20px; cursor: pointer; }
.modal-close:hover { background: #efefef; }
@media (max-width: 760px) {
  .form-modal { width: calc(100vw - 12px); max-height: 94dvh; }
  .equip-form-scroll { max-height: calc(94dvh - 110px); }
  .equip-form-embed .equipment-form { padding: 12px; }
  .equip-form-embed .form-grid { grid-template-columns: 1fr; }
  .equip-form-embed .credential-row, .equip-form-embed .ip-row { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .form-modal { width: 100vw; max-height: 100dvh; border-radius: 0; }
  .equip-form-scroll { max-height: calc(100dvh - 108px); }
  .equip-form-actions .button { flex: 1; }
}


/* Centralized, rounded photos everywhere */
.card-photo { overflow: hidden; border-radius: 13px; }
.card-photo img, .view-list .card-photo img {
  width: 100%; height: 100%; display: block;
  object-fit: cover; object-position: center center;
  border-radius: 12px;
}
.form-photo-preview { border-radius: 12px; }
.detail-cover, .detail-cover img { border-radius: 14px; }
.detail-cover { overflow: hidden; }

/* Photo cropper during upload */
.photo-cropper { display: grid; gap: 10px; margin: 12px 0 2px; padding: 12px; border: 1px solid #e6e6e6; border-radius: 14px; background: #fafafa; }
.photo-crop-frame {
  width: min(100%, 440px); aspect-ratio: 16 / 10; margin: 0 auto; overflow: hidden; position: relative;
  border: 1px solid #dcdcdc; border-radius: 12px; background: #111; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab;
}
.photo-crop-frame.is-dragging { cursor: grabbing; }
#photo-crop-img {
  position: absolute; left: 50%; top: 50%; width: auto; height: auto;
  max-width: none; max-height: none; transform-origin: center center; pointer-events: none; -webkit-user-drag: none;
}
.photo-crop-controls { display: flex; align-items: center; gap: 10px; }
.photo-crop-label { color: #444; font-size: 12px; font-weight: 650; }
.photo-crop-controls input[type="range"] { flex: 1; accent-color: #111; }
#photo-crop-hint { color: #666; }
.view-list .card-photo { border-radius: 10px; }

[hidden] { display: none !important; }


/* Detail modal: swap photo inline, hide empty fields (already conditional in template) */
.detail-photo-section { margin-top: 18px; padding-top: 14px; border-top: 1px solid #eee; }
.detail-photo-section h3 { margin: 0 0 6px; font-size: 13px; }
.detail-photo-help { margin: 0 0 12px; color: #666; font-size: 11px; }
.photo-upload-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.photo-upload-form input[type="file"] { flex: 1 1 220px; min-width: 0; padding: 8px 10px; border: 1px dashed #d5d5d5; border-radius: 9px; background: #fafafa; font-size: 12px; }
.photo-upload-form input[type="file"]:focus-visible { outline: 2px solid #333; outline-offset: 2px; }
.photo-upload-status { color: #555; font-size: 11px; }

/* Consolidado: card de foto compacto, sem sobra, imagem preenchendo e centralizada */
.card-photo { height: 140px; padding: 6px; margin: 0 12px; overflow: hidden; border: 0; border-radius: 13px; background: linear-gradient(180deg, #f8f8f6 0%, #eeece8 100%); display: grid; place-items: center; }
.card-photo img, .view-list .card-photo img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center center; border-radius: 12px; transform: none; mix-blend-mode: normal; }
.view-list .card-photo { grid-column: 1; grid-row: 1 / 4; width: auto; height: 92px; margin: 8px; padding: 4px; }
.equipment-grid:not(.view-list) .card-photo { height: 140px; }
@media (max-width: 900px) {
  .card-photo { height: 128px; }
  .view-list .card-photo { height: 88px; }
}
@media (max-width: 480px) {
  .card-photo { height: 112px; padding: 3px; }
  .view-list .card-photo { height: 70px; }
}
/* compat */
.card-photo-photo { }

/* FINAL: card de foto sem qualquer sobra (cleanup de conflitos) */
.card-photo { height: 150px !important; padding: 0 !important; margin: 0 !important; overflow: hidden !important; border: 0 !important; border-radius: 12px !important; background: transparent !important; display: block !important; place-items: initial !important; }
.card-photo img, .view-list .card-photo img { width: 100% !important; height: 100% !important; display: block !important; object-fit: cover !important; object-position: center center !important; border-radius: 0 !important; transform: none !important; mix-blend-mode: normal !important; aspect-ratio: auto !important; }
.view-list .card-photo { height: 96px !important; margin: 0 !important; }
@media (max-width: 480px) { .card-photo { height: 120px !important; padding: 0 !important; margin: 0 !important; } }

/* Cliente bridge / PPPoE: bloco visualmente separado no formulário */
.customer-network { margin-top: 4px; padding: 14px 12px 2px; border: 1px dashed #d8d8d8; border-radius: 12px; background: #fafaf9; }
.customer-network > legend { padding: 0 8px; color: #333; font-size: 10px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.customer-network .customer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 480px) { .customer-network .customer-grid { grid-template-columns: 1fr; } }
.field-link-extra { display: inline-block; margin-top: 6px; color: #111; font-size: 11px; font-weight: 700; text-decoration: none; border-bottom: 1px dashed #bbb; padding-bottom: 1px; }
.field-link-extra:hover { color: #000; border-color: #333; }

.detail-chain { margin-top: 18px; padding-top: 16px; border-top: 1px solid #eee; }
.detail-chain h3 { margin: 0 0 9px; font-size: 13px; }
.detail-chain-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid #eee; border-radius: 8px; margin-bottom: 8px; font-size: 12px; }
.detail-chain-label { min-width: 110px; color: #666; font-size: 9px; text-transform: uppercase; letter-spacing: .06em; font-weight: 750; }
.detail-chain-link { border: 0; background: #f3f3f3; padding: 5px 9px; border-radius: 6px; color: #111; font-family: inherit; font-size: 12px; cursor: pointer; }
.detail-chain-link:hover { background: #e6e6e6; }
.detail-chain-sep { color: #999; margin: 0 4px; }
.detail-chain-values { display: flex; flex-wrap: wrap; gap: 6px; }

/* FINAL: modal de detalhe — foto centralizada sem conflitos */
.equipment-detail { grid-template-columns: minmax(260px, .9fr) minmax(0, 1.5fr) !important; align-items: stretch; min-height: 360px !important; }
.detail-cover { display: grid; place-items: center; min-height: 0; max-height: none; align-self: stretch !important; padding: 22px; background: linear-gradient(180deg, #f9f9f7, #eeece8); }
.detail-cover img { width: 100%; height: 100%; max-height: none !important; min-height: 0 !important; position: static !important; object-fit: cover !important; object-position: center center !important; border-radius: 16px !important; }
@media (max-width: 760px) {
  .equipment-detail { grid-template-columns: 1fr !important; }
  .detail-cover { max-height: 260px !important; min-height: 260px !important; align-self: stretch !important; }
  .detail-cover img { min-height: 0 !important; max-height: none !important; }
}

.card-url-row { text-decoration: none; }
.card-url-row code { text-decoration: none; }

.extra-new-box { margin-top: 10px; }
.extra-new-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) 34px; gap: 8px; align-items: end; padding: 12px; margin-bottom: 10px; border: 1px dashed #c9c9c9; border-radius: 10px; background: #fcfcfc; }
.extra-new-row .span-2 { grid-column: span 2; }
.extra-new-row .span-3 { grid-column: span 3; }
.extra-new-row .field { min-width: 0; }
.extra-new-row input[type="file"] { padding: 7px 8px; }
.remove-extra-new { grid-column: 5; grid-row: 1 / span 2; align-self: center; }
@media (max-width: 760px) {
  .extra-new-row { grid-template-columns: 1fr 1fr; }
  .extra-new-row .span-2, .extra-new-row .span-3 { grid-column: span 2; }
  .remove-extra-new { grid-column: 2; grid-row: auto; justify-self: end; }
}
.equip-form-embed .extra-new-row { grid-template-columns: 1fr 1fr; }
.equip-form-embed .extra-new-row .span-2, .equip-form-embed .extra-new-row .span-3 { grid-column: span 2; }

/* ==== List view redesign (2026-11-11): alinhado, denso, foto equilibrada ==== */
.equipment-grid.view-list { display: flex; flex-direction: column; gap: 10px; }
.equipment-grid.view-list .equipment-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 116px;
  padding: 0;
  overflow: hidden;
}
.view-list .equipment-card-open {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 12px;
  height: 100%;
  padding: 10px 12px;
  text-align: left;
}
.view-list .card-photo {
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: center;
  box-sizing: border-box;
  width: 148px;
  height: 104px;
  margin: 0;
  padding: 5px;
  border-radius: 10px;
  background: #f5f5f3;
}
.view-list .card-photo img {
  object-fit: contain;
  object-position: center center;
  mix-blend-mode: multiply;
  border-radius: 8px;
}
.view-list .card-title-line {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  justify-content: flex-start;
  gap: 8px;
  padding: 0;
  text-align: left;
}
.view-list .card-title-line .equipment-name {
  text-align: left;
  font-size: 14px;
  line-height: 1.3;
}
.view-list .card-pop-line {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  padding: 3px 0 0;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: #555;
}
.view-list .card-footer {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  height: 100%;
  padding: 10px 12px;
  border-left: 1px solid #eee;
  border-top: 0;
}
.view-list .card-ip-list {
  flex: 0 0 auto;
  min-width: 165px;
  display: grid;
  gap: 4px;
}
.view-list .card-copy-list {
  flex: 0 1 auto;
  min-width: 200px;
  display: grid;
  grid-template-columns: none;
  gap: 5px;
}
.view-list .card-credential-line { grid-template-columns: 1fr 1fr; }
.view-list .card-quick-access { flex: 0 1 auto; max-width: 250px; }
.view-list .card-quick-access code { max-width: 170px; }
.view-list .card-actions {
  flex-direction: column;
  gap: 6px;
  padding: 0;
  border-top: 0;
}
@media (max-width: 1180px) {
  .view-list .equipment-card-open { grid-template-columns: 124px minmax(0, 1fr); }
  .view-list .card-photo { width: 124px; height: 92px; }
  .view-list .card-ip-list { min-width: 150px; }
  .view-list .card-quick-access code { max-width: 140px; }
}
@media (max-width: 940px) {
  .equipment-grid.view-list .equipment-card { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .view-list .card-footer {
    height: auto;
    flex-wrap: wrap;
    border-left: 0;
    border-top: 1px solid #eee;
    justify-content: flex-start;
  }
  .view-list .card-ip-list { grid-auto-flow: column; min-width: 0; }
  .view-list .card-copy-list { min-width: 0; flex: 1 1 220px; }
  .view-list .card-quick-access { max-width: none; flex: 1 1 180px; }
}
@media (max-width: 640px) {
  .view-list .equipment-card-open { grid-template-columns: 96px minmax(0, 1fr); }
  .view-list .card-photo { width: 96px; height: 78px; }
  .view-list .card-pop-line { font-size: 10px; }
  .view-list .card-copy-list { flex-basis: 100%; }
  .view-list .card-copy-list { grid-template-columns: 1fr; }
  .view-list .card-ip-list { grid-auto-flow: row; flex-basis: 100%; }
}

/* ==== Cadeia com foto + foto do detalhe centralizada (2026-11-11) ==== */
.equipment-detail .detail-cover img {
  object-fit: contain !important;
  object-position: center center !important;
}
.detail-chain-row { align-items: flex-start; }
.detail-chain-label { padding-top: 11px; }
.detail-chain-list {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.detail-chain-item {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  padding: 6px 10px 6px 6px;
  border: 1px solid #e3e3e0;
  border-radius: 10px;
  background: #fafaf9;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.detail-chain-item:hover { border-color: #c8c8c3; background: #f2f2ee; }
.detail-chain-photo {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 66px;
  height: 48px;
  overflow: hidden;
  border-radius: 7px;
  background: #efede8;
}
.detail-chain-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  border-radius: 7px;
}
.detail-chain-meta { display: grid; gap: 2px; min-width: 0; }
.detail-chain-name {
  color: #111;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.detail-chain-sub {
  color: #666;
  font-size: 10px;
  overflow-wrap: anywhere;
}

/* ==== Navegação: scroll e botão Voltar no modal (2026-11-11) ==== */
.modal-chrome {
  position: sticky;
  z-index: 3;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px 0;
}
.modal-chrome .modal-close {
  position: static;
  float: none;
  margin: 0;
}
.modal-back {
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  color: #111;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  padding: 7px 12px;
  cursor: pointer;
  box-shadow: 0 2px 8px #00000014;
}
.modal-back:hover { background: #f2f2f2; }
.modal-loading, .modal-error { padding: 24px 16px; }

@font-face {
  font-family: "Noto Sans";
  src: url("fonts/NotoSans-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Noto Sans";
  src: url("fonts/NotoSans-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --font-sans: "Noto Sans", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --bg: #f3f6fb;
  --bg-accent: #e7eef9;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #edf2f8;
  --surface-raised: #ffffff;
  --line: #dce4ef;
  --line-strong: #c5d1e0;
  --text: #101a2b;
  --text-soft: #45556b;
  --muted: #6b7b91;
  --accent: #0b6bcb;
  --accent-strong: #0757a8;
  --accent-soft: #e8f1fc;
  --accent-contrast: #ffffff;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --success: #067647;
  --success-soft: #ecfdf3;
  --shadow-sm: 0 1px 2px rgba(16, 26, 43, .06);
  --shadow-md: 0 12px 32px rgba(16, 26, 43, .10);
  --shadow-lg: 0 28px 90px rgba(16, 26, 43, .22);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --ring: 0 0 0 3px rgba(11, 107, 203, .18);
  --blue: var(--accent);
  --blue-strong: var(--accent-strong);
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0f17;
  --bg-accent: #122033;
  --surface: #111927;
  --surface-2: #161f2f;
  --surface-3: #1b2739;
  --surface-raised: #182334;
  --line: #263447;
  --line-strong: #35465c;
  --text: #e7eef8;
  --text-soft: #b7c3d5;
  --muted: #8b99ad;
  --accent: #4aa8ff;
  --accent-strong: #2b8fe8;
  --accent-soft: #12283f;
  --accent-contrast: #04121f;
  --danger: #ff7b72;
  --danger-soft: #2a1518;
  --success: #56d364;
  --success-soft: #0f2418;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .40);
  --shadow-md: 0 12px 34px rgba(0, 0, 0, .38);
  --shadow-lg: 0 28px 90px rgba(0, 0, 0, .60);
  --ring: 0 0 0 3px rgba(74, 168, 255, .24);
  background: var(--bg);
  color: var(--text);
}
html { background: var(--bg); }
body {
  background:
    radial-gradient(1100px 520px at 88% -12%, var(--bg-accent), transparent 62%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent-soft); color: var(--text); }
* { scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(16, 26, 43, .02);
}
.brand strong { color: var(--text); }
.brand small { color: var(--muted); }
.brand-mark {
  background-color: #ffffff;
  background-image: url("pedranet-icon-512.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 82%;
  border: 1px solid var(--line);
  color: transparent;
  font-size: 0;
  box-shadow: var(--shadow-sm);
}
html[data-theme="dark"] .brand-mark { background-color: #f8fafc; border-color: #3a4b62; }

.global-search {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--muted);
}
.global-search input { color: var(--text); }
.global-search input::placeholder { color: var(--muted); }
.clear-search { color: var(--accent); }

.account-menu { gap: 8px; }
.account-avatar {
  border-color: var(--line-strong);
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.account-copy strong { color: var(--text); }
.account-copy small { color: var(--muted); }
.account-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 2px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}
.account-action {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.account-action:hover { border-color: var(--line-strong); background: var(--surface-3); color: var(--text); }
.account-action > span[aria-hidden] { font-size: 13px; opacity: .85; }
.account-action-logout { color: var(--danger); }
.account-action-logout:hover { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }

.theme-toggle {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 16px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.theme-toggle:hover { border-color: var(--line-strong); background: var(--surface-3); color: var(--text); }
.theme-toggle .theme-icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .theme-icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .theme-icon-moon { display: inline; }

.edit-mode-toggle {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .03em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.edit-mode-toggle:hover { border-color: var(--line-strong); background: var(--surface-3); color: var(--text); }
.edit-mode-toggle b { font-weight: 850; letter-spacing: .06em; }
.edit-mode-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 3px var(--surface-3);
}
.edit-mode-toggle[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.edit-mode-toggle[aria-pressed="true"] .edit-mode-dot {
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-soft);
}

.button-primary { background: var(--accent); color: var(--accent-contrast); box-shadow: var(--shadow-sm); }
.button-primary:hover { background: var(--accent-strong); }
.button-muted, .icon-button, .folder-total {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--text-soft);
}
.button-muted:hover, .icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-3);
  color: var(--text);
}
.button-danger { border-color: var(--danger); background: var(--surface); color: var(--danger); }
.button-danger:hover { background: var(--danger-soft); }

.sidebar { background: var(--surface); border-color: var(--line); }
.sidebar-title, .sidebar-foot, .sidebar-foot strong { color: var(--muted); }
.folder-total { color: var(--text-soft); }
.folder-link { color: var(--text-soft); }
.folder-link:hover { background: var(--surface-3); color: var(--text); }
.folder-link.selected {
  border-color: var(--line-strong);
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.folder-count, .folder-icon { color: var(--muted); }
.folder-children, .new-folder { border-color: var(--line); }
.folder-add-button, .sidebar-toggle-button, .folder-edit-button {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--text-soft);
}
.folder-add-button:hover, .sidebar-toggle-button:hover, .folder-edit-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-3);
  color: var(--text);
}
.folder-edit-delete .button-danger { background: var(--surface); }
.folder-edit-delete .button-danger:hover { background: var(--danger-soft); }

.panel { border-color: var(--line); background: var(--surface); box-shadow: var(--shadow-sm); }
.panel-heading, .form-actions, .folder-permissions { border-color: var(--line); }
.panel-heading h2, .equipment-name, .empty-row strong, .empty-cards strong,
.page-heading h1, .form-intro h1 { color: var(--text); }
.panel-note, .result-count, .equipment-maker, .table-subline, .observations { color: var(--muted) !important; }
.flash-message {
  border-color: var(--line-strong);
  background: var(--success-soft);
  color: var(--success);
}
.empty-cards small { color: var(--muted); }
.page-heading p, .form-intro p { color: var(--muted); }
.page-footer { color: var(--muted); }
.eyebrow { color: var(--accent); }
.muted, .field-help, .empty-row small { color: var(--muted); }

.equipment-table th { background: var(--surface-2); color: var(--muted); }
.equipment-table td { border-color: var(--line); color: var(--text-soft); }
.equipment-table tbody tr:hover { background: var(--surface-2); }
.equipment-table code { background: var(--surface-3); color: var(--text); }
.category-chip { border-color: var(--line); background: var(--surface-3); color: var(--text-soft); }

.view-switcher { border-color: var(--line); background: var(--surface-2); }
.view-switcher a { color: var(--muted); }
.view-switcher a:hover { background: var(--surface-3); color: var(--text); }
.view-switcher a.active { background: var(--text); color: var(--surface); }
html[data-theme="dark"] .view-switcher a.active { background: var(--accent); color: var(--accent-contrast); }

.input, .password-input, .new-folder input, .new-folder select {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}
.input:focus, .new-folder input:focus, .new-folder select:focus {
  border-color: var(--accent);
  box-shadow: var(--ring);
}
.input::placeholder { color: var(--muted); }
.field label, .folder-modal label { color: var(--text-soft); }
.field-error { color: var(--danger); }
.folder-permissions p { color: var(--muted); }
.permission-option { border-top-color: var(--line); }
.permission-option input { accent-color: var(--accent); }

.equipment-card {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.equipment-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}
.equipment-card-open { color: var(--text); }
.card-main .equipment-name, .card-title-line .equipment-name { color: var(--text); }
.card-pop-line { color: var(--text-soft); }
.card-type-badge { background: var(--text); color: var(--surface); }
html[data-theme="dark"] .card-type-badge {
  border: 1px solid var(--line);
  background: var(--surface-3);
  color: var(--text);
}
.card-title-line { flex-wrap: wrap; align-items: center; }
.card-extra-badge {
  flex: 0 1 auto;
  max-width: 100%;
  overflow: hidden;
  padding: 3px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.view-list .card-title-line { justify-content: flex-start; }

.equipment-grid:not(.view-list) .card-photo {
  height: 158px !important;
  display: grid !important;
  place-items: center !important;
  margin: 0 12px !important;
  padding: 10px !important;
  border-radius: 12px !important;
  background: var(--surface-3) !important;
}
.equipment-grid:not(.view-list) .card-photo img {
  object-fit: contain !important;
  object-position: center !important;
  border-radius: 8px !important;
  mix-blend-mode: normal !important;
}
.view-list .card-photo { background: var(--surface-3) !important; }
.view-list .card-photo img {
  object-fit: contain !important;
  object-position: center !important;
  mix-blend-mode: normal !important;
}
@media (max-width: 900px) {
  .equipment-grid:not(.view-list) .card-photo { height: 146px !important; }
}
@media (max-width: 480px) {
  .equipment-grid:not(.view-list) .card-photo {
    height: 136px !important;
    margin: 0 10px !important;
    padding: 8px !important;
  }
}

.card-copy-row {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--text);
}
.card-copy-row:hover, .card-secret-value:hover {
  border-color: var(--line-strong);
  background: var(--surface-3);
}
.card-copy-row span, .card-secret-value small, .card-credential-label,
.card-folder-label, .card-folder-label > span { color: var(--muted); }
.card-copy-row code, .card-secret-value code { color: var(--text); }
.card-copy-row b, .card-secret-value b { color: var(--muted); }
.card-secret-value { border-color: var(--line); background: var(--surface); }
.card-credential-restricted { color: var(--muted); }
.card-footer .card-actions { border-top-color: var(--line); }

.card-quick-access {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}
.card-quick-access:hover { border-color: var(--line-strong); background: var(--surface-2); }
.card-quick-access .card-quick-label { background: var(--text); color: var(--surface); }
html[data-theme="dark"] .card-quick-access .card-quick-label {
  background: var(--accent);
  color: var(--accent-contrast);
}
.card-quick-access code { color: var(--text); }
.card-quick-access .card-quick-copy { color: var(--muted); }
.card-quick-access:hover .card-quick-copy { color: var(--text); }

.detail-modal, .form-modal, .folder-modal {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
.detail-modal::backdrop, .form-modal::backdrop, .folder-modal::backdrop {
  background: rgba(2, 6, 23, .62);
}
.modal-close, .modal-back, .detail-copy-button {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--text-soft);
}
.modal-close:hover, .modal-back:hover, .detail-copy-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-3);
  color: var(--text);
}
.modal-loading, .modal-error { color: var(--muted); }
.detail-content, .detail-title-row h2 { color: var(--text); }
.detail-cover { background: var(--surface-3); }
.detail-cover img { mix-blend-mode: normal; }
.detail-grid > div { border-color: var(--line); background: var(--surface-2); }
.detail-grid dt { color: var(--muted); }
.detail-grid dd, .detail-grid a { color: var(--text); }
.detail-credential { border-color: var(--line); background: var(--surface-2); }
.detail-notes p { color: var(--text-soft); }
.detail-copy-field[role="button"]:hover { background: var(--surface-3); }
.detail-copy-icon { color: var(--muted); }
.detail-photo-section, .photo-upload-form, .detail-chain { border-color: var(--line); }
.detail-photo-help, .photo-upload-status, .photo-crop-label, #photo-crop-hint { color: var(--muted); }
.detail-chain-row { border-color: var(--line); background: var(--surface-2); }
.detail-chain-label, .detail-chain-sub { color: var(--muted); }
.detail-chain-name { color: var(--text); }
.detail-chain-link { background: var(--surface-3); color: var(--text); }
.detail-chain-link:hover { background: var(--line); }
.detail-chain-item { border-color: var(--line); background: var(--surface-2); color: var(--text); }
.detail-chain-item:hover { border-color: var(--line-strong); background: var(--surface-3); }
.detail-chain-photo { background: var(--surface-3); }

.equip-form-bar, .equip-form-actions { border-color: var(--line); background: var(--surface); }
.equip-form-bar h2 { color: var(--text); }
.customer-network, .photo-cropper { border-color: var(--line); background: var(--surface-2); }
.customer-network > legend { color: var(--text-soft); }
.photo-crop-frame { border-color: var(--line-strong); background: #0b1018; }
.photo-crop-controls input[type="range"] { accent-color: var(--accent); }
.form-photo-preview { background: var(--surface-3); }
.extra-new-row {
  border-color: var(--line-strong);
  background: var(--surface-2);
}
.photo-upload-form input[type="file"] {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--text-soft);
}
.photo-upload-form input[type="file"]:focus-visible { outline-color: var(--accent); }
.field-link-extra { color: var(--accent); border-bottom-color: var(--line-strong); }
.field-link-extra:hover { color: var(--accent-strong); border-bottom-color: var(--accent); }
.detail-addresses dd strong { color: var(--muted); }
.folder-edit-modal form + form { border-top-color: var(--line); }
.delete-action:hover {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}
.folder-modal-help { color: var(--muted); }
.detail-copy-field[role="button"]:focus-visible { outline-color: var(--accent); }
.folder-expander { color: var(--text-soft); }
.folder-expander:hover { background: var(--surface-3); }
.folder-delete-action:hover {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}
@media (max-width: 760px) {
  .equipment-table tr { border-top-color: var(--line); }
  .equipment-table td::before { color: var(--muted); }
}

.login-wrapper {
  background:
    radial-gradient(900px 520px at 50% -10%, var(--bg-accent), transparent 68%),
    var(--bg);
}
.login-theme-toggle {
  position: fixed;
  z-index: 20;
  top: 18px;
  right: 18px;
}
.login-card { border-color: var(--line); background: var(--surface); box-shadow: var(--shadow-lg); }
.login-card .logo { color: var(--text); }
.logo-sub, .login-card .footer-note { color: var(--muted); }
.login-card .error { color: var(--danger); }

.copy-toast { border-color: var(--line-strong); background: var(--text); color: var(--surface); }
html[data-theme="dark"] .copy-toast { background: var(--surface-3); color: var(--text); }

html.edit-mode-off .card-actions,
html.edit-mode-off .folder-item-actions,
html.edit-mode-off .folder-add-button,
html.edit-mode-off #open-form-modal,
html.edit-mode-off .heading-actions .button-primary,
html.edit-mode-off .empty-cards .button-primary,
html.edit-mode-off .detail-title-row [data-form-url] {
  display: none !important;
}
html.edit-mode-off .equipment-card[draggable="true"],
html.edit-mode-off .folder-link[draggable="true"] { cursor: pointer; }

@media (max-width: 1180px) {
  .account-action { width: 34px; justify-content: center; padding: 0; }
  .account-action > span:last-child { display: none; }
}
@media (max-width: 900px) {
  .account-copy { display: none; }
  .edit-mode-label { display: none; }
}
@media (max-width: 760px) {
  .topbar { justify-content: space-between; }
  .account-menu { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
  .account-actions { border-left: 0; margin-left: 0; padding-left: 0; }
  .theme-toggle { width: 34px; height: 34px; }
  .edit-mode-toggle { min-height: 32px; padding: 0 8px; }
}
@media (max-width: 480px) {
  .account-menu { margin-left: auto; }
  .theme-toggle { width: 32px; height: 32px; }
  .edit-mode-toggle { gap: 5px; padding: 0 7px; }
}

/* ==== v3: layout limpo, fotos padronizadas e modo escuro neutro (2026-11-11) ==== */

/* Dark mode neutro (sem tinta azul) */
html[data-theme="dark"] {
  --bg: #0d0e10;
  --bg-accent: #17181b;
  --surface: #141518;
  --surface-2: #1a1b1f;
  --surface-3: #212328;
  --surface-raised: #1b1d21;
  --line: #2b2d33;
  --line-strong: #3b3e46;
  --text: #f2f3f5;
  --text-soft: #c3c6cc;
  --muted: #8d9199;
  --accent: #d7dbe2;
  --accent-strong: #f0f2f5;
  --accent-soft: #26282d;
  --accent-contrast: #121316;
  --danger: #ff7b72;
  --danger-soft: #2a1518;
  --success: #56d364;
  --success-soft: #0f2418;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45);
  --shadow-md: 0 12px 34px rgba(0, 0, 0, .42);
  --shadow-lg: 0 28px 90px rgba(0, 0, 0, .62);
  --ring: 0 0 0 3px rgba(215, 219, 226, .18);
}
html[data-theme="dark"] .brand-mark { background-color: #e8eaee; border-color: #3b3e46; }
html[data-theme="dark"] .view-switcher a.active { background: var(--accent); color: var(--accent-contrast); }

/* Performance: sem blur caro */
.topbar, .sidebar, .detail-modal::backdrop, .form-modal::backdrop, .folder-modal::backdrop {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.topbar { position: sticky; top: 0; z-index: 50; background: var(--surface) !important; }

/* Sidebar */
@media (min-width: 901px) {
  .workspace { grid-template-columns: 280px minmax(0, 1fr); align-items: start; }
  .sidebar {
    position: sticky;
    top: 74px;
    height: calc(100vh - 74px);
    min-height: 0;
    max-height: calc(100vh - 74px);
    padding: 22px 14px 18px;
    overflow-y: auto;
    border-right: 1px solid var(--line);
    background: var(--surface);
  }
}
.sidebar-title {
  gap: 8px;
  margin: 0 4px 12px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
}
.sidebar-title > span:first-child { margin-right: auto; }
.folder-total {
  min-width: 22px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
}
.folder-add-button {
  width: 26px;
  height: 26px;
  min-height: 26px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.folder-add-button:hover { border-color: var(--line-strong); background: var(--surface-3); color: var(--text); }
.sidebar-toggle-button { display: none !important; }
.sidebar nav { padding: 2px 0 8px; }
.folder-node { margin: 0; }
.folder-item { display: flex; align-items: center; gap: 2px; margin: 1px 0; border-radius: 8px; }
.folder-expander {
  width: 22px;
  height: 30px;
  flex: 0 0 22px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
}
.folder-expander:hover { background: var(--surface-2); color: var(--text); }
.folder-spacer { width: 22px; flex: 0 0 22px; }
.folder-link {
  min-width: 0;
  min-height: 34px;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 550;
  text-decoration: none;
}
.folder-link:hover { background: var(--surface-2); color: var(--text); }
.folder-link.selected {
  border-color: var(--line);
  background: var(--accent-soft);
  color: var(--text);
  box-shadow: inset 3px 0 0 var(--accent);
}
.folder-icon {
  width: 16px;
  height: 13px;
  flex: 0 0 16px;
  position: relative;
  display: inline-block;
  font-size: 0;
  color: transparent;
}
.folder-icon::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 10px;
  border-radius: 3px;
  background: var(--text-soft);
  opacity: .38;
}
.folder-icon::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 0;
  width: 8px;
  height: 5px;
  border-radius: 2px 2px 0 0;
  background: var(--text-soft);
  opacity: .38;
}
.folder-icon-child::before, .folder-icon-child::after { opacity: .24; }
.folder-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-count {
  min-width: 22px;
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  text-align: center;
}
.folder-children { margin-left: 12px; padding-left: 9px; border-left: 1px solid var(--line); }
.folder-item-actions { opacity: 1; }
.folder-edit-button { width: 26px; height: 26px; border-radius: 7px; }
.sidebar-foot { padding: 18px 8px 0; border-top: 1px solid var(--line); margin-top: 14px; }

/* Cards: título alinhado à esquerda, foto centralizada e consistente */
.equipment-grid { gap: 14px; padding: 16px; }
.equipment-card { border-radius: 14px; }
.card-title-line {
  justify-content: flex-start;
  align-items: center;
  gap: 7px;
  padding: 14px 14px 8px;
  text-align: left;
}
.card-title-line .equipment-name { text-align: left; }
.equipment-grid:not(.view-list) .card-photo,
.equipment-grid.view-list .card-photo {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  border: 0 !important;
  background: var(--surface-3) !important;
}
.equipment-grid:not(.view-list) .card-photo {
  height: 158px !important;
  margin: 0 12px !important;
  padding: 10px !important;
  border-radius: 12px !important;
}
.equipment-grid.view-list .card-photo {
  height: 92px !important;
  margin: 8px !important;
  padding: 6px !important;
  border-radius: 10px !important;
}
.equipment-grid .card-photo img {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  object-fit: contain !important;
  object-position: center center !important;
  border-radius: 8px !important;
  transform: none !important;
  mix-blend-mode: normal !important;
}
.card-pop-line { margin: 0 14px 10px; }

/* Modal: mesma moldura e centralização da foto */
.equipment-detail { grid-template-columns: minmax(260px, .9fr) minmax(0, 1.5fr) !important; align-items: start !important; }
.equipment-detail .detail-cover {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  align-self: start !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 18px !important;
  overflow: hidden !important;
  border-radius: 14px 0 0 14px !important;
  background: var(--surface-3) !important;
}
.equipment-detail .detail-cover img {
  width: 100% !important;
  height: 260px !important;
  min-height: 0 !important;
  max-height: 260px !important;
  position: static !important;
  display: block !important;
  object-fit: contain !important;
  object-position: center center !important;
  border-radius: 10px !important;
  mix-blend-mode: normal !important;
}
@media (max-width: 900px) {
  .equipment-grid:not(.view-list) .card-photo { height: 146px !important; }
  .equipment-detail .detail-cover img { height: 230px !important; max-height: 230px !important; }
}
@media (max-width: 760px) {
  .equipment-detail { grid-template-columns: 1fr !important; }
  .equipment-detail .detail-cover { border-radius: 14px 14px 0 0 !important; }
}
@media (max-width: 480px) {
  .equipment-grid:not(.view-list) .card-photo {
    height: 132px !important;
    margin: 0 10px !important;
    padding: 8px !important;
  }
  .equipment-detail .detail-cover { padding: 12px !important; }
  .equipment-detail .detail-cover img { height: 210px !important; max-height: 210px !important; }
}

/* ==== v4: formulário compacto e agrupado (2026-11-11) ==== */
.form-modal {
  width: min(1120px, calc(100vw - 32px)) !important;
  max-height: min(90dvh, 980px) !important;
}
.equip-form-scroll { max-height: calc(min(90dvh, 980px) - 116px) !important; }
.form-grid-compact { gap: 10px 12px !important; }
.form-section-title {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 0;
  padding: 10px 0 4px;
  border-top: 1px solid var(--line);
}
.form-section-title:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.form-section-title .section-index {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 800;
}
.form-section-title > div { display: grid; gap: 2px; min-width: 0; }
.form-section-title strong { color: var(--text); font-size: 12px; font-weight: 750; }
.form-section-title small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.form-section-title .button { margin-left: auto; flex: 0 0 auto; }
.span-2 { grid-column: span 2; }
.field-half { grid-column: span 1; }
.equip-form-embed .form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
.equip-form-embed .field-half { grid-column: span 2; }
.equip-form-embed .customer-network { grid-column: 1 / -1; }
.equip-form-embed .customer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.equip-form-embed .credential-row {
  grid-template-columns: minmax(110px, .7fr) minmax(150px, 1fr) minmax(150px, 1fr) 30px !important;
  gap: 8px !important;
  padding: 8px !important;
}
.equip-form-embed .ip-row {
  grid-template-columns: minmax(120px, .7fr) minmax(160px, 1.3fr) 30px !important;
  gap: 8px !important;
  padding: 8px !important;
}
.equip-form-embed .extra-new-row {
  grid-template-columns: repeat(4, minmax(0, 1fr)) 30px !important;
  gap: 7px !important;
  padding: 9px !important;
}
.equip-form-embed .extra-new-row .span-2 { grid-column: span 2; }
.equip-form-embed .extra-new-row .span-3 { grid-column: span 3; }
.equip-form-embed .input { min-height: 34px !important; padding: 6px 9px !important; font-size: 11.5px !important; }
.equip-form-embed .field label { margin-bottom: 4px !important; font-size: 10px !important; }
.equip-form-embed .field-help { margin-top: 3px !important; font-size: 9.5px !important; }
.equip-form-embed .textarea { min-height: 74px !important; }
.equip-form-embed .form-photo-preview { max-height: 130px !important; width: min(260px, 100%) !important; }
.equip-form-embed .photo-field { gap: 5px !important; }
.equip-form-embed .credential-heading { margin-bottom: 7px !important; }
.equip-form-embed .credential-heading > div { gap: 2px !important; }
.equip-form-embed .form-section-title { padding-top: 8px !important; }
.equip-form-embed .form-actions { margin-top: 14px !important; padding-top: 12px !important; }

@media (max-width: 760px) {
  .form-modal { width: calc(100vw - 12px) !important; max-height: 94dvh !important; }
  .equip-form-scroll { max-height: calc(94dvh - 110px) !important; }
  .span-2, .field-half { grid-column: 1 / -1; }
  .form-section-title { flex-wrap: wrap; }
  .equip-form-embed .form-grid { grid-template-columns: 1fr !important; }
  .equip-form-embed .customer-grid { grid-template-columns: 1fr !important; }
  .equip-form-embed .credential-row { grid-template-columns: 1fr !important; }
  .equip-form-embed .ip-row { grid-template-columns: 1fr !important; }
  .equip-form-embed .extra-new-row { grid-template-columns: 1fr 1fr !important; }
  .equip-form-embed .extra-new-row .span-2,
  .equip-form-embed .extra-new-row .span-3 { grid-column: span 2 !important; }
  .equip-form-embed .extra-new-row .remove-extra-new { grid-column: 2 !important; grid-row: auto !important; justify-self: end; }
}
@media (max-width: 480px) {
  .form-modal { width: 100vw !important; max-height: 100dvh !important; border-radius: 0 !important; }
  .equip-form-scroll { max-height: calc(100dvh - 108px) !important; }
}
