:root {
  --bg: #0f0f10;
  --panel: #1a1a1d;
  --text: #e6e6e7;
  --sub: #aaaaad;
  --border: rgba(255, 255, 255, 0.07);
}

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

a { color: var(--text); text-decoration: none; }

.container { max-width: 1100px; margin: 0 auto; padding: 1.25rem; }
.header { display:flex; align-items:center; justify-content:space-between; padding: 1rem 0; }
.brand { 
  font-weight:700; 
  letter-spacing:.5px; 
  transition: letter-spacing 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
              text-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.brand-dot {
  display: inline-block;
  margin-left: 0.1rem;
  color: currentColor;
  animation: brandDotPulse 4.2s ease-in-out infinite;
  transform-origin: center;
  opacity: 0.92;
}
@keyframes brandDotPulse {
  0%, 100% {
    transform: translateY(0) scale(1);
    opacity: 0.92;
  }
  50% {
    transform: translateY(-0.5px) scale(1.05);
    opacity: 1;
  }
  75% {
    transform: translateY(0) scale(0.98);
    opacity: 0.85;
  }
}
.brand:hover { 
  letter-spacing: 1.2px;
  text-shadow: 0 0 12px rgba(102, 126, 234, 0.6),
               0 0 24px rgba(118, 75, 162, 0.4);
}
.nav a { margin-left:1rem; }

.dashboard-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.85rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.dashboard-link__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 6px rgba(74, 222, 128, 0.08);
}

.dashboard-link__text {
  letter-spacing: 0.1px;
}

.dashboard-link i {
  font-size: 1.1rem;
  display: flex;
  align-items: center;
}

.dashboard-link:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28), 0 0 20px rgba(102, 126, 234, 0.25);
}

.dashboard-link:focus-visible {
  outline: 2px solid rgba(102, 126, 234, 0.55);
  outline-offset: 3px;
}

.dashboard-link:active {
  transform: translateY(0);
}

/* Google Sign-In Button - Official Google Code */
.gsi-material-button {
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-appearance: none;
  appearance: none;
  background-color: #f2f2f2;
  background-image: none;
  border: none;
  -webkit-border-radius: 20px;
  border-radius: 20px;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  color: #1f1f1f;
  cursor: pointer;
  font-family: 'Roboto', arial, sans-serif;
  font-size: 14px;
  height: 40px;
  letter-spacing: 0.25px;
  outline: none;
  overflow: hidden;
  padding: 0 12px;
  position: relative;
  text-align: center;
  -webkit-transition: background-color .218s, border-color .218s, box-shadow .218s;
  transition: background-color .218s, border-color .218s, box-shadow .218s;
  vertical-align: middle;
  white-space: nowrap;
  width: auto;
  max-width: 400px;
  min-width: min-content;
  text-decoration: none;
  display: inline-block;
}

.gsi-material-button .gsi-material-button-icon {
  height: 20px;
  margin-right: 12px;
  min-width: 20px;
  width: 20px;
}

.gsi-material-button .gsi-material-button-content-wrapper {
  -webkit-align-items: center;
  align-items: center;
  display: flex;
  -webkit-flex-direction: row;
  flex-direction: row;
  -webkit-flex-wrap: nowrap;
  flex-wrap: nowrap;
  height: 100%;
  justify-content: space-between;
  position: relative;
  width: 100%;
}

.gsi-material-button .gsi-material-button-contents {
  -webkit-flex-grow: 1;
  flex-grow: 1;
  font-family: 'Roboto', arial, sans-serif;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
}

.gsi-material-button .gsi-material-button-state {
  -webkit-transition: opacity .218s;
  transition: opacity .218s;
  bottom: 0;
  left: 0;
  opacity: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.gsi-material-button:disabled {
  cursor: default;
  background-color: #ffffff61;
}

.gsi-material-button:disabled .gsi-material-button-state {
  background-color: #1f1f1f1f;
}

.gsi-material-button:disabled .gsi-material-button-contents {
  opacity: 38%;
}

.gsi-material-button:disabled .gsi-material-button-icon {
  opacity: 38%;
}

.gsi-material-button:not(:disabled):active .gsi-material-button-state, 
.gsi-material-button:not(:disabled):focus .gsi-material-button-state {
  background-color: #001d35;
  opacity: 12%;
}

.gsi-material-button:not(:disabled):hover {
  -webkit-box-shadow: 0 1px 2px 0 rgba(60, 64, 67, .30), 0 1px 3px 1px rgba(60, 64, 67, .15);
  box-shadow: 0 1px 2px 0 rgba(60, 64, 67, .30), 0 1px 3px 1px rgba(60, 64, 67, .15);
}

.gsi-material-button:not(:disabled):hover .gsi-material-button-state {
  background-color: #001d35;
  opacity: 8%;
}

.layout { display:flex; min-height: 100dvh; }
.sidebar {
  width: 240px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0;
  position: sticky;
  top: .75rem; 
  height: calc(100dvh - 1.5rem); 
  box-sizing: border-box;
  margin: .75rem;
  box-shadow: 0 6px 24px rgba(0,0,0,.35);
  display: flex; 
  flex-direction: column;
  overflow: hidden;
}
.content { 
  flex:1; 
  padding:2rem; 
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 1.25rem; }
.btn { display:inline-block; background: var(--text); color: var(--bg); border:1px solid var(--border); border-radius: 12px; padding:.75rem 1rem; font-weight:600; }
.btn:disabled { opacity:.6; cursor: not-allowed; }
.muted { color: var(--sub); }

.legal-page {
  max-width: 780px;
  margin: 0 auto;
  padding: 2rem 0 3rem;
  line-height: 1.6;
}

.legal-header {
  text-align: left;
  margin-bottom: 2rem;
}

.legal-header h1 {
  margin-bottom: 0.5rem;
}

.legal-section {
  margin-bottom: 2rem;
}

.legal-section h2 {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.legal-section ul {
  margin: 0.5rem 0 0 1.25rem;
  padding: 0;
  color: var(--sub);
}

.legal-section li {
  margin-bottom: 0.35rem;
}

.legal-links-footer {
  padding: 3rem 0 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  margin-top: 3rem;
}

.legal-links-footer .legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 0.75rem;
}

.legal-links-footer .legal-links a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
}

.legal-links-footer .legal-links a:hover {
  text-decoration: underline;
}

.legal-links-footer .legal-meta {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
  font-size: 0.9375rem;
}

.legal-table th,
.legal-table td {
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.75rem;
  text-align: left;
  vertical-align: top;
}

.legal-table th {
  background: rgba(255, 255, 255, 0.04);
  font-weight: 600;
}

/* Sidebar Header */
.sidebar-header {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar .brand {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.5px;
  color: var(--text);
  margin: 0;
  transition: letter-spacing 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
              text-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar .brand:hover {
  letter-spacing: 1.2px;
  text-shadow: 0 0 12px rgba(102, 126, 234, 0.6),
               0 0 24px rgba(118, 75, 162, 0.4);
}

/* Upgrade Banner */
.sidebar-upgrade-banner {
  margin: 1rem 0.5rem;
  padding: 1.75rem 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(102, 126, 234, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.sidebar-upgrade-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.sidebar-upgrade-banner::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 100%
  );
  animation: shine 30s infinite;
  pointer-events: none;
  z-index: 2;
}

@keyframes shine {
  0% {
    left: -100%;
  }
  1% {
    left: 100%;
  }
  1.01% {
    left: -100%;
  }
  100% {
    left: -100%;
  }
}

.sidebar-upgrade-banner:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 32px rgba(102, 126, 234, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

.sidebar-upgrade-banner:hover::before {
  opacity: 1;
}

.upgrade-banner-content {
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.upgrade-text {
  text-align: center;
}

.upgrade-title {
  font-weight: 700;
  font-size: 1.125rem;
  color: white;
  margin-bottom: 0.5rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.upgrade-subtitle {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.upgrade-button {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 0 !important;
  background: white;
  color: #667eea;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
  line-height: 1.2;
  position: relative;
  z-index: 1;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.upgrade-button::after {
  content: '→';
  margin-left: 0.5rem;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
}

.upgrade-button:hover {
  background: #f8f9ff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2), 0 4px 8px rgba(0, 0, 0, 0.15);
  color: #5568d3;
}

.upgrade-button:hover::after {
  transform: translateX(4px);
}

.upgrade-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Sidebar Navigation */
.sidebar .nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 0.75rem;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  color: var(--sub);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
  margin: 0 0.5rem;
}

.nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--text);
  border-radius: 0 2px 2px 0;
  transition: height 0.2s ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.nav-link:hover::before {
  height: 60%;
}

.nav-link.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-weight: 600;
}

.nav-link.active::before {
  height: 70%;
}

.nav-link-text {
  flex: 1;
}

.nav-link-logout {
  margin-top: auto;
}

.sidebar .nav-sep {
  height: 1px;
  background: var(--border);
  margin: 1rem 0.75rem;
  flex-shrink: 0;
}

.sidebar .nav-sep-light {
  height: 1px;
  background: rgba(255, 255, 255, 0.03);
  margin: 0.75rem 0.75rem;
  flex-shrink: 0;
}

/* Sidebar bottom action */
.sidebar-actions { margin-top: auto; }
.sync-link {
  display:block; text-align:center; margin-top:.75rem; padding:.6rem .7rem; border-radius:12px;
  border: 1px dashed rgba(255,255,255,.25); color: var(--text);
  background: rgba(255,255,255,.03);
  transition: background .15s ease, border-color .15s ease;
}
.sync-link:hover { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.4); }

/* Forms */
.form { display:block; }
.form-row { margin-bottom: .9rem; }
.form-row label { display:block; margin-bottom: .4rem; color: var(--sub); font-size: .95rem; }
.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="password"],
.form-row textarea, .form-row select {
  width: 100%;
  background: #121214;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .7rem .8rem;
  outline: none;
}
.form-errors { color:#ff8a8a; margin: .25rem 0 .5rem; font-size: .9rem; }

/* Flash Messages */
.flash-message {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  color: var(--text);
}

.flash-success {
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.3);
  color: rgba(74, 222, 128, 0.9);
}

.flash-danger {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.3);
  color: rgba(248, 113, 113, 0.9);
}

/* Responsive Sidebar */
@media (max-width: 1024px) {
  .sidebar {
    width: 220px;
  }
}

/* Mobile Header */
.mobile-header {
  display: none;
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem;
  align-items: center;
  gap: 1rem;
}

.mobile-menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  justify-content: center;
  align-items: center;
  transition: opacity 0.2s ease;
  position: relative;
  z-index: 101;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.mobile-menu-toggle:hover {
  opacity: 0.8;
}

.hamburger-line {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-brand {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: 0.5px;
  color: var(--text);
  flex: 1;
}

.mobile-menu-overlay {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  visibility: hidden;
}

.mobile-menu-overlay.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.sidebar-close {
  display: none;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.sidebar-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
  .mobile-header {
    display: flex;
  }

  .layout {
    flex-direction: column;
  }
  
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    max-width: 85vw;
    height: 100dvh;
    margin: 0;
    border-radius: 0;
    border: none;
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    overflow-y: auto;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
  }

  .sidebar.mobile-open {
    transform: translateX(0) !important;
  }
  
  .sidebar-header {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .sidebar-close {
    display: flex;
  }
  
  .sidebar-upgrade-banner {
    margin: 1rem 0.75rem;
    padding: 1.25rem 1rem;
  }
  
  .upgrade-title {
    font-size: 0.95rem;
  }
  
  .upgrade-subtitle {
    font-size: 0.8rem;
  }
  
  .sidebar .nav {
    flex-direction: column;
    overflow-x: visible;
    padding: 1rem 0.75rem;
    gap: 0.25rem;
  }
  
  .nav-link {
    white-space: normal;
    margin: 0 0.5rem;
    padding: 0.75rem 1rem;
  }
  
  .nav-link::before {
    display: block;
  }
  
  .sidebar .nav-sep {
    display: block;
  }
  
  .nav-link-logout {
    margin-top: auto;
    margin-left: 0.5rem;
  }
  
  .content {
    padding: 1.5rem 1rem;
    margin-top: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .mobile-menu-overlay {
    display: block;
  }
}

/* Utilities */
.center { display:flex; align-items:center; justify-content:center; }
.full-height { min-height: calc(100dvh - 100px); }


