/* Accly's refined visual layer. Keep app behavior and layout primitives in styles.css. */
:root {
  --ink: #1b2925;
  --muted: #687872;
  --line: #e3eae6;
  --surface: #ffffff;
  --canvas: #f4f7f5;
  --green: #19765f;
  --green-dark: #145f4c;
  --green-pale: #e8f4ee;
  --shadow: 0 18px 48px rgb(28 50 41 / 8%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  color: var(--ink);
  background: var(--canvas);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgb(25 118 95 / 24%);
  outline-offset: 2px;
}

.sidebar {
  width: 264px;
  flex-basis: 264px;
  height: 100dvh;
  background: #fbfcfb;
  padding: 27px 17px 18px;
}

.brand { margin-bottom: 35px; color: #1a3129; }
.brand-mark { box-shadow: 0 4px 10px rgb(25 118 95 / 22%); }
.workspace-label, .sidebar-section-title { color: #87958f; }
.nav-item { min-height: 42px; border-radius: 10px; color: #586a63; font-size: 13px; }
.nav-item:hover { background: #f0f5f2; }
.nav-item.active { background: #e8f3ed; color: #155f4b; }
.nav-icon { display: inline-grid; place-items: center; width: 20px; height: 20px; }
.nav-icon svg { width: 18px; height: 18px; }
.nav-count { color: #63746d; background: #fff; border-color: #dfe8e2; }
.privacy-card { background: #f2f7f3; border-color: #e6eee8; border-radius: 12px; padding: 13px 12px; }
.privacy-card strong, .profile strong { color: #293a33; font-size: 12px; }
.privacy-card small, .profile small { color: #73817a; font-size: 11px; }

.topbar {
  height: 72px;
  padding-inline: clamp(26px, 4.1vw, 64px);
  background: rgb(255 255 255 / 92%);
  border-color: #e6ece8;
}
.breadcrumbs { color: #718079; font-size: 13px; }
.breadcrumbs strong { color: #263831; }
.icon-button, .mobile-menu { width: 38px; height: 38px; border-radius: 11px; font-size: 17px; }
.icon-button svg, .mobile-menu svg { width: 18px; height: 18px; vertical-align: middle; }
.top-avatar { width: 34px; height: 34px; background: #e4f1e9; color: #17684f; }
.cloud-auth-button {
  min-height: 38px;
  max-width: min(260px, 36vw);
  padding: 0 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid #dce8e0;
  border-radius: 11px;
  background: #fff;
  color: #245f4c;
  font-size: 12px;
  font-weight: 650;
  transition: background .15s ease, border-color .15s ease;
}
.cloud-auth-button:hover:not(:disabled) { background: #f2f7f3; border-color: #bfd7c9; }
.cloud-auth-button:disabled { color: #88948e; cursor: not-allowed; background: #f7f9f7; }
.cloud-auth-button.is-signed-in { color: #53665d; }
.cloud-error { color: #b44e49 !important; }
.privacy-card small { display: block; max-width: 178px; overflow-wrap: anywhere; }

.content { max-width: 1500px; padding: 40px clamp(26px, 4.1vw, 64px) 72px; }
.page-heading { margin-bottom: 28px; }
.page-heading h1 { color: #1b2b25; font-size: 34px; letter-spacing: -1.15px; margin: 8px 0 8px; }
.page-heading p { color: #697a72; font-size: 14px; }
.eyebrow { color: #537e6b; font-size: 10px; letter-spacing: 1.4px; }
.button { min-height: 40px; padding: 10px 16px; border-radius: 10px; font-size: 13px; }
.button.primary { background: #19765f; box-shadow: 0 5px 14px rgb(25 118 95 / 18%); }
.button.primary:hover { background: #145f4c; box-shadow: 0 7px 18px rgb(25 118 95 / 23%); }
.button.ghost { border-color: #dfe8e3; color: #43564d; }
.button.ghost:hover { background: #f3f7f4; }

.sample-note { border-radius: 12px; padding: 12px 15px; font-size: 12px; }
.overview-grid { gap: 16px; margin-bottom: 25px; }
.metric-card {
  min-height: 126px;
  padding: 18px 19px;
  border: 1px solid #e4ebe6;
  border-radius: 15px;
  box-shadow: 0 4px 14px rgb(28 50 41 / 3%);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.metric-card:hover { transform: translateY(-2px); border-color: #c9ded1; box-shadow: 0 9px 24px rgb(28 50 41 / 7%); }
.metric-top { color: #687970; font-size: 12px; }
.metric-icon { width: 31px; height: 31px; border-radius: 10px; background: #edf5f0; color: #28765f; font-size: 16px; }
.metric-value { color: #20342b; font-size: 29px; letter-spacing: -1px; margin-top: 12px; }
.metric-foot { color: #74827c; font-size: 11px; margin-top: 3px; }
.metric-value .currency-total { color: #34483e; font-size: 13px; line-height: 1.4; }

.section-card, .settings-card, .detail-main, .detail-aside, .directory-card {
  border-color: #e3eae6;
  border-radius: 15px;
  box-shadow: 0 4px 16px rgb(28 50 41 / 3%);
}
.list-toolbar { gap: 11px; padding: 18px 20px; }
.search-box { max-width: 390px; }
.search-box span { top: 9px; color: #708078; }
.search-box input, .filter-select { height: 40px; border-color: #dfe7e2; border-radius: 10px; color: #43564d; font-size: 12px; background: #fff; }
.search-box input { font-size: 13px; }
.search-box input::placeholder { color: #87938d; }
.filter-select { padding-left: 12px; }
.result-count { color: #65766e; font-size: 12px; }
.account-table { min-width: 850px; }
.account-table th { height: 44px; background: #f8faf8; color: #74837b; font-size: 10px; letter-spacing: .75px; padding-inline: 18px; }
.account-table td { padding: 15px 18px; border-color: #edf1ee; color: #42534b; font-size: 12px; }
.account-table tbody tr:hover { background: #f7faf8; }
.service-cell { gap: 12px; min-width: 190px; }
.service-logo { width: 38px; height: 38px; border-radius: 12px; font-size: 13px; }
.service-cell strong { color: #263831; font-size: 13px; }
.service-cell small { color: #718078; font-size: 11px; }
.identity-pills, .payment-pills { gap: 5px; max-width: 210px; }
.mini-pill { border-radius: 6px; padding: 4px 7px; font-size: 10px; color: #5e7067; }
.status { padding: 5px 9px; font-size: 10px; }
.status:before { width: 6px; height: 6px; }
.category-chip, .renewal { color: #5d6f66; font-size: 11px; }
.list-summary { padding: 14px 20px; color: #6e7c75; font-size: 12px; background: #fbfcfb; }
.empty-state { padding: 70px 20px; }
.empty-state h3 { color: #273a31; font-size: 17px; }
.empty-state p { color: #6f7e76; font-size: 13px; line-height: 1.6; }

.directory-grid { gap: 16px; }
.directory-card { min-height: 165px; padding: 20px; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.directory-card:hover { border-color: #b9d6c7; transform: translateY(-2px); box-shadow: 0 10px 25px rgb(28 50 41 / 8%); }
.directory-card h3 { color: #273a31; font-size: 14px; overflow-wrap: anywhere; }
.directory-card p { color: #708078; font-size: 11px; }
.directory-meta span { border-radius: 6px; color: #5f7068; font-size: 10px; }
.directory-empty { border-color: #e3eae6; border-radius: 15px; padding: 36px; color: #687970; font-size: 13px; }

.settings-card { padding: 24px; }
.settings-card h2 { color: #273a31; font-size: 16px; }
.settings-card > p { color: #6f7e76; font-size: 12px; }
.setting-row { gap: 18px; padding: 15px 0; }
.setting-row strong { color: #304239; font-size: 12px; }
.setting-row small { color: #718078; font-size: 11px; line-height: 1.55; }
.setting-row .button { font-size: 11px; }
.language-select { min-width: 148px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); }
.privacy-warning { border-radius: 11px; padding: 15px; font-size: 11px; }

.modal { border-radius: 18px; }
.modal form { padding: 28px 30px; }
.modal-header { margin-bottom: 24px; }
.modal-header h2 { color: #20342b; font-size: 23px; }
.form-grid { gap: 16px 14px; }
.form-grid label, .small-modal label { color: #46584f; font-size: 11px; }
.form-grid input, .form-grid select, .form-grid textarea, .small-modal input { min-height: 40px; border-color: #dfe7e2; border-radius: 9px; background: #fff; color: #263831; font-size: 13px; }
.form-grid input::placeholder, .form-grid textarea::placeholder, .small-modal input::placeholder { color: #8a9690; }
.hint { color: #73817a; font-size: 10px; line-height: 1.4; }
.section-divider { color: #6f8177; font-size: 10px; }
.form-error { font-size: 12px; }
.confirm-modal h2 { color: #263831; font-size: 20px; }
.confirm-modal p { color: #6e7c75; font-size: 12px; line-height: 1.55; }
.toast { border-radius: 11px; padding: 12px 17px; font-size: 12px; }

.detail-layout { gap: 18px; }
.detail-main, .detail-aside { padding: 24px; }
.detail-title-row .service-logo { width: 54px; height: 54px; border-radius: 15px; }
.detail-title-row h2 { color: #24372e; font-size: 21px; }
.detail-title-row a { font-size: 12px; }
.detail-section h3 { color: #6e7d75; font-size: 11px; }
.detail-kv label { color: #728078; font-size: 10px; }
.detail-kv strong, .detail-kv p { color: #35473e; font-size: 12px; line-height: 1.6; }
.linked-link { border-color: #e1e9e4; background: #f7faf8; border-radius: 8px; color: #43584d; font-size: 11px; }
.detail-aside h3 { color: #2d4036; font-size: 13px; }
.aside-stat { color: #687970; font-size: 11px; }
.aside-stat strong { color: #34483e; font-size: 11px; }

.suggestion-wrap { position: relative; width: 100%; }
.suggestion-wrap > input { width: 100%; }
.suggestion-list { position: absolute; inset: calc(100% + 5px) 0 auto; z-index: 30; display: grid; max-height: 230px; overflow-y: auto; padding: 4px; border: 1px solid #dfe8e2; border-radius: 10px; background: #fff; box-shadow: 0 12px 28px #1c32251a; }
.suggestion-list[hidden] { display: none; }
.suggestion-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; border: 0; border-radius: 7px; padding: 9px 10px; background: #fff; text-align: left; }
.suggestion-option:hover, .suggestion-option:focus-visible { outline: 0; background: #f1f7f3; }
.suggestion-option strong, .suggestion-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggestion-option strong { color: #31443a; font-size: 12px; font-weight: 600; }
.suggestion-option small { margin-top: 2px; color: #88958f; font-size: 10px; }
.suggestion-add { color: #3c8b70; font-size: 18px; }
.suggestion-empty { padding: 10px; color: #8b9791; font-size: 11px; }
.field-label { display: block; }
.suggestion-control { position: relative; width: 100%; }
.suggestion-control > input { padding-right: 38px !important; }
.suggestion-toggle { position: absolute; top: 50%; right: 7px; transform: translateY(-50%); display: grid; place-items: center; width: 27px; height: 27px; border: 0; border-radius: 6px; background: transparent; color: #788780; font-size: 19px; line-height: 1; }
.suggestion-toggle:hover, .suggestion-toggle:focus-visible { background: #eef5f1; outline: 0; }
.directory-card-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.directory-card-actions .button { padding: 6px 9px; font-size: 10px; }
.directory-card-actions .directory-meta { margin: 0 0 0 auto; }
.button:disabled { cursor: not-allowed; opacity: .48; transform: none !important; }

@media (max-width: 1100px) {
  .sidebar { width: 232px; flex-basis: 232px; }
  .content { padding-inline: 30px; }
}

@media (max-width: 760px) {
  .sidebar { width: 272px; }
  .topbar { height: 62px; padding-inline: 15px; }
  .content { padding: 28px 15px 48px; }
  .page-heading { gap: 14px; margin-bottom: 22px; }
  .page-heading h1 { font-size: 28px; }
  .cloud-auth-button { max-width: 140px; padding: 0 10px; font-size: 11px; }
  .page-heading p { font-size: 13px; line-height: 1.55; }
  .page-tools { gap: 8px; }
  .page-tools .button { min-height: 40px; }
  .overview-grid { gap: 10px; margin-bottom: 19px; }
  .metric-card { min-height: 112px; padding: 14px; border-radius: 13px; }
  .metric-top { font-size: 11px; }
  .metric-value { font-size: 25px; }
  .metric-foot { font-size: 10px; line-height: 1.4; }
  .list-toolbar { gap: 9px; padding: 13px; }
  .search-box input, .filter-select { height: 40px; }
  .directory-card { min-height: 150px; }
  .settings-card { padding: 18px; }
  .setting-row { align-items: flex-start; }
  .setting-row .button { flex-shrink: 0; }
  .detail-main, .detail-aside { padding: 17px; }
}

@media (max-width: 390px) {
  .page-tools { width: 100%; }
  .page-tools .button { padding-inline: 10px; font-size: 12px; }
  .overview-grid { gap: 8px; }
  .metric-card { padding: 12px; }
  .metric-value .currency-total { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

#account-modal {
  width: min(760px, calc(100% - 32px));
  max-height: min(92vh, 960px);
  background: #fff;
}
#account-modal form { padding: 32px 36px 28px; }
#account-modal .modal-header {
  align-items: center;
  margin-bottom: 26px;
  padding-bottom: 18px;
  border-bottom: 1px solid #edf2ef;
}
#account-modal .modal-header h2 {
  margin: 0;
  color: #20342b;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -.8px;
}
#account-modal .close-button { width: 38px; height: 38px; border-radius: 10px; font-size: 24px; }
#account-modal .form-grid { gap: 19px 16px; }
#account-modal .form-grid label { gap: 7px; color: #40564b; font-size: 12px; }
#account-modal .form-grid input,
#account-modal .form-grid select,
#account-modal .form-grid textarea {
  min-height: 46px;
  padding: 11px 13px;
  border-color: #dce7e0;
  border-radius: 10px;
  font-size: 14px;
}
#account-modal .form-grid textarea { min-height: 96px; }
#account-modal .hint { color: #718078; font-size: 11px; line-height: 1.45; }
#account-modal .section-divider { margin-top: 4px; padding-top: 15px; font-size: 10px; }
#account-modal .suggestion-control > input { min-height: 46px; padding-right: 48px !important; }
#account-modal .suggestion-toggle { right: 8px; width: 32px; height: 32px; border-radius: 8px; background: #f5f8f6; }
#account-modal .modal-actions { margin-top: 18px; padding-top: 16px; border-top: 1px solid #edf2ef; }

@media (max-width: 760px) {
  #account-modal form { padding: 23px 19px 20px; }
  #account-modal .modal-header { margin-bottom: 20px; }
  #account-modal .modal-header h2 { font-size: 25px; }
  #account-modal .form-grid { gap: 15px 11px; }
  #account-modal .form-grid label { font-size: 11px; }
  #account-modal .form-grid input,
  #account-modal .form-grid select,
  #account-modal .form-grid textarea { min-height: 44px; font-size: 13px; }
  #account-modal .suggestion-control > input { min-height: 44px; }
}
