/* ---------- app shell ---------- */
.app {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 18px 20px;
  background: linear-gradient(180deg, #FFFFFF 0%, #FFFDF9 100%);
  border-inline-end: 1px solid var(--line);
  overflow-y: auto;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
}
.brand-mark { width: 46px; height: 46px; flex: none; filter: drop-shadow(0 4px 10px rgba(143, 107, 31, .25)); }
.brand-text { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.brand-name {
  display: inline-block;
  direction: ltr;
  font-family: "ZarixLatin", sans-serif;
  font-weight: 600;
  font-size: 22px;
  line-height: 1;
  letter-spacing: .3em;
  margin-right: -.3em;
  background: var(--metal-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-sub { font-size: 14px; color: var(--text-3); line-height: 1.3; }

.ornament {
  position: relative;
  height: 1px;
  margin: 26px 8px 22px;
  background: linear-gradient(90deg, rgba(217, 188, 110, 0), var(--gold-300) 50%, rgba(217, 188, 110, 0));
}
.ornament::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 7px; height: 7px;
  transform: translate(-50%, -50%) rotate(45deg);
  background: #fff;
  border: 1px solid var(--gold-400);
}

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 14px;
  border-radius: var(--radius);
  color: var(--text-2);
  text-decoration: none;
  font-size: 16px;
  transition: background .15s ease, color .15s ease;
}
.nav a .ico { width: 20px; height: 20px; color: var(--text-3); transition: color .15s ease; }
.nav a:hover { background: var(--gold-50); color: var(--text); }
.nav a:hover .ico { color: var(--gold-700); }
.nav a.active {
  background: linear-gradient(270deg, #F6EBCD 0%, #FCF7EA 100%);
  color: var(--gold-900);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(217, 188, 110, .35);
}
.nav a.active .ico { color: var(--gold-700); }
.nav a.active::before {
  content: "";
  position: absolute;
  inset-inline-start: -18px;
  top: 12px; bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #D9BC6E, #8F6B1F);
}
.nav .count {
  margin-right: auto;
  min-width: 28px;
  text-align: center;
  font-size: 14px;
  color: var(--text-3);
  font-weight: 500;
}
.nav a.active .count { color: var(--gold-800); }
.nav-sep {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 14px 6px;
  font-size: 14px;
  color: var(--text-3);
}
.nav-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.side-foot { margin-top: auto; padding-top: 24px; display: flex; flex-direction: column; gap: 10px; }
.today {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-l);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 14px;
  color: var(--text-2);
}
.today .ico { width: 18px; height: 18px; color: var(--gold-700); }
.today .clock { margin-right: auto; font-weight: 600; font-size: 15px; color: var(--gold-800); }

/* ---------- main ---------- */
.main {
  min-width: 0;
  background:
    radial-gradient(900px 420px at 0% 0%, rgba(243, 231, 196, .5), rgba(243, 231, 196, 0) 70%),
    var(--bg);
}
.view { max-width: 1240px; margin: 0 auto; padding: 36px 40px 64px; }
.view.enter { animation: view-in .28s ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.mobile-bar { display: none; }
.scrim { display: none; }

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.ph-main { display: flex; align-items: center; gap: 16px; min-width: 0; }
.ph-ic {
  width: 52px; height: 52px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--radius-l);
  background: #fff;
  border: 1px solid var(--line-2);
  color: var(--gold-700);
  box-shadow: var(--shadow-1);
}
.ph-ic .ico { width: 24px; height: 24px; }
.page-head h1 { font-size: 30px; font-weight: 900; line-height: 1.3; }
.page-head p { margin-top: 2px; font-size: 16px; color: var(--text-2); }
.ph-actions { display: flex; gap: 12px; flex: none; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .view { padding: 28px 24px 56px; }
}

@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 288px;
    height: auto;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform .25s ease, visibility 0s linear .25s;
    box-shadow: var(--shadow-3);
    z-index: 60;
  }
  .app.drawer-open .sidebar { transform: none; visibility: visible; transition: transform .25s ease, visibility 0s; }
  .scrim {
    display: block;
    position: fixed; inset: 0;
    background: rgba(34, 27, 12, .32);
    z-index: 55;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }
  .app.drawer-open .scrim { opacity: 1; pointer-events: auto; }
  .mobile-bar {
    position: sticky; top: 0; z-index: 30;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
  }
  .mobile-bar .brand-name { font-size: 18px; }
  .view { padding: 20px 16px 48px; }
  .page-head { flex-wrap: wrap; gap: 16px; margin-bottom: 20px; }
  .page-head h1 { font-size: 24px; }
  .ph-ic { width: 44px; height: 44px; }
  .ph-actions { width: 100%; }
  .ph-actions .btn { flex: 1; }
}
