/* Life OS - Executive Premium Design System */
*{margin:0;padding:0;box-sizing:border-box}

:root{
  /* Executive dark palette */
  --bg-primary:#0a0a0a;
  --bg-secondary:#111111;
  --bg-tertiary:#161616;
  --bg-card:rgba(18,18,18,0.95);
  --bg-card-hover:rgba(24,24,24,0.98);
  --bg-elevated:rgba(22,22,22,0.98);

  /* Luxury accent - Warm gold/champagne */
  --accent-gold:#c9a962;
  --accent-gold-light:#d4bc7a;
  --accent-gold-dark:#a68b4b;
  --accent-glow:rgba(201,169,98,0.15);
  --accent-glow-strong:rgba(201,169,98,0.25);

  /* Secondary accent - Platinum */
  --accent-platinum:#a8a8a8;
  --accent-platinum-light:#c4c4c4;

  /* Text hierarchy - refined warm tones */
  --text-primary:#fafafa;
  --text-secondary:#a0a0a0;
  --text-muted:#666666;
  --text-accent:#c9a962;

  /* Borders & dividers - subtle elegance */
  --border-subtle:rgba(255,255,255,0.06);
  --border-medium:rgba(255,255,255,0.1);
  --border-gold:rgba(201,169,98,0.3);
  --border-gold-strong:rgba(201,169,98,0.5);

  /* Status colors - muted, sophisticated */
  --success:#4ade80;
  --success-muted:rgba(74,222,128,0.15);
  --warning:#fbbf24;
  --warning-muted:rgba(251,191,36,0.15);
  --error:#f87171;
  --error-muted:rgba(248,113,113,0.15);

  /* Spacing system */
  --radius-sm:6px;
  --radius-md:10px;
  --radius-lg:14px;
  --radius-xl:20px;
  --radius-2xl:28px;

  /* Premium shadows */
  --shadow-sm:0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:0 4px 24px rgba(0,0,0,0.5);
  --shadow-lg:0 8px 48px rgba(0,0,0,0.6);
  --shadow-gold:0 4px 32px rgba(201,169,98,0.12);
  --shadow-glow:0 0 60px rgba(201,169,98,0.08);

  /* Premium transitions */
  --ease-premium:cubic-bezier(0.25,0.1,0.25,1);
  --ease-bounce:cubic-bezier(0.34,1.56,0.64,1);
}

/* Premium Typography */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

body{
  background:var(--bg-primary);
  color:var(--text-primary);
  font-family:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  font-weight:400;
  min-height:100vh;
  line-height:1.65;
  letter-spacing:-0.01em;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

/* Subtle texture overlay */
body::before{
  content:'';
  position:fixed;
  inset:0;
  pointer-events:none;
  background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity:0.02;
  z-index:99998;
}

/* Main container */
.c{
  max-width:1280px;
  margin:0 auto;
  padding:48px 32px 120px;
}

/* Premium serif headings */
.serif{
  font-family:'Cormorant Garamond',Georgia,'Times New Roman',serif;
}

/* Executive header */
.h{
  background:var(--bg-card);
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-2xl);
  padding:28px 36px;
  margin-bottom:28px;
  position:relative;
  overflow:hidden;
}

/* Subtle gold accent line at top */
.h::before{
  content:'';
  position:absolute;
  top:0;left:48px;right:48px;height:1px;
  background:linear-gradient(90deg, transparent, var(--accent-gold), transparent);
  opacity:0.4;
}

.h-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
}

.h-left{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.quote{
  font-size:14px;
  color:var(--text-muted);
  max-width:380px;
  text-align:right;
  font-style:italic;
  line-height:1.6;
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:16px;
  letter-spacing:0.01em;
}

/* Kicker/Label */
.g{
  font-size:11px;
  color:var(--accent-gold);
  font-weight:500;
  letter-spacing:0.2em;
  text-transform:uppercase;
}

/* Main title - serif elegance */
.t{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:56px;
  font-weight:600;
  letter-spacing:-0.02em;
  color:var(--text-primary);
  line-height:1.1;
}

/* Subtitle/description */
.d{
  font-size:14px;
  color:var(--text-muted);
  font-weight:400;
  letter-spacing:0.01em;
}

/* Section styling */
.sec{
  background:var(--bg-card);
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-xl);
  padding:32px;
  margin-bottom:24px;
  transition:all 0.4s var(--ease-premium);
}

.sec:hover{
  border-color:var(--border-medium);
  box-shadow:var(--shadow-md);
}

.sh{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  margin-bottom:28px;
  padding-bottom:20px;
  border-bottom:1px solid var(--border-subtle);
}

.slft{
  display:flex;
  align-items:center;
  gap:16px;
}

/* Icon container - refined */
.si2{
  width:44px;
  height:44px;
  border-radius:var(--radius-md);
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg, rgba(201,169,98,0.15), rgba(201,169,98,0.05));
  border:1px solid var(--border-gold);
  color:var(--accent-gold);
  font-size:18px;
  transition:all 0.3s var(--ease-premium);
}

.sec:hover .si2{
  background:linear-gradient(135deg, rgba(201,169,98,0.2), rgba(201,169,98,0.1));
  box-shadow:var(--shadow-gold);
}

/* Section icon SVGs */
.si2 svg{
  width:20px;
  height:20px;
  stroke:var(--accent-gold);
  stroke-width:1.5;
  fill:none;
}

.st{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:20px;
  font-weight:600;
  letter-spacing:-0.01em;
  color:var(--text-primary);
}

/* Navigation - Executive style */
.quick-nav{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(100px,1fr));
  gap:12px;
  margin-bottom:40px;
}

.nav-btn{
  background:var(--bg-card);
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-lg);
  padding:20px 16px;
  text-align:center;
  cursor:pointer;
  text-decoration:none;
  color:inherit;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-height:96px;
  transition:all 0.35s var(--ease-premium);
  position:relative;
}

.nav-btn::before{
  content:'';
  position:absolute;
  inset:0;
  border-radius:var(--radius-lg);
  background:linear-gradient(135deg, rgba(201,169,98,0.08), transparent);
  opacity:0;
  transition:opacity 0.35s var(--ease-premium);
}

.nav-btn .nav-icon{
  width:24px;
  height:24px;
  position:relative;
  z-index:2;
}

.nav-btn .nav-icon svg{
  width:24px;
  height:24px;
  stroke:var(--text-secondary);
  stroke-width:1.5;
  fill:none;
  transition:stroke 0.35s var(--ease-premium);
}

.nav-btn span:not(.nav-icon){
  font-size:11px;
  color:var(--text-muted);
  font-weight:500;
  text-transform:uppercase;
  letter-spacing:0.08em;
  position:relative;
  z-index:2;
  transition:color 0.35s var(--ease-premium);
}

.nav-btn:hover{
  border-color:var(--border-gold);
  transform:translateY(-2px);
  box-shadow:var(--shadow-md);
}

.nav-btn:hover::before{
  opacity:1;
}

.nav-btn:hover .nav-icon svg{
  stroke:var(--accent-gold);
}

.nav-btn:hover span:not(.nav-icon){
  color:var(--text-secondary);
}

.nav-btn.active{
  background:linear-gradient(135deg, rgba(201,169,98,0.1), rgba(201,169,98,0.03));
  border-color:var(--border-gold);
}

.nav-btn.active .nav-icon svg{
  stroke:var(--accent-gold);
}

.nav-btn.active span:not(.nav-icon){
  color:var(--accent-gold);
}

/* Tag pills - refined */
.tag{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 14px;
  background:rgba(201,169,98,0.1);
  color:var(--accent-gold);
  border:1px solid var(--border-gold);
  border-radius:999px;
  font-size:10px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:0.08em;
}

.tag.green{background:var(--success-muted);color:var(--success);border-color:rgba(74,222,128,0.3)}
.tag.orange{background:var(--warning-muted);color:var(--warning);border-color:rgba(251,191,36,0.3)}
.tag.red{background:var(--error-muted);color:var(--error);border-color:rgba(248,113,113,0.3)}
.tag.cyan{background:rgba(56,189,248,0.1);color:#38bdf8;border-color:rgba(56,189,248,0.3)}
.tag.platinum{background:rgba(168,168,168,0.1);color:var(--accent-platinum);border-color:rgba(168,168,168,0.3)}

/* Inputs - Premium feel */
input,select,textarea{
  width:100%;
  padding:16px 20px;
  background:var(--bg-tertiary);
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-md);
  color:var(--text-primary);
  font-size:14px;
  font-family:inherit;
  font-weight:400;
  transition:all 0.3s var(--ease-premium);
}

input:focus,select:focus,textarea:focus{
  outline:none;
  border-color:var(--accent-gold);
  box-shadow:0 0 0 3px var(--accent-glow);
  background:var(--bg-secondary);
}

input::placeholder,textarea::placeholder{
  color:var(--text-muted);
  font-weight:400;
}

select option{
  background:var(--bg-secondary);
  color:var(--text-primary);
}

/* Buttons - Executive */
.btn{
  width:100%;
  padding:16px 24px;
  background:linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dark));
  border:none;
  border-radius:var(--radius-md);
  color:#0a0a0a;
  font-size:13px;
  font-weight:600;
  font-family:inherit;
  letter-spacing:0.04em;
  text-transform:uppercase;
  cursor:pointer;
  transition:all 0.35s var(--ease-premium);
  box-shadow:var(--shadow-gold);
}

.btn:hover{
  transform:translateY(-1px);
  box-shadow:0 6px 36px rgba(201,169,98,0.25);
}

.btn:active{
  transform:translateY(0);
}

.btn.secondary{
  background:transparent;
  border:1px solid var(--border-medium);
  color:var(--text-secondary);
  box-shadow:none;
}

.btn.danger{
  background:rgba(248,113,113,0.12);
  border:1px solid rgba(248,113,113,0.35);
  color:var(--error);
  box-shadow:none;
}

.btn.danger:hover{
  background:rgba(248,113,113,0.18);
  border-color:rgba(248,113,113,0.5);
}

.btn-sm{
  padding:8px 12px;
  font-size:11px;
  letter-spacing:0.08em;
  text-transform:uppercase;
}

.btn.secondary:hover{
  background:rgba(255,255,255,0.03);
  border-color:var(--border-gold);
  color:var(--accent-gold);
  box-shadow:none;
}

/* Money cards */
.money-grid{
  display:grid;
  gap:20px;
}

.money-card{
  background:var(--bg-tertiary);
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-lg);
  padding:24px;
  transition:all 0.3s var(--ease-premium);
}

.money-card:hover{
  background:var(--bg-elevated);
  border-color:var(--border-medium);
}

.money-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
}

.money-label{
  font-size:11px;
  color:var(--text-muted);
  font-weight:500;
  text-transform:uppercase;
  letter-spacing:0.1em;
}

.money-value{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:32px;
  font-weight:600;
  letter-spacing:-0.02em;
}

.money-value.good{color:var(--success)}
.money-value.warn{color:var(--warning)}
.money-value.alert{color:var(--error)}

.helper{
  font-size:12px;
  color:var(--text-muted);
  margin-top:10px;
}

.progress{
  height:4px;
  background:var(--bg-primary);
  border-radius:999px;
  overflow:hidden;
  margin-top:16px;
}

.progress-bar{
  height:100%;
  background:linear-gradient(90deg, var(--accent-gold-dark), var(--accent-gold));
  border-radius:999px;
  transition:width 0.6s var(--ease-premium);
}

/* Bill items */
.bill-item{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:18px 20px;
  background:var(--bg-tertiary);
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-md);
  margin-bottom:12px;
  cursor:pointer;
  gap:20px;
  transition:all 0.3s var(--ease-premium);
}

.bill-item:hover{
  background:var(--bg-elevated);
  border-color:var(--border-medium);
  transform:translateX(4px);
}

.bill-paid{
  background:var(--success-muted);
  border-color:rgba(74,222,128,0.2);
}

.bill-main{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  flex:1;
  min-width:0;
}

.bill-main span:first-child{
  font-size:14px;
  font-weight:500;
  color:var(--text-primary);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.bill-actions{
  display:flex;
  gap:10px;
  align-items:center;
}

.bill-btn{
  padding:10px 14px;
  border-radius:var(--radius-sm);
  border:none;
  font-size:11px;
  font-weight:600;
  letter-spacing:0.04em;
  text-transform:uppercase;
  cursor:pointer;
  font-family:inherit;
  transition:all 0.3s var(--ease-premium);
}

.bill-btn.edit{
  background:transparent;
  border:1px solid var(--border-medium);
  color:var(--text-secondary);
}

.bill-btn.edit:hover{
  border-color:var(--border-gold);
  color:var(--accent-gold);
}

.bill-btn.remove{
  background:var(--error-muted);
  border:1px solid rgba(248,113,113,0.2);
  color:var(--error);
}

/* Debt items */
.debt-item{
  background:var(--bg-tertiary);
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-md);
  padding:16px 18px;
  margin-bottom:10px;
  transition:all 0.3s var(--ease-premium);
}

.debt-item:hover{
  border-color:var(--border-medium);
}

.debt-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
}

.debt-name{
  font-size:14px;
  font-weight:500;
}

.debt-bal{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:24px;
  font-weight:600;
}

.debt-bal.active{color:var(--warning)}
.debt-bal.paid{color:var(--success)}

.debt-meta{
  font-size:12px;
  color:var(--text-muted);
}

.debt-btn{
  padding:10px 14px;
  border-radius:var(--radius-sm);
  border:none;
  font-size:11px;
  font-weight:600;
  letter-spacing:0.04em;
  text-transform:uppercase;
  cursor:pointer;
  font-family:inherit;
  transition:all 0.3s var(--ease-premium);
}

.debt-actions{
  display:flex;
  align-items:center;
  gap:10px;
  margin-left:auto;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.debt-actions .debt-bal{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:24px;
  font-weight:600;
}

.debt-minwrap{
  display:flex;
  align-items:center;
  gap:8px;
}

.debt-min{
  font-size:11px;
  color:var(--text-muted);
  letter-spacing:0.02em;
  white-space:nowrap;
}

.debt-btn.pay{
  background:linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dark));
  color:#0a0a0a;
  box-shadow:var(--shadow-gold);
}

.debt-btn.pay:hover{
  transform:translateY(-1px);
  box-shadow:0 4px 24px rgba(201,169,98,0.25);
}

.debt-btn.pay:disabled{
  opacity:0.4;
  cursor:not-allowed;
  transform:none;
}

.debt-btn.edit{
  background:transparent;
  border:1px solid var(--border-medium);
  color:var(--text-secondary);
}

.debt-btn.edit:hover{
  border-color:var(--border-gold);
  color:var(--accent-gold);
}

.debt-btn.remove{
  background:var(--error-muted);
  border:1px solid rgba(248,113,113,0.2);
  color:var(--error);
}

/* Split layout */
.split{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:20px;
}

.split-col{
  background:var(--bg-tertiary);
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-lg);
  padding:24px;
}

@media(max-width:600px){.split{grid-template-columns:1fr}}

/* Habit checkboxes */
.hi{
  display:flex;
  align-items:center;
  gap:16px;
  padding:16px 20px;
  background:var(--bg-tertiary);
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-md);
  margin-bottom:12px;
  cursor:pointer;
  transition:all 0.3s var(--ease-premium);
}

.hi:hover{
  background:var(--bg-elevated);
  border-color:var(--border-medium);
}

.hc{
  width:22px;
  height:22px;
  border-radius:6px;
  border:2px solid var(--text-muted);
  display:flex;
  align-items:center;
  justify-content:center;
  transition:all 0.25s var(--ease-premium);
  flex-shrink:0;
}

.hc.checked{
  background:linear-gradient(135deg, var(--success), #22c55e);
  border-color:var(--success);
}

.hc.checked::after{
  content:'';
  width:6px;
  height:10px;
  border:solid white;
  border-width:0 2px 2px 0;
  transform:rotate(45deg);
  margin-bottom:2px;
}

.hc.evening{border-color:var(--accent-gold)}
.hc.evening.checked{background:linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dark))}

.hn{font-size:14px;font-weight:500}
.hn3{font-size:12px;color:var(--text-muted);margin-top:4px}

/* Loading states */
.loading{
  color:var(--text-muted);
  text-align:center;
  padding:40px;
  font-size:13px;
  letter-spacing:0.02em;
}

/* Empty states */
.empty-state{
  color:var(--text-muted);
  text-align:center;
  padding:32px;
  font-size:13px;
  font-style:italic;
}

/* Mini tiles */
.mini-tiles{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:16px;
}

.mini-tile{
  background:var(--bg-tertiary);
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-md);
  padding:18px;
  min-height:88px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  transition:all 0.3s var(--ease-premium);
}

.mini-tile:hover{
  background:var(--bg-elevated);
  border-color:var(--border-medium);
}

.tile-title{
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:0.12em;
  color:var(--text-muted);
  font-weight:500;
}

.tile-main{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:18px;
  font-weight:600;
  color:var(--text-primary);
  margin-top:8px;
}

/* Form dots for form indicators */
.form-dot{
  width:8px;
  height:8px;
  border-radius:50%;
  display:inline-block;
}

.form-dot.win{background:var(--success)}
.form-dot.loss{background:var(--error)}
.form-dot.draw{background:var(--warning)}

/* Task rows */
.task-row{
  display:flex;
  align-items:center;
  gap:14px;
  padding:12px 16px;
  background:var(--bg-tertiary);
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-md);
  margin-bottom:8px;
  transition:all 0.3s var(--ease-premium);
}

.task-row:hover{
  background:var(--bg-elevated);
  border-color:var(--border-medium);
}

.task-actions{
  display:flex;
  flex-direction:row;
  gap:8px;
  margin-left:auto;
  align-items:center;
}

.task-btn{
  padding:8px 12px;
  border-radius:var(--radius-sm);
  border:1px solid var(--border-subtle);
  background:transparent;
  color:var(--text-secondary);
  font-size:10px;
  font-weight:600;
  letter-spacing:0.04em;
  text-transform:uppercase;
  cursor:pointer;
  font-family:inherit;
  transition:all 0.25s var(--ease-premium);
}

.task-btn.complete{
  background:var(--success-muted);
  border-color:rgba(74,222,128,0.3);
  color:var(--success);
}

.task-btn.edit:hover{
  border-color:var(--border-gold);
  color:var(--accent-gold);
}

.task-btn.delete{
  background:var(--error-muted);
  border-color:rgba(248,113,113,0.2);
  color:var(--error);
}

.task-btn.delete:hover{
  background:rgba(248,113,113,0.2);
}

/* Field label */
.field-label{
  display:block;
  font-size:10px;
  color:var(--text-muted);
  font-weight:500;
  text-transform:uppercase;
  letter-spacing:0.1em;
  margin:20px 0 10px;
}

/* Log items */
.log-item{
  background:var(--bg-tertiary);
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-md);
  padding:20px;
  margin-bottom:14px;
}

.log-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  font-size:14px;
  font-weight:500;
}

.log-meta{
  font-size:12px;
  color:var(--text-muted);
  margin-top:8px;
}

/* Email styles */
.email-layout{
  display:grid;
  grid-template-columns:1fr 1.5fr;
  gap:20px;
}

.email-panel{
  background:var(--bg-tertiary);
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-lg);
  padding:24px;
}

.email-item{
  padding:16px 18px;
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-md);
  background:var(--bg-secondary);
  cursor:pointer;
  transition:all 0.3s var(--ease-premium);
  margin-bottom:10px;
}

.email-item:hover{
  background:var(--bg-elevated);
  border-color:var(--border-medium);
}

.email-item.active{
  background:rgba(201,169,98,0.08);
  border-color:var(--border-gold);
}

.email-from{font-size:13px;font-weight:500}
.email-subject{font-size:13px;color:var(--text-secondary);margin-top:6px}
.email-date{font-size:11px;color:var(--text-muted);margin-top:8px}

/* News cards */
.news-card{
  background:var(--bg-tertiary);
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-lg);
  padding:18px 20px;
  transition:all 0.35s var(--ease-premium);
}

.news-card.clickable{
  cursor:pointer;
}

.news-card.clickable:hover{
  transform:translateY(-3px);
  background:var(--bg-elevated);
  border-color:var(--border-medium);
  box-shadow:var(--shadow-md);
}

.news-title{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:16px;
  font-weight:600;
  line-height:1.35;
}

.news-meta{
  display:flex;
  justify-content:space-between;
  gap:12px;
  font-size:11px;
  color:var(--text-muted);
  margin-top:8px;
  text-transform:uppercase;
  letter-spacing:0.05em;
}

.news-desc{
  margin-top:10px;
  font-size:12px;
  color:var(--text-secondary);
  line-height:1.5;
}

.news-controls{
  display:flex;
  align-items:center;
  gap:4px;
  flex-wrap:wrap;
}

.news-controls .btn.secondary{
  padding:6px 10px;
  font-size:10px;
  letter-spacing:0.08em;
  width:auto;
}

/* Library */
.library-grid{
  display:grid;
  gap:20px;
}

@media(min-width:800px){.library-grid{grid-template-columns:1fr}}
@media(min-width:1150px){.library-grid{grid-template-columns:1fr}}

.library-panel{
  background:linear-gradient(180deg, rgba(19,24,33,0.9), rgba(11,15,20,0.95));
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-xl);
  padding:18px;
  box-shadow:var(--shadow-md);
}

.book-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:6px 4px 12px;
  border-bottom:1px solid rgba(255,255,255,0.04);
  margin-bottom:12px;
}

.book-title-lg{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:20px;
  font-weight:600;
  letter-spacing:0.01em;
}

.book-sub{
  font-size:12px;
  color:var(--text-muted);
  margin-top:4px;
}

.book-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

/* Book cards */
.book-card{
  display:grid;
  grid-template-columns:72px 1fr;
  gap:14px;
  background:linear-gradient(90deg, rgba(16,20,27,0.9), rgba(12,16,22,0.85));
  border:1px solid rgba(255,255,255,0.06);
  border-radius:var(--radius-lg);
  padding:14px;
  transition:all 0.3s var(--ease-premium);
  position:relative;
}

.book-card:hover{
  border-color:rgba(201,169,98,0.35);
  box-shadow:var(--shadow-md);
}

.book-card::after{
  content:'';
  position:absolute;
  left:12px;
  right:12px;
  bottom:-6px;
  height:6px;
  border-radius:0 0 12px 12px;
  background:linear-gradient(90deg, rgba(201,169,98,0.12), rgba(255,255,255,0.04));
  opacity:0.7;
}

.book-cover{
  position:relative;
  width:72px;
  aspect-ratio:2/3;
  border-radius:10px;
  overflow:hidden;
  background:linear-gradient(160deg, rgba(201,169,98,0.18), rgba(14,18,25,0.8));
  border:1px solid rgba(255,255,255,0.06);
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--text-muted);
  font-size:18px;
  font-weight:600;
  letter-spacing:0.08em;
}

.book-cover-img{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  opacity:0;
  transition:opacity 0.3s ease;
}

.book-cover-img.loaded{opacity:1}
.book-cover-img.loaded + .book-cover-fallback{opacity:0}

.book-cover-fallback{
  text-transform:uppercase;
}

.book-body{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.book-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.book-title{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:18px;
  font-weight:600;
  line-height:1.2;
}

.book-author{
  font-size:12px;
  color:var(--text-secondary);
}

.book-meta{
  font-size:11px;
  color:var(--text-muted);
  letter-spacing:0.04em;
  text-transform:uppercase;
}

.book-notes{
  font-size:12px;
  color:var(--text-secondary);
  line-height:1.5;
}

.book-progress{margin-top:2px}

.book-badges{
  display:flex;
  gap:6px;
}

.book-badge{
  font-size:9px;
  letter-spacing:0.1em;
  text-transform:uppercase;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid var(--border-subtle);
  color:var(--text-muted);
  background:rgba(255,255,255,0.03);
}

.book-badge.current{color:var(--accent-gold);border-color:rgba(201,169,98,0.35)}
.book-badge.planned{color:var(--warning);border-color:rgba(251,191,36,0.35)}
.book-badge.finished{color:var(--success);border-color:rgba(74,222,128,0.35)}

.book-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:6px;
}

.book-btn{
  padding:6px 10px;
  border-radius:var(--radius-sm);
  border:1px solid var(--border-subtle);
  background:rgba(255,255,255,0.02);
  color:var(--text-secondary);
  font-size:10px;
  font-weight:600;
  letter-spacing:0.08em;
  text-transform:uppercase;
  cursor:pointer;
  transition:all 0.25s var(--ease-premium);
}

.book-btn:hover{
  border-color:var(--border-gold);
  color:var(--accent-gold);
}

.book-btn.danger{
  border-color:rgba(248,113,113,0.3);
  color:var(--error);
  background:rgba(248,113,113,0.08);
}

.book-btn.danger:hover{
  background:rgba(248,113,113,0.16);
  border-color:rgba(248,113,113,0.45);
}

.book-pagination{
  display:flex;
  align-items:center;
  gap:6px;
  justify-content:flex-end;
  margin-top:10px;
}

.page-btn{
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border-subtle);
  background:rgba(255,255,255,0.03);
  color:var(--text-secondary);
  font-size:10px;
  letter-spacing:0.08em;
  text-transform:uppercase;
  cursor:pointer;
  transition:all 0.2s ease;
}

.page-btn:hover{
  border-color:var(--border-gold);
  color:var(--accent-gold);
}

.page-btn.active{
  border-color:rgba(201,169,98,0.55);
  color:var(--accent-gold);
  background:rgba(201,169,98,0.12);
}

/* Modal - Signature */
.ui-modal-root{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  z-index:9999;
  background:rgba(6,6,6,0.6);
  backdrop-filter:blur(16px);
}

.ui-modal-root.open{display:flex}

.ui-modal-backdrop{
  position:absolute;
  inset:0;
  background:linear-gradient(180deg, rgba(5,5,5,0.75), rgba(5,5,5,0.92));
}

.ui-modal{
  position:relative;
  z-index:1;
  width:min(860px,92vw);
  max-height:85vh;
  overflow:auto;
  background:linear-gradient(160deg, rgba(24,24,24,0.95), rgba(16,16,16,0.98));
  border:1px solid var(--border-medium);
  border-radius:var(--radius-2xl);
  padding:32px 36px;
  box-shadow:var(--shadow-lg);
}

.ui-modal::before{
  content:'';
  position:absolute;
  top:0;left:48px;right:48px;height:1px;
  background:linear-gradient(90deg, transparent, var(--accent-gold), transparent);
  opacity:0.35;
}

.ui-modal-title{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:24px;
  font-weight:600;
  margin-bottom:12px;
}

.ui-modal-body{
  display:flex;
  flex-direction:column;
  gap:16px;
}

.ui-modal-text{
  font-size:14px;
  color:var(--text-secondary);
  line-height:1.6;
}

.ui-modal-prompt{margin-bottom:10px}
.ui-modal-input{margin-top:4px}

.ui-modal-actions{
  display:flex;
  gap:14px;
  justify-content:flex-end;
  margin-top:24px;
  flex-wrap:wrap;
}

.ui-modal-btn{width:auto;min-width:140px}

.ui-modal-root.open .ui-modal{
  animation:modalIn 0.28s var(--ease-premium);
}

@keyframes modalIn{
  from{opacity:0;transform:translateY(12px) scale(0.98)}
  to{opacity:1;transform:translateY(0) scale(1)}
}

/* People page styles - Signature CRM */
.people-hero{
  display:flex;
  justify-content:space-between;
  gap:24px;
  align-items:flex-end;
  padding:36px;
  background:linear-gradient(140deg, rgba(24,24,24,0.98), rgba(14,14,14,0.95));
  border:1px solid var(--border-medium);
  border-radius:var(--radius-2xl);
  margin-bottom:24px;
  position:relative;
  overflow:hidden;
  box-shadow:var(--shadow-glow);
}

.people-hero::before{
  content:'';
  position:absolute;
  inset:0;
  background:
    radial-gradient(circle at 80% 20%, rgba(201,169,98,0.12), transparent 45%),
    radial-gradient(circle at 10% 80%, rgba(201,169,98,0.08), transparent 40%);
  opacity:0.9;
}

.people-title{position:relative;z-index:1}

.people-kicker{
  font-size:10px;
  color:var(--accent-gold);
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:0.24em;
}

.people-headline{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:30px;
  font-weight:600;
  margin-top:10px;
}

.people-subhead{
  font-size:13px;
  color:var(--text-muted);
  margin-top:10px;
  max-width:460px;
}

.people-stats{
  display:grid;
  grid-template-columns:repeat(3, minmax(140px, 1fr));
  gap:14px;
  position:relative;
  z-index:1;
}

.people-stat{
  background:rgba(18,18,18,0.85);
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-lg);
  padding:16px 20px;
  min-width:140px;
  box-shadow:var(--shadow-sm);
}

.people-stat-label{
  font-size:10px;
  color:var(--text-muted);
  text-transform:uppercase;
  letter-spacing:0.14em;
}

.people-stat-value{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:24px;
  font-weight:600;
  margin-top:8px;
}

.people-toolbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  padding:18px 22px;
  background:var(--bg-card);
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-xl);
  margin-bottom:20px;
}

.people-search{
  display:flex;
  align-items:center;
  gap:12px;
  flex:1;
  background:var(--bg-tertiary);
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-md);
  padding:6px 14px;
}

.people-search svg{
  width:18px;height:18px;
  stroke:var(--text-muted);
}

.people-search input{
  border:none;
  background:transparent;
  padding:10px 6px;
}

.people-search input:focus{box-shadow:none}

.people-toolbar-actions{
  display:flex;
  gap:12px;
}

.people-grid{
  display:grid;
  grid-template-columns:minmax(0, 1fr) 320px;
  gap:20px;
}

.people-panel{
  background:var(--bg-card);
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-xl);
  padding:22px;
  box-shadow:var(--shadow-sm);
}

.people-panel-head{
  display:flex;
  justify-content:space-between;
  gap:16px;
  margin-bottom:18px;
}

.people-panel-title{
  font-size:15px;
  font-weight:600;
  letter-spacing:0.02em;
}

.people-panel-sub{
  font-size:12px;
  color:var(--text-muted);
  margin-top:6px;
}

.people-filter{
  display:flex;
  flex-direction:column;
  gap:8px;
  min-width:160px;
}

.people-filter label{
  font-size:10px;
  color:var(--text-muted);
  text-transform:uppercase;
  letter-spacing:0.2em;
}

/* Person card */
.person-card{
  display:grid;
  grid-template-columns:1fr auto;
  gap:16px;
  padding:14px 18px;
  background:var(--bg-tertiary);
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-lg);
  margin-bottom:12px;
  transition:all 0.3s var(--ease-premium);
}

.person-card:hover{
  background:var(--bg-elevated);
  border-color:var(--border-medium);
  transform:translateY(-2px);
  box-shadow:var(--shadow-md);
}

.person-line{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.person-name{font-size:16px;font-weight:600}
.person-nick{font-weight:400;color:var(--text-secondary)}
.person-sub{font-size:12px;color:var(--text-muted)}
.person-divider{display:none}

.person-tags-inline{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
}

.person-side{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:8px;
}

.person-actions{
  display:grid;
  grid-auto-flow:column;
  gap:6px;
  justify-content:end;
}

.person-birthday{
  font-size:12px;
  font-weight:600;
  color:var(--success);
  letter-spacing:0.08em;
  text-transform:uppercase;
}

.person-birthday.muted{color:var(--text-muted)}

/* Tags */
.tag-pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 12px;
  border-radius:999px;
  background:rgba(201,169,98,0.12);
  border:1px solid var(--border-gold);
  color:var(--accent-gold);
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:0.12em;
}

.tag-pill.more{
  background:rgba(255,255,255,0.05);
  color:var(--text-secondary);
  border-color:var(--border-medium);
}

.tag-chip{
  border-radius:999px;
  border:1px solid var(--border-medium);
  background:rgba(255,255,255,0.04);
  color:var(--text-secondary);
  font-size:11px;
  padding:8px 14px;
  cursor:pointer;
  transition:all 0.2s var(--ease-premium);
}

.tag-chip:hover{border-color:var(--border-gold);color:var(--accent-gold)}
.tag-chip.active{
  border-color:var(--border-gold-strong);
  color:var(--accent-gold);
  background:rgba(201,169,98,0.14);
}

.tag-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:12px 14px;
  border-radius:var(--radius-md);
  border:1px solid var(--border-subtle);
  background:var(--bg-tertiary);
  margin-bottom:10px;
}

.tag-row-left{
  display:flex;
  align-items:center;
  gap:10px;
}

.tag-row-actions{
  display:flex;
  gap:8px;
}

/* People forms */
.people-form-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:16px;
}

.people-row{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:16px;
  margin-top:8px;
}

.people-bday{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}

.people-field{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.people-label{
  font-size:11px;
  color:var(--text-muted);
  text-transform:uppercase;
  letter-spacing:0.18em;
}

.people-textarea{
  min-height:120px;
  resize:vertical;
}

.tag-selector{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

/* Person profile */
.person-profile{
  display:flex;
  flex-direction:column;
  gap:16px;
}

.person-profile-header{
  padding-bottom:14px;
  border-bottom:1px solid var(--border-subtle);
}

.person-profile-name{
  font-size:22px;
  font-weight:600;
  font-family:'Cormorant Garamond',Georgia,serif;
}

.person-profile-meta{
  font-size:12px;
  color:var(--text-muted);
  margin-top:6px;
}

.person-profile-bday{
  font-size:12px;
  color:var(--success);
  margin-top:8px;
  text-transform:uppercase;
  letter-spacing:0.12em;
}

.person-profile-note{
  padding:14px 16px;
  background:var(--bg-tertiary);
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-md);
}

.person-note-title{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:0.18em;
  color:var(--text-muted);
}

.note-list{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.note-item{
  padding:14px 16px;
  background:var(--bg-tertiary);
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-md);
}

.note-content{
  font-size:13px;
  line-height:1.6;
}

.note-meta{
  font-size:11px;
  color:var(--text-muted);
  margin-top:8px;
}

.note-actions{
  display:flex;
  gap:8px;
  margin-top:10px;
}

/* Half widget */
.half-widget{
  margin-top:16px;
  padding:16px 18px;
  background:var(--bg-tertiary);
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-md);
  display:flex;
  flex-direction:column;
  gap:8px;
}

/* News grid */
.news-grid{
  display:grid;
  gap:18px;
}

@media(min-width:900px){.news-grid{grid-template-columns:1fr 1fr}}

/* News reader */
.news-reader{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  z-index:5000;
}
.news-reader.open{
  display:flex;
}
.news-reader-backdrop{
  position:absolute;
  inset:0;
  background:rgba(4,4,4,0.7);
  backdrop-filter:blur(6px);
}
.news-reader-panel{
  position:relative;
  width:min(1200px,94vw);
  max-height:88vh;
  background:var(--bg-card);
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-xl);
  box-shadow:0 30px 80px rgba(0,0,0,0.45);
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.news-reader-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  padding:16px 20px;
  border-bottom:1px solid var(--border-subtle);
}
.news-reader-label{
  text-transform:uppercase;
  font-size:10px;
  letter-spacing:0.2em;
  color:var(--text-muted);
}
.news-reader-title{
  font-size:18px;
  font-weight:600;
}
.news-reader-actions{
  display:flex;
  gap:10px;
}
.news-reader-body{
  display:flex;
  flex-direction:column;
  gap:12px;
  padding:16px 20px 20px;
}
.news-reader-body iframe{
  width:100%;
  height:70vh;
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-md);
  background:#0b0b0b;
}
.news-reader-hint{
  font-size:12px;
  color:var(--text-muted);
}

/* Book grid (legacy) */
.book-grid{display:grid;gap:20px}
@media(min-width:900px){.book-grid{grid-template-columns:1fr 1fr}}

/* Responsive */
@media(max-width:768px){
  .c{padding:22px 18px 90px}
  .h{padding:22px;border-radius:var(--radius-xl)}
  .t{font-size:38px}
  .quote{max-width:100%;text-align:left;margin-top:12px}
  .h-row{flex-direction:column;align-items:flex-start}
  .sec{padding:22px;margin-bottom:18px}
  .sh{flex-direction:column;align-items:flex-start;gap:12px;margin-bottom:18px;padding-bottom:14px}
  .news-controls{width:100%;display:flex;gap:8px;flex-wrap:wrap}
  .btn{width:100%}
  .btn.secondary{width:auto}
  .mini-tiles{grid-template-columns:repeat(2,1fr)}
  .quick-nav{
    display:flex;
    gap:10px;
    overflow-x:auto;
    padding:6px 2px 10px;
    scroll-snap-type:x mandatory;
    -webkit-overflow-scrolling:touch;
  }
  .quick-nav::-webkit-scrollbar{display:none}
  .nav-btn{
    min-width:110px;
    min-height:78px;
    padding:14px 12px;
    scroll-snap-align:start;
  }
  .nav-btn span:not(.nav-icon){font-size:10px}
  .people-hero{flex-direction:column;align-items:flex-start}
  .people-stats{width:100%;grid-template-columns:1fr 1fr}
  .people-toolbar{flex-direction:column;align-items:stretch}
  .people-grid{grid-template-columns:1fr}
  .people-panel-head{flex-direction:column;align-items:flex-start}
  .people-filter{width:100%}
  .people-form-grid{grid-template-columns:1fr}
  .people-row{grid-template-columns:1fr}
  .email-layout{grid-template-columns:1fr}
}

@media(max-width:480px){
  .c{padding:18px 14px 84px}
  .h{padding:18px}
  .t{font-size:32px}
  .g{font-size:10px}
  .d{font-size:12px}
  .sec{padding:18px}
  .nav-btn{min-width:100px;min-height:72px}
  .money-value{font-size:24px}
  .debt-bal{font-size:22px}
  .book-card{grid-template-columns:60px 1fr}
  .book-cover{width:60px}
  .people-stats{grid-template-columns:1fr}
  .people-toolbar-actions{flex-direction:column}
  .ui-modal{padding:20px 18px}
}

/* Animations - Refined, subtle */
@keyframes fadeIn{
  from{opacity:0;transform:translateY(8px)}
  to{opacity:1;transform:translateY(0)}
}

.sec,.nav-btn,.bill-item,.debt-item,.person-card,.news-card,.book-card{
  animation:fadeIn 0.5s var(--ease-premium) forwards;
}

/* Staggered animation delays */
.sec:nth-child(1){animation-delay:0.05s}
.sec:nth-child(2){animation-delay:0.1s}
.sec:nth-child(3){animation-delay:0.15s}
.sec:nth-child(4){animation-delay:0.2s}

/* Smooth scroll */
html{
  scroll-behavior:smooth;
}

/* Custom scrollbar - Refined */
::-webkit-scrollbar{
  width:6px;
  height:6px;
}

::-webkit-scrollbar-track{
  background:var(--bg-primary);
}

::-webkit-scrollbar-thumb{
  background:var(--border-subtle);
  border-radius:3px;
}

::-webkit-scrollbar-thumb:hover{
  background:var(--border-medium);
}

/* Selection color */
::selection{
  background:var(--accent-gold);
  color:var(--bg-primary);
}

/* Toast notifications - Premium style */
.toast{
  position:fixed;
  bottom:32px;
  right:32px;
  background:var(--bg-card);
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-md);
  padding:18px 24px;
  box-shadow:var(--shadow-lg);
  z-index:99999;
  animation:slideUp 0.4s var(--ease-premium);
}

.toast.success{border-color:rgba(74,222,128,0.3)}
.toast.error{border-color:rgba(248,113,113,0.3)}

@keyframes slideUp{
  from{opacity:0;transform:translateY(16px)}
  to{opacity:1;transform:translateY(0)}
}

/* Utility classes */
.text-gold{color:var(--accent-gold)}
.text-muted{color:var(--text-muted)}
.text-success{color:var(--success)}
.text-warning{color:var(--warning)}
.text-error{color:var(--error)}

.bg-gold{background:rgba(201,169,98,0.1)}
.border-gold{border-color:var(--border-gold)}

.font-serif{font-family:'Cormorant Garamond',Georgia,serif}
.font-medium{font-weight:500}
.font-semibold{font-weight:600}

.uppercase{text-transform:uppercase}
.tracking-wide{letter-spacing:0.1em}
.tracking-wider{letter-spacing:0.15em}

/* Dashboard grid for home */
.dashboard-grid{
  display:grid;
  gap:24px;
}

@media(min-width:900px){
  .dashboard-grid{
    grid-template-columns:1fr;
  }
}

/* Sunderland AFC Widget Styles */
.mini-table{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.mini-row{
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px 14px;
  background:var(--bg-tertiary);
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-sm);
  transition:all 0.2s var(--ease-premium);
}

.mini-row.highlight{
  background:rgba(201,169,98,0.1);
  border-color:var(--border-gold);
}

.mini-pos{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:16px;
  font-weight:600;
  color:var(--accent-gold);
  min-width:24px;
}

.mini-team{
  flex:1;
  font-size:13px;
  font-weight:500;
  color:var(--text-primary);
}

.mini-meta{
  font-size:12px;
  color:var(--text-muted);
  font-weight:500;
}

.stand-row{
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px 14px;
  background:var(--bg-tertiary);
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-sm);
  margin-bottom:6px;
}

.stand-row.highlight{
  background:rgba(201,169,98,0.1);
  border-color:var(--border-gold);
}

.stand-pos{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-size:15px;
  font-weight:600;
  color:var(--accent-gold);
  min-width:24px;
}

.stand-team{
  flex:1;
  font-size:13px;
  font-weight:500;
}

.stand-meta{
  font-size:12px;
  color:var(--text-muted);
}

.tile-sub{
  font-size:11px;
  color:var(--text-muted);
  margin-top:4px;
  text-transform:uppercase;
  letter-spacing:0.05em;
}
