/* ==========================================================================
   layout.css: app shell. Suite bar, sidebar navigation, workspace,
   page header, and the sign-in layout. Views do not need these classes,
   except .page-header (rendered by _Layout) and .auth-* (by _AuthLayout).
   ========================================================================== */

/* Suite bar */
.skip-link { position: fixed; top: -80px; left: 12px; z-index: 100; padding: 10px; background: #fff; }
.skip-link:focus { top: 4px; }
.suite-bar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; height: var(--suite-height); background: var(--color-suite); background-image: var(--color-suite-gradient); border-bottom: 1px solid #16365f; color: #fff; }
.suite-button { display: grid; place-items: center; flex-shrink: 0; width: calc(var(--nav-padding-inline) * 2 + var(--nav-icon-size)); height: var(--suite-height); border: 0; background: none; color: #fff; }
.suite-button:hover { background: rgba(255, 255, 255, 0.1); }
.suite-button:focus-visible, .suite-account:focus-visible { outline-color: #fff; outline-offset: -4px; }
.suite-button svg { width: 21px; height: 21px; }
.suite-brand { display: flex; align-items: center; min-width: 0; padding-left: 8px; overflow: hidden; color: #fff; font-size: 15px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.suite-brand:hover { color: #fff; text-decoration: none; }
.suite-tag { margin-left: auto; padding: 0 16px; color: rgba(255, 255, 255, 0.78); font-size: 13px; white-space: nowrap; }
.suite-actions { position: relative; display: flex; align-items: center; height: var(--suite-height); min-width: 0; margin-left: auto; }
.suite-account { display: inline-flex; align-items: center; gap: 10px; height: var(--suite-height); padding: 0 15px; border: 0; background: transparent; color: #fff; transition: background-color .15s ease; }
.suite-account:hover, .suite-account[aria-expanded="true"] { background: rgba(255, 255, 255, 0.1); }
.suite-account > span:first-child { max-width: 220px; overflow: hidden; font-size: 13px; line-height: 20px; white-space: nowrap; text-overflow: ellipsis; }
.suite-account .avatar { width: 30px; height: 30px; background: #fff; border: 0; }
.suite-account .avatar svg { width: 17px; height: 17px; }

/* Account panel under the suite bar */
.account-panel { position: absolute; top: var(--suite-height); right: 0; z-index: 50; width: 264px; overflow: hidden; background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); border-top: 0; border-radius: 0 0 var(--bs-border-radius) var(--bs-border-radius); box-shadow: var(--shadow-md); transform-origin: top right; }
.account-panel-profile { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.account-panel-profile .avatar { width: 42px; height: 42px; }
.account-panel-profile .avatar svg { width: 22px; height: 22px; }
.account-panel-menu { margin: 0; padding: 4px 0; list-style: none; border-top: 1px solid var(--color-border); }
.account-panel-menu a, .account-panel-menu button { display: flex; align-items: center; width: 100%; min-height: 36px; padding: 8px 16px; border: 0; background: transparent; color: #323130; font-size: 13px; text-align: left; text-decoration: none; }
.account-panel-menu a:hover, .account-panel-menu button:hover { background: var(--color-pressed); color: var(--color-text); text-decoration: none; }
.account-panel-name { font-weight: 600; color: var(--color-text-strong); }
.fade-enter { transition: opacity .15s cubic-bezier(0.1, 0.9, 0.2, 1), transform .15s cubic-bezier(0.1, 0.9, 0.2, 1); }
.fade-leave { transition: opacity .1s ease-in, transform .1s ease-in; }
.fade-from { opacity: 0; transform: translateY(-4px) scale(0.98); }
.fade-to { opacity: 1; transform: none; }

/* Shell and sidebar */
.shell { display: grid; grid-template-columns: var(--nav-width) minmax(0, 1fr); min-height: calc(100dvh - var(--suite-height)); }
.shell.is-collapsed { grid-template-columns: var(--nav-compact-width) minmax(0, 1fr); }
.sidebar { position: sticky; top: var(--suite-height); display: flex; flex-direction: column; height: calc(100dvh - var(--suite-height)); padding: 0 0 16px; overflow-x: hidden; overflow-y: auto; background: var(--color-navigation); border-right: 1px solid #e8e8e8; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; height: 40px; padding: 0 var(--nav-padding-inline); border: 0; background: transparent; color: #323130; font-size: 14px; text-align: left; white-space: nowrap; }
.nav-item:hover { background: var(--color-pressed); color: var(--color-text); text-decoration: none; }
.nav-item > svg:first-child { width: var(--nav-icon-size); height: var(--nav-icon-size); }
.nav-item > .nav-label { overflow: hidden; text-overflow: ellipsis; }
.nav-item[aria-current="page"] { background: var(--color-pressed); color: var(--color-text); }
.nav-item[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--color-brand); }
.nav-chevron { width: 16px !important; height: 16px !important; margin-left: auto; transition: transform .15s ease; }
.nav-item[aria-expanded="true"] .nav-chevron { transform: rotate(180deg); }
.nav-group { position: relative; }
.nav-submenu { margin: 0; padding: 0 0 4px; list-style: none; }
.nav-submenu a { display: block; min-height: 34px; padding: 7px 14px 7px calc(var(--nav-padding-inline) + var(--nav-icon-size) + 12px); color: #323130; font-size: 13px; line-height: 1.35; text-decoration: none; }
.nav-submenu a:hover { background: var(--color-pressed); color: var(--color-text); text-decoration: none; }
.nav-submenu a[aria-current="page"] { position: relative; background: var(--color-pressed); color: var(--color-text); }
.nav-submenu a[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--color-brand); }
.nav-divider { height: 1px; margin: 12px var(--nav-padding-inline); background: #dedddd; }
.is-collapsed .nav-label { display: none; }
.sidebar-backdrop, .mobile-menu { display: none; }

/* Workspace */
.workspace { display: flex; flex-direction: column; min-width: 0; background: var(--color-canvas); }
.workspace.canvas-white { background: var(--color-surface); }
.workspace.canvas-gradient { background-color: #fafbfc; background-image: radial-gradient(900px 260px at 10% 0%, rgba(0, 120, 212, 0.045) 0%, transparent 70%), radial-gradient(800px 240px at 90% 0%, rgba(0, 164, 239, 0.035) 0%, transparent 68%), linear-gradient(180deg, #f3f8fe 0%, #f8fafd 150px, #fafbfc 320px, #fff 100%); background-repeat: no-repeat; }
.breadcrumb { display: flex; align-items: center; gap: 6px; padding: 14px 32px 0; color: var(--color-text-secondary); font-size: 13px; line-height: 18px; }
.breadcrumb a { color: var(--color-text-secondary); }
.breadcrumb [aria-current="page"] { color: var(--color-text); font-weight: 600; }
.breadcrumb > svg { width: 13px; height: 13px; color: var(--color-text-muted); }
.breadcrumb.is-empty { display: none; }
.workspace > main { flex: 1; width: 100%; padding: 8px 32px 32px; }
.breadcrumb.is-empty + main { padding-top: 24px; }
.workspace > main:focus { outline: 0; }

/* Page header (rendered by _Layout from ViewData Title/Subtitle) */
.page-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 19px; }
.page-title { margin: 0; font-size: 24px; line-height: 32px; }
.page-subtitle { margin: 3px 0 0; color: var(--color-text-secondary); font-size: 14px; line-height: 20px; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Collapsed sidebar on desktop: flyout labels and submenus on hover */
@media (min-width: 992px) {
  .is-collapsed .sidebar { z-index: 35; overflow: visible; }
  .is-collapsed .nav-item:not(.nav-toggle):hover,
  .is-collapsed .nav-group:hover > .nav-item,
  .is-collapsed .nav-group:focus-within > .nav-item { z-index: 36; width: var(--nav-width); background: #d2d0ce; box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.08); }
  .is-collapsed .nav-item:hover > .nav-label,
  .is-collapsed .nav-group:hover > .nav-item > .nav-label,
  .is-collapsed .nav-group:focus-within > .nav-item > .nav-label { display: inline; }
  .is-collapsed .nav-group > .nav-submenu { position: absolute; top: 40px; left: calc(var(--nav-compact-width) - 1px); z-index: 37; display: none !important; width: calc(var(--nav-width) - var(--nav-compact-width) + 1px); padding: 4px 0; background: var(--color-surface); border: 1px solid var(--color-border); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14); }
  .is-collapsed .nav-group:hover > .nav-submenu,
  .is-collapsed .nav-group:focus-within > .nav-submenu { display: block !important; }
  .is-collapsed .nav-submenu a { padding: 8px 16px; min-height: 36px; color: var(--color-text); white-space: nowrap; }
  .is-collapsed .nav-submenu a:hover { background: var(--color-hover); }
}
@media (max-width: 1199px) {
  :root { --nav-width: 208px; }
  .suite-brand { font-size: 14px; }
  .breadcrumb { padding: 12px 24px 0; }
  .workspace > main { padding: 8px 24px 24px; }
  .breadcrumb.is-empty + main { padding-top: 20px; }
}
@media (max-width: 991px) {
  .shell, .shell.is-collapsed { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: var(--suite-height); z-index: 35; width: 228px; transform: translateX(-100%); transition: transform .15s; }
  .sidebar.is-open { transform: none; }
  .is-collapsed .nav-label { display: revert; }
  .sidebar-backdrop { position: fixed; inset: var(--suite-height) 0 0; z-index: 34; display: block; border: 0; background: rgba(0, 0, 0, 0.3); }
  .mobile-menu { display: grid; place-items: center; width: 30px; height: 30px; margin-left: -5px; border: 0; background: transparent; color: #323130; }
  .mobile-menu svg { width: 17px; height: 17px; }
  .breadcrumb.is-empty { display: flex; }
  .suite-button { width: 44px; }
}
@media (max-width: 767px) {
  .suite-brand { padding: 0 8px; }
  .suite-account { gap: 8px; padding: 0 12px; }
  .suite-account > span:first-child { max-width: 140px; font-size: 12px; }
  .suite-account .avatar { width: 28px; height: 28px; }
  .account-panel { width: min(264px, calc(100vw - 12px)); }
  .breadcrumb { flex-wrap: wrap; padding: 10px 16px 0; }
  .workspace > main, .breadcrumb.is-empty + main { padding: 8px 16px 24px; }
  .page-header { align-items: flex-start; }
  .page-title { font-size: 22px; line-height: 28px; }
  .page-subtitle { font-size: 13px; }
}
@media (max-width: 479px) {
  .suite-account > span:first-child { max-width: 96px; font-size: 11px; }
}

/* ==========================================================================
   Sign-in layout (_AuthLayout): same suite bar, centered card on a soft canvas.
   Forms inside use normal Bootstrap classes (.form-control, .btn, .alert).
   ========================================================================== */
.auth-body { display: flex; flex-direction: column; min-height: 100dvh; background-color: #fafbfc; background-image: radial-gradient(900px 320px at 10% 0%, rgba(0, 120, 212, 0.06) 0%, transparent 70%), radial-gradient(800px 300px at 90% 0%, rgba(0, 164, 239, 0.05) 0%, transparent 68%), linear-gradient(180deg, #f3f8fe 0%, #f8fafd 240px, #fafbfc 480px, #fff 100%); background-repeat: no-repeat; }
.auth-body .suite-brand { padding-left: 16px; }
.auth-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 16px 32px; }
.auth-card { width: 100%; max-width: 440px; padding: 36px 40px 32px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 8px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06); }
.auth-card form { display: flex; flex-direction: column; gap: 16px; }
.auth-card .form-control { min-height: 36px; font-size: 14px; }
.auth-card .btn-primary { min-height: 36px; font-size: 14px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.auth-brand img { width: auto; height: 26px; }
.auth-brand span { padding-left: 12px; border-left: 1px solid var(--color-border); color: var(--color-text-secondary); font-size: 13px; font-weight: 600; }
.auth-title { margin-bottom: 6px; font-size: 24px; line-height: 32px; }
.auth-subtitle { margin-bottom: 24px; color: var(--color-text-secondary); }
.auth-identity { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; margin: -8px 0 20px; padding: 3px 12px 3px 3px; border: 1px solid var(--color-border); border-radius: 999px; font-size: 13px; }
.auth-identity .avatar { width: 24px; height: 24px; border: 0; }
.auth-identity .avatar svg { width: 14px; height: 14px; }
.auth-code { min-height: 44px !important; padding-left: calc(10px + 0.4em); font-family: var(--bs-font-monospace); font-size: 20px !important; font-weight: 600; letter-spacing: 0.4em; text-align: center; }
.auth-preview { margin-top: 20px; padding: 10px 12px; border: 1px dashed #c7c7c7; border-radius: var(--bs-border-radius); background: var(--color-canvas); color: var(--color-text-secondary); font-size: 12px; line-height: 18px; }
.auth-preview strong { color: var(--color-text); }
.auth-notice { display: flex; align-items: center; gap: 8px; max-width: 440px; margin-top: 20px; color: var(--color-text-secondary); font-size: 12px; line-height: 16px; }
.auth-notice svg { width: 16px; height: 16px; }
.auth-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; padding: 16px; color: var(--color-text-secondary); font-size: 12px; }
.auth-footer a { color: var(--color-text-secondary); }
.auth-footer a:hover { color: var(--color-text); }
.auth-back { display: inline-flex; align-items: center; gap: 6px; margin-top: 20px; font-size: 13px; }
.auth-back svg { width: 16px; height: 16px; }
@media (max-width: 520px) {
  .auth-main { justify-content: flex-start; padding: 24px 16px; }
  .auth-card { padding: 28px 20px 24px; }
  .auth-body .suite-tag { display: none; }
  .auth-title { font-size: 20px; line-height: 28px; }
}

/* EN / ID language switch in the suite bar, left of the signed-in user */
.lang-switch { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; margin-right: 8px; padding: 2px; border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 999px; }
.lang-switch + .suite-actions { margin-left: 0; }
.suite-tag + .lang-switch { margin-left: 0; margin-right: 12px; }
.lang-option { min-width: 34px; height: 24px; padding: 0 8px; border: 0; border-radius: 999px; background: transparent; color: rgba(255, 255, 255, 0.85); font-size: 12px; font-weight: 600; letter-spacing: .03em; cursor: pointer; }
.lang-option:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.lang-option[aria-pressed="true"] { background: #fff; color: var(--color-suite, #0a192f); }
.lang-option:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
