/* Atelier — mailbox administration */

:root {
  --ink: #f7f3ec;
  --ink-2: #fffdf9;
  --panel: #fffcf8;
  --panel-2: #f4efe6;
  --line: rgba(8, 87, 120, 0.12);
  --line-strong: rgba(8, 87, 120, 0.28);
  --gold: #085778;
  --gold-deep: #085778;
  --gold-2: #085778;
  --ivory: #1c1712;
  --muted: #6a6158;
  --faint: #8d847b;
  --rose: #9d4336;
  --sage: #2f6a3c;
  --shadow: 0 18px 46px rgba(70, 48, 20, 0.08);
  --sans: "Avenir Next", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Iowan Old Style", Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --radius: 18px;
}

html { min-height: 100%; }

body {
  margin: 0 0 88px;
  color: var(--ivory);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.5;
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(198, 163, 106, 0.18), transparent 60%),
    radial-gradient(700px 380px at 100% 0%, rgba(198, 163, 106, 0.1), transparent 55%),
    linear-gradient(180deg, #fffdf9 0%, var(--ink) 320px);
  background-attachment: fixed;
}

h1, h2, h3, h4, .atelier-title, .brand-name {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ivory);
}

a { color: var(--gold-2); text-decoration: none; }
a:hover, a:focus { color: #05384d; text-decoration: none; }

/* Chrome */
.navbar-default,
.navbar-fixed-top,
.navbar.fixed-top {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1030;
  min-height: 64px;
  margin: 0;
  background: rgba(255, 252, 248, 0.9);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: blur(18px);
}

.navbar-brand {
  display: flex !important;
  align-items: center;
  gap: 12px;
  height: 64px;
  padding: 0 18px !important;
  float: none;
}

.nav-logo {
  display: block;
  width: auto;
  height: 42px;
  max-width: 168px;
  object-fit: contain;
}

.brand-lockup { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-size: 18px; color: var(--gold-2); }
.brand-sub {
  margin-top: 3px;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.navbar-header { float: left; }
@media (min-width: 768px) {
  .navbar-default .navbar-collapse { float: right; }
  .navbar-default .navbar-nav.navbar-right { float: right; margin-right: 8px; }
  .navbar-default .navbar-right .dropdown-menu { right: 0; left: auto; }
}
.navbar-default .navbar-toggle {
  border: 1px solid var(--line-strong);
  margin-top: 16px;
}
.navbar-default .navbar-toggle .icon-bar { background-color: var(--gold); }
.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus { background: rgba(214, 186, 140, 0.08); }

.navbar-default .navbar-nav > li > a,
.navbar-default .navbar-nav > li > a.btn,
.navbar-default .navbar-nav > li > a.navbar-btn {
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 10px;
  margin: 14px 2px;
  line-height: 1.3;
}

.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus,
.navbar-default .navbar-nav > .open > a,
.navbar-default .navbar-nav > .open > a:hover,
.navbar-default .navbar-nav > .open > a:focus {
  color: #fff;
  background: var(--gold);
}

.navbar-default .navbar-nav > li > a .glyphicon { margin-right: 6px; opacity: 0.85; }

.dropdown-menu {
  background: #fffdf9;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 8px;
  margin-top: 8px;
  box-shadow: var(--shadow);
}
.dropdown-menu > li > a {
  color: var(--ivory);
  border-radius: 10px;
  padding: 9px 12px;
  letter-spacing: 0.02em;
  text-transform: none;
  font-size: 13.5px;
}
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
  color: var(--ivory);
  background: rgba(8, 87, 120, 0.08);
}
.row-actions { position: relative; }
.row-actions > .dropdown-menu { z-index: 2000; min-width: 210px; }
.dropdown-menu > li > form { margin: 0; }
.dropdown-menu > li > form > button {
  display: block;
  width: 100%;
  margin: 0;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ivory);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  letter-spacing: 0;
}
.dropdown-menu > li > form > button:hover,
.dropdown-menu > li > form > button:focus {
  background: rgba(8, 87, 120, 0.08);
  color: var(--ivory);
  box-shadow: none;
}
.dropdown-menu > li > form > button.is-danger { color: var(--rose); }
.dropdown-menu > li > form > button.is-danger:hover { background: rgba(157, 67, 54, 0.08); color: var(--rose); }
.dropdown-menu .glyphicon { margin-right: 8px; }
.caret { border-top-color: currentColor; }

body > .container,
.atelier-stage {
  width: min(1480px, calc(100% - 40px)) !important;
  max-width: 1480px;
  min-width: 0 !important;
  padding: 92px 0 24px !important;
}

/* Overview */
.atelier-hero {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(360px, 1.3fr);
  grid-template-areas:
    "copy metrics"
    "foot foot";
  align-items: center;
  gap: 18px 28px;
  margin: 8px 0 28px;
  padding: 22px 24px 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), transparent 42%),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.atelier-hero-copy { grid-area: copy; }
.atelier-metrics { grid-area: metrics; }
.atelier-hero-foot { grid-area: foot; }

.atelier-kicker, .sheet-kicker, .metric-label, .nav-title, .home-card-kicker {
  margin: 0 0 8px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.atelier-hero h1 {
  margin: 0;
  font-size: 40px;
  line-height: 1.05;
}

.atelier-lede {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.atelier-toolbar {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(200px, 1.2fr);
  gap: 12px;
  align-items: end;
  flex: 1 1 420px;
  max-width: 640px;
  margin-left: auto;
}

.atelier-hero-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.atelier-domain {
  margin: 0;
  max-width: none;
}
.atelier-domain label {
  display: block;
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.atelier-search, .atelier-search-form { width: 100%; }
.atelier-search-form { margin: 0; }
.atelier-search::before {
  content: "Search";
  display: block;
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.atelier-search .form-control,
.atelier-search-form .form-control,
.atelier-domain .form-control { width: 100%; }

.atelier-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.metric {
  min-width: 148px;
  padding: 10px 14px 9px;
  border-radius: 14px;
  background: rgba(198, 163, 106, 0.08);
  border: 1px solid var(--line);
}

.metric-value {
  display: block;
  font-family: var(--serif);
  font-size: 28px;
  color: var(--ivory);
  line-height: 1;
}
.metric-value small {
  margin-left: 6px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--faint);
}

.atelier-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
}

.atelier-tab {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.atelier-tab:hover { color: var(--ivory); border-color: var(--line-strong); }
.atelier-tab.is-active {
  color: #fff;
  background: var(--gold);
  border-color: transparent;
}

/* Sheets and tables */
.panel,
.panel-default,
.atelier-sheet,
.well {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--ivory);
}

.atelier-sheet { margin-bottom: 28px; overflow: hidden; }
.panel-heading, .sheet-head {
  background: transparent !important;
  border-bottom: 1px solid var(--line) !important;
  color: var(--ivory) !important;
}
.sheet-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 16px;
}
.sheet-head h2 { margin: 0; font-size: 28px; }
.sheet-head-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-left: auto;
}
.sheet-actions, .panel-footer .btn-group, .panel-footer .btn-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  float: none !important;
  width: 100%;
  max-width: 100%;
}
.sheet-actions > .btn,
.panel-footer .sheet-actions > a.btn,
.panel-footer .btn-group > .btn {
  float: none !important;
  position: static;
  flex: 0 0 auto;
  width: auto;
  margin: 0 !important;
  border-radius: 10px !important;
  white-space: nowrap;
}
.panel-body { color: var(--ivory); }
.panel-footer {
  background: transparent;
  border-top: 1px solid var(--line);
  padding: 14px 16px;
}
.panel-footer .pull-right,
.panel-footer .btn-group.pull-right {
  float: none !important;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}
form.form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.form-actions { display: flex; justify-content: flex-end; }
form.form > .btn { align-self: flex-end; }

.sheet-scroll { width: 100%; overflow-x: auto; }
.table {
  margin: 0;
  background: transparent;
}
.table > thead > tr > th,
.table > tbody > tr > th,
.table > thead > tr > td,
.table > tbody > tr > td {
  border-top: 1px solid var(--line) !important;
  border-color: var(--line);
  color: var(--ivory);
  vertical-align: middle;
  background: transparent;
}
.table > thead > tr > th,
#mailbox_table thead th,
#admin_table thead th {
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}
.table-hover > tbody > tr:hover { background: rgba(214, 186, 140, 0.045); }
#mailbox_table thead tr:first-child th[colspan] { display: none; }

.mbx-user {
  font-weight: 650;
  color: var(--ivory);
  white-space: nowrap;
}
.mbx-name, .mbx-when, .mbx-limit, .mbx-forward { color: var(--muted); }
.mbx-empty {
  padding: 28px 22px !important;
  color: var(--muted);
}
.searchresult {
  background: rgba(214, 186, 140, 0.22);
  color: var(--gold-2);
  border-radius: 4px;
  padding: 0 3px;
}

.mbx-meter { position: relative; width: 140px; min-height: 40px; }
.quota, .quota_bg, .quota_text { box-sizing: border-box; }
.quota_bg {
  position: absolute;
  left: 0;
  top: 6px;
  width: 120px;
  height: 6px;
  margin: 0;
  border: 0;
  border-radius: 99px;
  background: rgba(28, 23, 18, 0.08);
  z-index: 1;
}
.quota {
  position: absolute;
  left: 0;
  top: 6px;
  height: 6px;
  margin: 0;
  border-radius: 99px;
  background-image: none !important;
  z-index: 2;
}
.quota_low { background: #2f6a3c; }
.quota_mid { background: #c4922a; }
.quota_high { background: #9d4336; }
.quota_text {
  position: static;
  display: block;
  width: auto;
  height: auto;
  margin: 16px 0 0;
  padding: 0;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  line-height: 1.2;
}
.quota_text_low { color: #2f6a3c; }
.quota_text_mid { color: #8a6232; }
.quota_text_high { color: #9d4336; }
.mbx-quota.is-low,
.mbx-quota:has(.quota_low) { box-shadow: inset 3px 0 0 #2f6a3c; }
.mbx-quota.is-mid,
.mbx-quota:has(.quota_mid) { box-shadow: inset 3px 0 0 #c4922a; }
.mbx-quota.is-high,
.mbx-quota:has(.quota_high) { box-shadow: inset 3px 0 0 #9d4336; }
.quota-guide {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}
.quota-guide span { display: inline-flex; align-items: center; gap: 6px; }
.swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 99px;
}
.swatch-low { background: #2f6a3c; }
.swatch-mid { background: #c4922a; }
.swatch-high { background: #9d4336; }

.nav_bar { padding: 12px 16px 4px; }
.nav_bar table { width: 100% !important; background: transparent; }
.nav_bar td {
  background: transparent !important;
  border: 0 !important;
  color: var(--muted);
  padding: 0 !important;
}
.nav-pages, .nav-arrows { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.nav-arrows { justify-content: flex-end; }
.nav-title { margin-right: 8px; }
.page-num, .page-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  font-weight: 600;
  font-size: 12px;
}
.page-num:hover, .page-arrow:hover { color: var(--ivory); border-color: var(--line-strong); }
.page-num.is-current {
  color: #fff;
  background: var(--gold);
  border-color: transparent;
}

/* Controls */
.btn {
  border-radius: 10px;
  border: 1px solid transparent;
  box-shadow: none;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn:active, .btn:focus { outline: none; box-shadow: 0 0 0 3px rgba(8, 87, 120, 0.18); }
.btn-primary {
  color: #fff;
  background: #085778;
  border-color: #085778;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
  color: #fff;
  background: #06455f;
  border-color: #06455f;
}
.btn-default {
  color: #085778;
  background: #fff;
  border-color: rgba(8, 87, 120, 0.28);
  padding: 10px 5px;
}
.btn-default:hover, .btn-default:focus, .btn-default:active {
  color: #05384d;
  background: rgba(8, 87, 120, 0.06);
  border-color: #085778;
}
.btn-warning, .btn-warning:hover, .btn-warning:focus, .btn-warning:active,
.status-pill.btn-warning {
  color: #24532e;
  background: rgba(47, 106, 60, 0.1);
  border-color: rgba(47, 106, 60, 0.28);
}
.btn-info, .btn-info:hover, .btn-info:focus, .btn-info:active,
.status-pill.btn-info {
  color: var(--muted);
  background: transparent;
  border-color: var(--line);
}
.btn-danger, .btn-danger:hover, .btn-danger:focus, .btn-danger:active {
  color: var(--rose);
  background: transparent;
  border-color: rgba(224, 160, 144, 0.45);
}
.btn-danger:hover, .btn-danger:focus { color: #1a0e0c; background: #e0a090; }
.btn .glyphicon { margin-right: 4px; }
#mailbox_table .btn, #admin_table .btn { padding: 5px 10px; font-size: 12px; }
#mailbox_table form, #admin_table form { display: inline-block; margin: 0; }
.mbx-act { white-space: nowrap; width: 1%; }

.form-control, select, textarea.form-control {
  height: 42px;
  color: var(--ivory);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: none;
}
textarea.form-control { height: auto; min-height: 140px; }
.form-control:focus, select:focus, textarea:focus {
  color: var(--ivory);
  background: #fff;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(8, 87, 120, 0.16);
}
.form-control::placeholder { color: var(--faint); }
.control-label, label { color: var(--gold-2); font-weight: 600; }
.help-block, .form-control-static { color: var(--muted); }
.has-error .form-control { border-color: var(--rose); }
.has-error .help-block { color: var(--rose); }
option { background: #fff; color: var(--ivory); }
.input-group-btn .btn { height: 42px; border-radius: 0 12px 12px 0; }
.input-group .form-control { border-radius: 12px 0 0 12px; }
hr { border-color: var(--line); }
code, pre {
  color: var(--gold-2);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.alert {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-2);
  color: var(--ivory);
}
.alert-info { border-color: rgba(214, 186, 140, 0.35); }
.alert-danger { border-color: rgba(157, 67, 54, 0.35); color: #7a3328; }
.alert ul { margin: 0; }

/* Home and account */
.atelier-home { padding: 8px 8px 22px; }
.home-search, .home-results { padding: 18px 18px 0; }
.home-search h2, .home-results h3 {
  margin: 0 0 12px;
  font-size: 26px;
}
.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  padding: 18px;
}
.home-card {
  display: flex;
  flex-direction: column;
  min-height: 148px;
  padding: 18px 18px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 248, 0.7);
  color: var(--ivory);
}
.home-card:hover {
  color: var(--ivory);
  border-color: var(--line-strong);
  background: rgba(214, 186, 140, 0.06);
}
.home-card strong {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
}
.home-card span:last-child {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13.5px;
}
.home-card-kicker .glyphicon { margin-right: 6px; }

/* Login */
.page-login, .page-login-mfa, .page-password-recover, .page-password-change { margin-bottom: 0; }
#login.atelier-login {
  max-width: 440px;
  margin: 6vh auto 48px;
  padding: 0;
}
#login .well.login-card {
  max-width: none;
  margin: 0;
  padding: 36px 32px 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  background:
    linear-gradient(180deg, rgba(243, 230, 207, 0.06), transparent 34%),
    var(--panel);
}
.login-logo {
  display: block;
  width: auto;
  height: 78px;
  max-width: 240px;
  margin: 0 auto 18px;
}
.login-card h2, #login > .h2, #login > h2 {
  margin: 0 0 22px;
  font-family: var(--serif);
  font-size: 34px;
  line-height: 1.15;
  text-align: left;
}
body.page-login > .atelier-stage {
  padding-top: 32px !important;
}
body.page-login > .atelier-stage,
body.page-password-recover > .atelier-stage,
body.page-password-change > .atelier-stage,
body.page-login-mfa > .atelier-stage {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: 80px !important;
}
.login-card .btn-lg { width: 100%; margin-top: 6px; }
.login-card select,
.login-card .form-control { width: 100%; }
.login-switch { margin-top: 16px; text-align: center; }
.login-switch a { letter-spacing: 0.08em; text-transform: uppercase; font-size: 11px; font-weight: 600; }

/* Footer and misc */
.footer {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: auto;
  padding: 16px 0 18px;
  line-height: 1.5;
  background: transparent;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 12px;
}
.footer a { color: var(--muted); }
#motd {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-left: 2px solid var(--gold);
  color: var(--gold-2);
}
#domainsList {
  margin: 8px 0 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
#domainsList label { font-weight: 500; color: var(--ivory); }

@media (max-width: 860px) {
  .atelier-hero {
    grid-template-columns: 1fr;
    grid-template-areas: "copy" "metrics" "foot";
  }
  .atelier-toolbar { grid-template-columns: 1fr; margin-left: 0; max-width: none; }
  .atelier-metrics { justify-content: flex-start; }
  .atelier-hero-foot { align-items: stretch; }
  .atelier-tabs { margin: 0; }
  .atelier-hero h1 { font-size: 32px; }
  .sheet-head { flex-direction: column; align-items: flex-start; }
  .sheet-head-side { width: 100%; margin-left: 0; }
  body > .container, .atelier-stage { width: calc(100% - 20px) !important; }
  .navbar-header { float: none; }
  .navbar-default .navbar-nav > li > a { margin: 4px 8px; }
}
