/* TEDY R556 · Emerald & gold · 2026-11-03
 * Presentation only. Load AFTER existing styles. No application/role overrides.
 * Keep original dashboard photographs and all operational scripts unchanged.
 */
@font-face {
  font-family: "Tedy Abyssinica";
  src: url("fonts/AbyssinicaSIL-Regular.woff") format("woff");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@media screen {
  html[data-m18-ui] {
    --r556-ink: #f5f2e8;
    --r556-muted: #b7c9be;
    --r556-gold: #efd28d;
    --r556-edge: rgba(216, 179, 102, .32);
    --r556-metal: linear-gradient(112deg, #b48739 0%, #ebc977 26%, #fff1bd 47%, #d4a94f 71%, #f5dda0 100%);
    --r556-serif: "Tedy Abyssinica", "Noto Serif Ethiopic", Georgia, serif;
    --m181-border: var(--r556-edge);
    --m182-border: var(--r556-edge);
    --m181-ink: var(--r556-ink);
    --m181-muted: var(--r556-muted);
    --m181-gold: var(--r556-gold);
    --m182-gold: var(--r556-gold);
    --m18-gold: var(--r556-gold);
    --m18-edge: var(--r556-edge);
    --text: var(--r556-ink);
    --muted: var(--r556-muted);
    --line: rgba(180, 205, 188, .16);
    --line2: var(--r556-edge);
    color-scheme: dark;
  }
  html[data-m18-ui] body {
    background: #041a13;
    color: var(--r556-ink);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
  }
  html[data-m18-ui] #app .app-shell {
    background: radial-gradient(ellipse at 83% 0%, rgba(39, 108, 74, .22), transparent 47%), #041a13;
  }
  html[data-m18-ui] #app #main {
    padding: 28px 30px 40px;
  }

  /* Navigation: generous Ethiopic lettering, fine metal details. */
  html[data-m18-ui] #app #sidebar {
    background: linear-gradient(165deg, #0c3023, #052218 44%, #041b13);
    border-right: 1px solid var(--r556-edge);
    padding: 20px 14px;
    scrollbar-color: #9d814c #06251a;
  }
  html[data-m18-ui] #app #sidebar .brand {
    padding: 4px 4px 23px;
    gap: 12px;
    border-bottom: 1px solid var(--r556-edge);
  }
  html[data-m18-ui] #app #sidebar .brand h1 {
    font-family: var(--r556-serif);
    font-size: 17px;
    font-weight: 400;
    line-height: 1.5;
    color: #f6dfa8;
  }
  html[data-m18-ui] #app #sidebar .brand small {
    font-size: 10px;
    line-height: 1.6;
    color: var(--r556-muted);
    opacity: .9;
  }
  html[data-m18-ui] #app #sidebar .nav-group-title {
    font-size: 12px;
    color: #bba777;
    letter-spacing: .02em;
    padding: 24px 14px 8px;
  }
  html[data-m18-ui] #app #sidebar .nav-btn {
    position: relative;
    min-height: 50px;
    margin: 3px 0;
    padding: 11px 14px;
    gap: 12px;
    border-radius: 12px;
    color: #e7eee5;
    border: 1px solid transparent;
    background: transparent;
    box-shadow: none;
    text-align: start;
    transition: background-color .16s, border-color .16s;
  }
  html[data-m18-ui] #app #sidebar .nav-btn .label {
    font-family: var(--r556-serif);
    font-size: 17px !important;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0;
    white-space: normal;
  }
  html[data-m18-ui] #app #sidebar .nav-btn .ico {
    width: 24px;
    flex: 0 0 24px;
    color: #dabb79;
    font-size: 21px;
    text-align: center;
  }
  html[data-m18-ui] #app #sidebar .nav-btn.active {
    background: linear-gradient(110deg, rgba(226, 189, 109, .17), rgba(25, 75, 52, .3));
    border-color: rgba(231, 196, 118, .48);
    color: #fff0c9;
    box-shadow: inset 3px 0 #e8c478, inset 0 1px rgba(255, 238, 192, .08);
  }
  html[data-m18-ui] #app #sidebar .sidebar-footer {
    background: transparent !important;
    box-shadow: none !important;
    padding: 18px 12px 6px;
    line-height: 1.7;
    font-size: 13px;
  }

  /* Compact header leaves space for the working dashboard. */
  html[data-m18-ui] #app .topbar {
    background: #06231a;
    min-height: 74px;
    padding: 12px 28px;
    gap: 16px;
    border-bottom: 1px solid var(--r556-edge);
    box-shadow: 0 6px 22px rgba(0, 0, 0, .12);
    backdrop-filter: none;
  }
  html[data-m18-ui] #app .topbar .branch-context-m6 {
    flex: 0 1 350px;
    max-width: 37%;
  }
  html[data-m18-ui] #app .topbar .topbar-title h2 {
    font-family: var(--r556-serif);
    font-size: 21px;
    font-weight: 400;
    line-height: 1.5;
    color: #f4e7c5;
  }
  html[data-m18-ui] #app .topbar :is(#globalBranch, .tedy-m16-branch-label),
  html[data-m18-ui] #app .m18-language-slot select {
    background: #0a2f22 !important;
    color: #ececdb !important;
    border-color: var(--r556-edge) !important;
    font-size: 13px !important;
    min-height: 44px !important;
  }
  html[data-m18-ui] #app .avatar {
    background: var(--r556-metal);
    color: #18251a;
    font-weight: 700;
    box-shadow: inset 0 1px 1px #fff0bd, 0 3px 12px #0003;
  }

  /* Owner's existing image remains untouched, uncropped and prominent. */
  html[data-m18-ui] #app #main.m18-owner-dashboard {
    padding-top: 28px !important;
  }
  html[data-m18-ui] #app #main.m18-owner-dashboard .m18-welcome {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, .95fr);
    grid-template-rows: auto auto auto 1fr auto;
    align-items: center;
    gap: 12px 32px;
    min-height: 360px;
    padding: 28px 32px;
    margin: 0 0 24px;
    border: 1px solid var(--r556-edge);
    border-radius: 22px;
    background: radial-gradient(ellipse at 22% 0%, #20583b66, transparent 65%), linear-gradient(130deg, #0d3727, #06231a);
    box-shadow: inset 0 1px #ffefb812, 0 14px 30px #0002;
  }
  html[data-m18-ui] #app #main .m18-clock {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    font-size: 12px;
    margin: 0;
    border-color: var(--r556-edge);
    box-shadow: none;
  }
  html[data-m18-ui] #app #main .m18-brand-symbol {
    grid-column: 1;
    grid-row: 2;
    height: 64px;
    margin: 4px 0 0;
  }
  html[data-m18-ui] #app #main.m18-owner-dashboard .m18-brand-title {
    grid-column: 1;
    grid-row: 3;
    font-family: var(--r556-serif);
    font-size: clamp(24px, 2.6vw, 38px) !important;
    font-weight: 400;
    line-height: 1.5 !important;
    margin: 0;
    text-align: start;
    text-shadow: none;
  }
  html[data-m18-ui] #app #main .m18-line {
    grid-column: 1;
    grid-row: 4;
    width: 100%;
    background: linear-gradient(90deg, #ecd08b, #b08c44 65%, transparent);
  }
  html[data-m18-ui] #app #main.m18-owner-dashboard .m18-photo {
    grid-column: 2;
    grid-row: 1 / 6;
    width: 100%;
    max-width: 430px;
    max-height: 390px;
    height: auto;
    aspect-ratio: auto;
    margin: 0 auto;
    border: 1px solid #ddbb74;
    border-radius: 15px;
    background: #061d15;
    box-shadow: 0 0 0 5px #f1cb7110, 0 14px 26px #0003;
  }
  html[data-m18-ui] #app #main .m18-photo img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 390px;
    object-fit: contain !important;
    object-position: center;
  }
  html[data-m18-ui] #app #main .m18-scroll-tip {
    grid-column: 1;
    grid-row: 5;
    justify-self: start;
    min-height: 44px;
    width: 44px;
    border: 1px solid var(--r556-edge);
    border-radius: 50%;
  }

  /* Staff branding reuses the original child photo, without revealing owner content. */
  html[data-m18-ui] #app #main .m181-staff-brand {
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr) minmax(210px, 37%);
    gap: 20px;
    min-height: 220px;
    padding: 25px 28px;
    margin-bottom: 24px;
    border-radius: 22px;
    border-color: var(--r556-edge) !important;
    background: radial-gradient(ellipse at 15% 0%, #286c4555, transparent 66%), linear-gradient(120deg, #0c3626, #06241b) !important;
    box-shadow: inset 0 1px #ffedb51a, 0 12px 28px #0002 !important;
  }
  html[data-m18-ui] #app #main .m181-staff-brand h2 {
    font-family: var(--r556-serif);
    font-size: clamp(23px, 2.2vw, 32px);
    font-weight: 400;
    line-height: 1.6;
  }
  html[data-m18-ui] #app #main .m181-staff-brand h2 span {
    font-size: .8em;
    margin-top: 6px;
  }
  html[data-m18-ui] #app #main .m181-staff-brand::after {
    content: "";
    width: 100%;
    aspect-ratio: 3 / 2;
    background: #08281d url("dashboard-hero-r5.webp") center / contain no-repeat;
    border: 1px solid #d9b66e;
    border-radius: 13px;
    box-shadow: 0 0 0 5px #ebc87710, 0 10px 22px #0003;
    pointer-events: none;
  }

  /* Cards use responsive number sizing; no content is concealed. */
  html[data-m18-ui] #app #main :is(.card, .ctrl-card, .ctrl-panel, .panel, .kpi, .ctrl-kpi, .product-card) {
    background-color: #0a2b20 !important;
    background-image: linear-gradient(145deg, #103828, #08281e) !important;
    border-color: var(--r556-edge) !important;
    border-radius: 16px !important;
    box-shadow: inset 0 1px #e8d2990a, 0 7px 20px #0002;
  }
  html[data-m18-ui] #app #main .ctrl-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 16px;
    margin: 0 0 24px;
  }
  html[data-m18-ui] #app #main :is(.ctrl-kpi, .kpi) {
    container-type: inline-size;
    min-height: 140px;
    padding: 20px;
  }
  html[data-m18-ui] #app #main .ctrl-kpi::after {
    width: 70px;
    height: 70px;
    right: -26px;
    top: -26px;
    background: transparent;
    border: 1px solid #d7b87533;
    box-shadow: 0 0 0 12px #d7b87507;
    pointer-events: none;
  }
  html[data-m18-ui] #app #main :is(.ctrl-kpi > span, .kpi-label) {
    font-size: 14px !important;
    font-weight: 500;
    line-height: 1.5;
    color: #d8e2d5;
    min-height: 22px;
  }
  html[data-m18-ui] #app #main :is(.ctrl-kpi > b, .kpi-value, .ctrl-value) {
    font-family: "Noto Sans", system-ui, sans-serif;
    font-size: 25px !important;
    font-size: clamp(18px, 7.6cqi, 32px) !important;
    line-height: 1.35 !important;
    font-weight: 650;
    letter-spacing: -.035em;
    font-variant-numeric: tabular-nums;
    color: #f1d697 !important;
    margin: 12px 0 7px;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: anywhere !important;
    text-overflow: clip !important;
    overflow: visible !important;
  }
  html[data-m18-ui] #app #main :is(.ctrl-kpi > small, .kpi-note) {
    font-size: 12px !important;
    line-height: 1.6;
    color: var(--r556-muted) !important;
  }
  html[data-m18-ui] #app #main .ctrl-kpi.warn {
    border-color: #d8b36399 !important;
  }
  html[data-m18-ui] #app #main .ctrl-quick-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 24px;
  }
  html[data-m18-ui] #app #main .ctrl-quick-grid button {
    display: flex;
    align-items: center;
    justify-content: start;
    gap: 14px;
    min-height: 76px;
    padding: 14px 20px;
    border-radius: 13px;
    border-color: var(--r556-edge);
    background: #0c3023;
    box-shadow: none;
  }
  html[data-m18-ui] #app #main .ctrl-quick-grid i {
    width: 36px;
    font-size: 26px;
    margin: 0;
  }
  html[data-m18-ui] #app #main .ctrl-quick-grid b {
    font-family: var(--r556-serif);
    font-size: 17px;
    font-weight: 400;
    line-height: 1.4;
    text-align: start;
  }
  html[data-m18-ui] #app #main :is(.card h2, .card h3, .page-head h1) {
    font-family: var(--r556-serif);
    font-weight: 400;
    line-height: 1.5;
    color: #efd7a1;
  }
  html[data-m18-ui] #app #main .ctrl-dashboard-panels {
    gap: 20px;
  }
  html[data-m18-ui] #app #main .ctrl-card-head {
    flex-wrap: wrap;
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid #c5ad7829;
  }
  html[data-m18-ui] #app #main .ctrl-alert-list span {
    font-size: 14px;
    padding: 15px;
    border-color: #b8a77833;
    border-radius: 10px;
  }

  /* Fine gold highlights are CSS gradients, with no animated video/canvas. */
  @supports (background-clip: text) {
    html[data-m18-ui] #app #main :is(.m18-brand-title, .m181-staff-brand h2),
    html[data-m18-ui] #app #sidebar .brand h1,
    html[data-m18-ui] #app #sidebar .nav-btn.active .ico {
      background: var(--r556-metal);
      background-clip: text;
      -webkit-background-clip: text;
      color: transparent !important;
      -webkit-text-fill-color: transparent;
    }
  }
  html[data-m18-ui] #app #main :is(.btn, button),
  html[data-m18-ui] #modalRoot :is(.btn, button) {
    min-height: 42px;
    line-height: 1.5;
  }
  html[data-m18-ui] #app #main :is(.btn.gold, .btn.primary, button.primary):not(.danger):not(:disabled),
  html[data-m18-ui] #modalRoot :is(.btn.gold, .btn.primary):not(.danger):not(:disabled) {
    background: var(--r556-metal) !important;
    color: #18271a !important;
    border: 1px solid #eccb81 !important;
    box-shadow: inset 0 1px #fff2c7, 0 3px 10px #0002;
    font-weight: 700;
  }
  html[data-m18-ui] #app :is(button, input, select, textarea, a):focus-visible,
  html[data-m18-ui] #modalRoot :is(button, input, select, textarea, a):focus-visible {
    outline: 2px solid #ffdfa0 !important;
    outline-offset: 3px;
  }
  html[data-m18-ui] #app #main :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea),
  html[data-m18-ui] #modalRoot :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    background: #06261b !important;
    color: #f2f3e7 !important;
    border-color: #a28e5e99 !important;
    min-height: 44px;
    line-height: 1.5;
  }
  html[data-m18-ui] #app #main :is(th, td) {
    padding: 13px 15px;
    line-height: 1.6;
    font-size: 13px;
    border-color: #b2a16f26 !important;
  }
  html[data-m18-ui] #app #main th {
    background: #123b2a !important;
    color: #ead5a5 !important;
    font-weight: 600;
  }
  html[data-m18-ui] #app #main :is(.table-wrap, .tf-r526-tablewrap, .r414-table-wide) {
    scrollbar-color: #aa8a4e #072a1d;
  }
  html[data-m18-ui] #app .mobile-bottom {
    background: #06271b;
    border-top: 1px solid var(--r556-edge);
  }
  html[data-m18-ui] #app .mobile-bottom button.active {
    color: #ffe1a0;
    background: #d0aa5414;
  }
  @media (hover: hover) {
    html[data-m18-ui] #app #sidebar .nav-btn:hover {
      background-color: #e5c6770e;
      border-color: #dfbc7352;
    }
    html[data-m18-ui] #app #main .ctrl-quick-grid button:hover {
      background: #154531;
      border-color: #d8b46a;
      transform: none;
    }
    html[data-m18-ui] #app #main .btn:not(:disabled):hover {
      box-shadow: inset 0 1px #fff2c740, 0 0 0 2px #e9bd5b15;
    }
    html[data-m18-ui] #app #main tbody tr:hover {
      background-color: #c8ad6710;
    }
  }
  @media (max-width: 1100px) {
    html[data-m18-ui] #app #main { padding: 20px; }
    html[data-m18-ui] #app #main .m181-staff-brand { grid-template-columns: 48px minmax(0, 1fr) 32%; padding: 22px; gap: 16px; }
    html[data-m18-ui] #app #main.m18-owner-dashboard .m18-welcome { padding: 24px; gap: 10px 22px; }
  }
  @media (min-width: 901px) {
    html[data-m18-ui] #app .topbar > .branch-context-m6 { flex: 0 1 300px !important; max-width: 36% !important; }
    html[data-m18-ui] #app .topbar .m18-language-slot { flex: 0 0 94px !important; width: 94px !important; max-width: 94px !important; }
    html[data-m18-ui] #app .topbar .m18-language-slot select { box-sizing: border-box !important; min-width: 0 !important; width: 100% !important; max-width: 100% !important; }
  }
  @media (max-width: 900px) {
    html[data-m18-ui] #app #main { padding: 20px 18px 100px; }
    html[data-m18-ui] #app #sidebar { padding: max(20px, env(safe-area-inset-top)) 14px 30px; }
    html[data-m18-ui] #app #sidebar .nav-btn .label { font-size: 18px !important; }
    html[data-m18-ui] #app .topbar { gap: 7px !important; padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px !important; }
    html[data-m18-ui] #app .topbar .menu-toggle { width: 44px !important; min-width: 44px !important; }
    html[data-m18-ui] #app .topbar .m18-language-slot select { font-size: 12px !important; }
    html[data-m18-ui] #app #main .ctrl-kpi-grid { gap: 12px; }
    html[data-m18-ui] #app #main :is(.ctrl-kpi, .kpi) { padding: 16px; }
    html[data-m18-ui] #app #main :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea),
    html[data-m18-ui] #modalRoot :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) { font-size: 16px !important; }
  }
  @media (max-width: 650px) {
    html[data-m18-ui] #app #main { padding: 16px 14px 100px; }
    html[data-m18-ui] #app #main.m18-owner-dashboard { padding-top: 16px !important; }
    html[data-m18-ui] #app #main .m181-staff-brand {
      grid-template-columns: 44px minmax(0, 1fr); padding: 22px; gap: 15px; min-height: 0;
    }
    html[data-m18-ui] #app #main .m181-staff-brand > img { width: 44px; height: 44px; }
    html[data-m18-ui] #app #main .m181-staff-brand h2 { font-size: 23px; line-height: 1.45; }
    html[data-m18-ui] #app #main .m181-staff-brand::after { grid-column: 1 / -1; max-width: 440px; margin: 3px auto 0; }
    html[data-m18-ui] #app #main.m18-owner-dashboard .m18-welcome { display: flex; min-height: 0; padding: 24px 20px; gap: 16px; }
    html[data-m18-ui] #app #main .m18-clock { align-self: center; }
    html[data-m18-ui] #app #main .m18-brand-symbol { height: 54px; }
    html[data-m18-ui] #app #main.m18-owner-dashboard .m18-brand-title { font-size: 27px !important; text-align: center; }
    html[data-m18-ui] #app #main .m18-line { height: 1px; }
    html[data-m18-ui] #app #main.m18-owner-dashboard .m18-photo { width: 100%; max-width: 390px; }
    html[data-m18-ui] #app #main .ctrl-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    html[data-m18-ui] #app #main .ctrl-kpi-grid > :is(:first-child, :last-child) { grid-column: 1 / -1; }
    html[data-m18-ui] #app #main :is(.ctrl-kpi, .kpi) { min-height: 132px; padding: 18px; }
    html[data-m18-ui] #app #main .ctrl-quick-grid { gap: 9px; }
    html[data-m18-ui] #app #main .ctrl-quick-grid button { flex-direction: column; justify-content: center; padding: 12px 7px; gap: 6px; min-height: 97px; }
    html[data-m18-ui] #app #main .ctrl-quick-grid b { font-size: 15px; text-align: center; }
    html[data-m18-ui] #app #main .ctrl-dashboard-panels { grid-template-columns: minmax(0, 1fr); }
  }
  @media (max-width: 360px) {
    html[data-m18-ui] #app #main { padding-inline: 10px; }
    html[data-m18-ui] #app #main .m181-staff-brand { padding: 16px; gap: 10px; }
    html[data-m18-ui] #app #main .m181-staff-brand h2 { font-size: 21px; }
    html[data-m18-ui] #app #main .ctrl-kpi-grid { grid-template-columns: minmax(0, 1fr) !important; }
    html[data-m18-ui] #app #main .ctrl-quick-grid { grid-template-columns: minmax(0, 1fr); }
    html[data-m18-ui] #app #main .ctrl-quick-grid button { flex-direction: row; justify-content: start; min-height: 60px; padding: 12px 18px; }
  }
  @media (prefers-reduced-motion: reduce) {
    html[data-m18-ui] #app :is(.nav-btn, .btn, .ctrl-quick-grid button, #sidebar, .m18-menu-shade) { animation: none !important; transition: none !important; }
  }
  @media (forced-colors: active) {
    html[data-m18-ui] #app #main :is(.m18-brand-title, .m181-staff-brand h2),
    html[data-m18-ui] #app #sidebar :is(.brand h1, .nav-btn.active .ico) {
      background: none; color: CanvasText !important; -webkit-text-fill-color: CanvasText;
    }
  }
}
