:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17202b;
  background: #f7f8f6;
}

* { box-sizing: border-box; }
body { margin: 0; background: #f7f8f6; color: #17202b; font-size: 14px; }
a { color: #0f6b66; text-decoration: none; }
a:hover { color: #0a4f4b; }

#header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 32px;
  background: #102a2c;
  color: white;
  box-shadow: 0 8px 28px rgb(16 42 44 / 12%);
}

#site_title { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
#site_title a, #header a { color: white; }
#tabs { display: flex; align-items: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
#tabs li { list-style: none; }
#tabs a { display: block; padding: 10px 12px; border-radius: 9px; color: #d3e3e1; font-size: 13px; font-weight: 650; }
#tabs .current a, #tabs a:hover { background: rgb(255 255 255 / 12%); color: white; }
#utility_nav { margin-left: auto; display: flex; align-items: center; gap: 16px; padding: 0; list-style: none; }
#utility_nav li { list-style: none; }

#title_bar { padding: 30px 32px 16px; }
#title_bar h2 { margin: 0; font-size: 27px; letter-spacing: -.035em; }
.action_items { float: right; margin-top: -32px; }

#active_admin_content { padding: 12px 32px 44px; }
#main_content_wrapper { width: 100%; }
#main_content { width: 100%; }
.columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.column { min-width: 0; width: auto !important; margin-right: 0 !important; }

.panel, .attributes_table, .index_table {
  margin: 0 0 20px;
  overflow: hidden;
  border: 1px solid #dfe5e3;
  border-radius: 14px;
  background: white;
  box-shadow: 0 4px 18px rgb(16 42 44 / 5%);
}

.panel > h3 { margin: 0; padding: 16px 18px; border-bottom: 1px solid #e7ecea; background: #fbfcfb; font-size: 14px; }
.panel_contents { padding: 18px; }
.panel_contents h2 { margin: 0 0 4px; font-size: 30px; color: #102a2c; }
.panel_contents p { margin: 0; color: #64706f; line-height: 1.55; }
.panel_contents p + p { margin-top: 12px; }
.panel_link { font-size: 12px; font-weight: 800; }

.admin_welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding: 22px 24px;
  border-radius: 16px;
  background: linear-gradient(135deg, #102a2c, #174b4a);
  color: white;
  box-shadow: 0 12px 30px rgb(16 42 44 / 16%);
}
.admin_welcome h2 { margin: 0; font-size: 22px; letter-spacing: -.025em; }
.admin_welcome p { margin: 6px 0 0; color: #c8ddda; }
.admin_role_badge { flex: 0 0 auto; padding: 7px 10px; border-radius: 999px; background: rgb(255 255 255 / 12%); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }

.quick_actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.quick_action { display: grid; grid-template-columns: 38px 1fr; column-gap: 11px; align-items: center; min-height: 78px; padding: 14px; border: 1px solid #dfe5e3; border-radius: 14px; background: white; color: #17202b; box-shadow: 0 3px 12px rgb(16 42 44 / 4%); transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.quick_action:hover { border-color: #75aaa5; color: #102a2c; box-shadow: 0 8px 22px rgb(16 42 44 / 9%); transform: translateY(-1px); }
.quick_action_icon { grid-row: 1 / span 2; display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; background: #e7f4f1; color: #0b625d; font-size: 20px; font-weight: 850; }
.quick_action strong { align-self: end; font-size: 13px; }
.quick_action small { align-self: start; margin-top: 3px; color: #71807d; font-size: 11px; }
.setup_steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.setup_steps > .panel:last-child { grid-column: 1 / -1; }
.setup_steps .panel_contents > p { margin-bottom: 16px; }
.setup_steps .formtastic fieldset { border: 0; box-shadow: none; }
.setup_steps .formtastic fieldset > ol { padding: 0; }
.settings_health { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.settings_health_item { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 12px 14px; border: 1px solid #dfe5e3; border-radius: 12px; background: white; }
.settings_health_item strong { font-size: 12px; }
.settings_security_note { margin: 0 0 20px; padding: 12px 14px; border-left: 3px solid #2f827c; border-radius: 8px; background: #edf7f5; color: #315c58; line-height: 1.55; }
.system_settings_form { max-width: 1080px; }
.system_setting_row { display: grid; grid-template-columns: minmax(240px, .8fr) minmax(280px, 1.2fr); gap: 22px; align-items: start; padding: 16px 0; border-bottom: 1px solid #edf0ef; }
.system_setting_row:first-child { padding-top: 0; }
.system_setting_row:last-child { padding-bottom: 0; border-bottom: 0; }
.system_setting_copy label { display: block; margin-bottom: 5px; color: #243b3a; font-size: 13px; font-weight: 800; }
.system_setting_copy small { display: block; color: #697674; line-height: 1.5; }
.setting_source { display: inline-flex; margin-top: 7px; border-radius: 999px; padding: 3px 7px; background: #f0f4f3; color: #687572; font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
.system_setting_control input[type="text"], .system_setting_control input[type="password"], .system_setting_control input[type="number"], .system_setting_control textarea, .system_setting_control select { width: 100%; min-height: 42px; border: 1px solid #ccd7d5; border-radius: 10px; padding: 9px 11px; background: white; color: #17202b; font: inherit; }
.system_setting_control textarea { min-height: 92px; resize: vertical; }
.system_setting_control input[type="checkbox"] { width: 18px; height: 18px; accent-color: #0f6b66; }
.clear_setting { display: flex; align-items: center; gap: 7px; margin-top: 9px; color: #8a4946; font-size: 11px; }
.settings_actions { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.settings_actions input[type="submit"] { min-height: 42px; border: 0; border-radius: 10px; padding: 9px 16px; background: #102a2c; color: white; font-weight: 800; cursor: pointer; }
.settings_actions small { color: #71807d; }

table { width: 100%; border-collapse: collapse; }
th { padding: 12px 14px; background: #f4f7f6; color: #53605f; font-size: 11px; text-align: left; text-transform: uppercase; letter-spacing: .07em; }
td { padding: 13px 14px; border-top: 1px solid #e8eceb; vertical-align: top; }
tbody tr:hover { background: #fafcfb; }
.attributes_table th { width: 200px; }
.attributes_table td { overflow-wrap: anywhere; }

.status_tag { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: #e6f4f1; color: #0b625d; font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
.status_tag.pending, .status_tag.submitted, .status_tag.under_review { background: #fff4d8; color: #8a5a00; }
.status_tag.rejected, .status_tag.archived { background: #fee9e8; color: #a3312e; }
.status_tag.approved, .status_tag.published { background: #e4f5e9; color: #23763b; }

.table_actions { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.table_actions a, .table_actions button, .action_item a, .action_items button, .pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d8e1df;
  border-radius: 8px;
  padding: 6px 10px;
  background: white;
  color: #174c4a;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.table_actions a:hover, .table_actions button:hover, .action_item a:hover, .action_items button:hover { border-color: #8db8b4; background: #f0f8f6; color: #0b625d; }
.support_session_form { display: inline-flex; margin: 0; }
.impersonate_link { border-color: #b5d7d3 !important; background: #edf8f6 !important; color: #0b625d !important; }

.person_cell { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.person_cell > div { min-width: 0; }
.person_cell strong, .person_cell small { display: block; }
.person_cell strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person_cell small { margin-top: 3px; overflow: hidden; color: #73807e; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.person_avatar { display: grid; flex: 0 0 auto; width: 36px; height: 36px; place-items: center; border-radius: 11px; background: #e7f4f1; color: #0b625d; font-size: 11px; font-weight: 850; }

.scopes { margin: 0 0 14px; }
.scopes ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.scopes li { list-style: none; }
.scopes a { display: inline-flex; padding: 7px 11px; border: 1px solid #dfe5e3; border-radius: 999px; background: white; color: #53605f; font-size: 12px; font-weight: 750; }
.scopes .selected a { border-color: #102a2c; background: #102a2c; color: white; }

.formtastic fieldset { margin: 0 0 18px; padding: 0; border: 1px solid #dfe5e3; border-radius: 14px; background: white; overflow: hidden; }
.formtastic fieldset > legend { width: 100%; padding: 14px 18px; border-bottom: 1px solid #e7ecea; background: #fbfcfb; font-size: 14px; font-weight: 800; }
.formtastic fieldset > ol { margin: 0; padding: 18px; list-style: none; }
.formtastic .input { margin: 0 0 16px; list-style: none; }
.formtastic .input:last-child { margin-bottom: 0; }
.formtastic .input > label { display: block; margin-bottom: 7px; color: #53605f; font-size: 12px; font-weight: 750; }
.formtastic input[type="text"], .formtastic input[type="email"], .formtastic input[type="password"], .formtastic textarea, .formtastic select { width: min(100%, 720px); min-height: 42px; border: 1px solid #ccd7d5; border-radius: 10px; padding: 9px 11px; background: white; color: #17202b; font: inherit; outline: none; }
.formtastic textarea { min-height: 110px; resize: vertical; }
.formtastic input:focus, .formtastic textarea:focus, .formtastic select:focus { border-color: #2f827c; box-shadow: 0 0 0 3px rgb(47 130 124 / 12%); }
.secure_link_field { width: 100%; min-height: 42px; margin-top: 14px; border: 1px solid #b8ceca; border-radius: 10px; padding: 9px 11px; background: #f5faf9; color: #174c4a; font: inherit; }
.formtastic .inline-errors { margin: 6px 0 0; color: #a3312e; font-size: 12px; }
.formtastic .buttons { display: flex; gap: 8px; margin: 0; padding: 0; border: 0; background: transparent; }
.formtastic .buttons > ol { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; }
.formtastic input[type="submit"] { min-height: 42px; border: 0; border-radius: 10px; padding: 9px 16px; background: #102a2c; color: white; font-weight: 800; cursor: pointer; }
#new_user.formtastic, form[id^="edit_user"].formtastic { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 1080px; }
#new_user.formtastic fieldset, form[id^="edit_user"].formtastic fieldset { margin: 0; }
#new_user.formtastic .buttons, form[id^="edit_user"].formtastic .buttons { grid-column: 1 / -1; }
.pagination { display: flex; gap: 5px; align-items: center; margin: 18px 0; }
.pagination .current { background: #102a2c; color: white; }
.blank_slate_container { padding: 52px; text-align: center; color: #697573; }
.flashes { padding: 14px 32px 0; }
.flash { border-radius: 10px; padding: 12px 16px; background: #e8f5f2; color: #125d58; }
.flash_alert, .flash_error { background: #feeceb; color: #9c302d; }
#footer { padding: 20px 32px 36px; color: #7c8785; font-size: 12px; }

@media (max-width: 900px) {
  #header { align-items: flex-start; flex-wrap: wrap; gap: 10px; padding: 18px; }
  #tabs { order: 3; width: 100%; overflow-x: auto; }
  #utility_nav { margin-left: auto; }
  #title_bar, #active_admin_content { padding-left: 18px; padding-right: 18px; }
  .columns { grid-template-columns: 1fr; }
  .quick_actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .setup_steps { grid-template-columns: 1fr; }
  .settings_health { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .system_setting_row { grid-template-columns: 1fr; gap: 10px; }
  .setup_steps > .panel:last-child { grid-column: auto; }
  .index_table { display: block; overflow-x: auto; }
  #new_user.formtastic, form[id^="edit_user"].formtastic { grid-template-columns: 1fr; }
  #new_user.formtastic .buttons, form[id^="edit_user"].formtastic .buttons { grid-column: auto; }
}

@media (max-width: 560px) {
  #title_bar h2 { font-size: 23px; }
  .action_items { float: none; margin: 14px 0 0; }
  .admin_welcome { align-items: flex-start; padding: 18px; }
  .admin_role_badge { display: none; }
  .quick_actions { grid-template-columns: 1fr; }
  .settings_health { grid-template-columns: 1fr; }
  .settings_actions { align-items: flex-start; flex-direction: column; }
  .table_actions { white-space: normal; }
}
