/* Rock Crest admin — shared chrome for dashboard + settings */

body { background: #f2efe9; }

/* The hidden attribute drives auth-gated chrome; it must win over display rules. */
[hidden] { display: none !important; }

.admin-bar { background: var(--ink); color: #fff; padding: .9rem 0; }
.admin-bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.admin-bar .brand-name { color: #fff; font-size: 1rem; }
.admin-bar .brand-sub { color: rgba(255,255,255,.55); }
.admin-right { display: flex; align-items: center; gap: 1.4rem; }
.admin-who { font-size: .82rem; color: rgba(255,255,255,.6); }
.admin-bar button {
  background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--radius); font: 600 .85rem 'Inter',sans-serif; padding: .5rem 1rem; cursor: pointer;
}
.admin-bar button:hover { background: rgba(255,255,255,.2); }

/* ---- Account menu ---- */
.menu-wrap { position: relative; }
.menu-btn {
  display: flex; align-items: center; gap: .55rem;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.85); border-radius: 100px; padding: .35rem .8rem .35rem .35rem; cursor: pointer;
  transition: background .2s;
}
.menu-btn:hover { background: rgba(255,255,255,.18); }
.avatar {
  width: 30px; height: 30px; border-radius: 100px; flex: none;
  background: var(--brass); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font: 600 .88rem 'Inter',sans-serif;
}
.menu-panel {
  position: absolute; right: 0; top: calc(100% + .6rem); z-index: 50;
  min-width: 236px; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: var(--shadow-lg); padding: .4rem; overflow: hidden;
}
.menu-head { padding: .8rem .85rem .7rem; border-bottom: 1px solid var(--line); margin-bottom: .35rem; }
.menu-head span { display: block; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-mute); }
.menu-head b { font-size: .9rem; color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.menu-panel a, .menu-panel button {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  font: 500 .92rem 'Inter',sans-serif; color: var(--text); text-decoration: none;
  padding: .62rem .85rem; border-radius: var(--radius); cursor: pointer;
}
.menu-panel a:hover, .menu-panel button:hover { background: var(--cream); color: var(--ink); }
.menu-panel a.current { color: var(--forest); font-weight: 600; background: var(--cream); }
.menu-sep { height: 1px; background: var(--line); margin: .35rem 0; }
.menu-panel #signOutBtn { color: var(--danger); }
.menu-panel #signOutBtn:hover { background: #fdf6f5; }

/* ---- Modal ---- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200; background: rgba(18,33,28,.55);
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
}
.modal-backdrop[hidden] { display: none !important; }
.modal {
  background: #fff; border-radius: 10px; box-shadow: var(--shadow-lg);
  padding: 2rem; max-width: 460px; width: 100%;
}
.modal h2 { font-size: 1.3rem; margin-bottom: .5rem; }
.modal p { font-size: .95rem; color: var(--text-mute); margin: 0 0 1rem; }
.modal .warn {
  background: #fdf6f5; border: 1px solid #e5c8c1; color: #8c3327;
  border-radius: var(--radius); padding: .8rem .95rem; font-size: .88rem; margin-bottom: 1.2rem;
}
.modal label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .45rem; color: var(--ink); }
.modal label code { background: var(--cream); border: 1px solid var(--line); border-radius: 3px; padding: .1rem .4rem; font-size: .9em; }
.modal input {
  width: 100%; font: 400 1rem 'Inter',sans-serif; background: var(--cream);
  border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem .95rem; margin-bottom: 1.5rem;
}
.modal input:focus { border-color: var(--forest-mid); outline: none; background: #fff; }
.modal-actions { display: flex; gap: .7rem; justify-content: flex-end; flex-wrap: wrap; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not([disabled]) { background: #83291f; box-shadow: var(--shadow-md); }
.danger-link {
  background: none; border: 0; color: var(--text-mute); cursor: pointer;
  font: 500 .82rem 'Inter',sans-serif; padding: .45rem .2rem; text-decoration: underline; text-underline-offset: 3px;
}
.danger-link:hover { color: var(--danger); }

/* ---- Sign in ---- */
.signin { max-width: 410px; margin: 10vh auto 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-md); padding: 2.6rem; }
.signin .mark { display: block; width: 44px; margin: 0 auto 1.3rem; }
.signin h1 { font-size: 1.5rem; text-align: center; margin-bottom: .3rem; }
.signin .sub { text-align: center; color: var(--text-mute); font-size: .92rem; margin-bottom: 1.8rem; }
.signin label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .4rem; }
.signin input[type=email], .signin input[type=password], .signin input[type=text] {
  width: 100%; font: 400 1rem 'Inter',sans-serif; background: var(--cream);
  border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem .95rem;
}
.signin input:focus { border-color: var(--forest-mid); outline: none; background: #fff; }
.signin .field { margin-bottom: 1.1rem; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 4rem !important; }
.pw-toggle {
  position: absolute; right: .5rem; top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: var(--text-mute); font: 600 .78rem 'Inter',sans-serif;
  cursor: pointer; padding: .4rem .55rem; border-radius: var(--radius);
}
.pw-toggle:hover { color: var(--ink); background: var(--cream); }
.signin .row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.remember { display: inline-flex; align-items: center; gap: .5rem; font-size: .88rem; color: var(--text-mute); cursor: pointer; }
.remember input { width: 1.05rem; height: 1.05rem; accent-color: var(--forest); }
.link-btn { background: none; border: 0; color: var(--forest-mid); font: 500 .88rem 'Inter',sans-serif; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.signin .btn { width: 100%; }
.msg { font-size: .88rem; margin: 1rem 0 0; display: none; padding: .7rem .9rem; border-radius: var(--radius); }
.msg.show { display: block; }
.msg.err { color: var(--danger); background: #f8ece9; border: 1px solid #e5c8c1; }
.msg.ok { color: #2b5c39; background: #e4efe6; border: 1px solid #c2ddc9; }

@media (max-width: 640px) {
  .signin { margin: 4vh auto 0; padding: 1.8rem 1.4rem; border-radius: 0; border-left: 0; border-right: 0; }
}

/* ---- Cards / panels ---- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-sm); padding: 2rem; margin-bottom: 1.6rem; }
.panel h2 { font-size: 1.3rem; margin-bottom: .3rem; }
.panel .hint { color: var(--text-mute); font-size: .92rem; margin-bottom: 1.6rem; }

.row-list { list-style: none; margin: 0 0 1.4rem; padding: 0; }
.row-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .85rem 0; border-bottom: 1px solid var(--line);
}
.row-list li:first-child { border-top: 1px solid var(--line); }
.row-list .who b { display: block; font-weight: 600; color: var(--ink); font-size: .97rem; overflow-wrap: anywhere; }
.row-list .who span { font-size: .8rem; color: var(--text-mute); }
.row-remove { background: none; border: 1px solid var(--line); color: var(--text-mute); border-radius: var(--radius); font: 600 .8rem 'Inter',sans-serif; padding: .45rem .9rem; cursor: pointer; flex: none; }
.row-remove:hover { border-color: var(--danger); color: var(--danger); background: #fdf6f5; }
.row-remove[disabled] { opacity: .4; cursor: not-allowed; }
.tag-you { font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--brass); background: var(--sand); padding: .2rem .5rem; border-radius: 100px; margin-left: .5rem; }

.add-row { display: flex; gap: .7rem; flex-wrap: wrap; }
.add-row input {
  flex: 1; min-width: 220px; font: 400 1rem 'Inter',sans-serif; background: var(--cream);
  border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem .95rem;
}
.add-row input:focus { border-color: var(--forest-mid); outline: none; background: #fff; }
.add-row .btn { flex: none; }
@media (max-width: 560px) { .add-row .btn { width: 100%; } }
