/* --------------------------------------------------------
   Delisyo — Global Styles
   -------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand:       #E63946;
  --brand-dark:  #C1121F;
  --brand-light: #FFE8E9;
  --gray-50:     #F9FAFB;
  --gray-100:    #F3F4F6;
  --gray-200:    #E5E7EB;
  --gray-400:    #9CA3AF;
  --gray-600:    #4B5563;
  --gray-800:    #1F2937;
  --white:       #FFFFFF;
  --radius:      8px;
  --shadow:      0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:   0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  min-height: 100vh;
}

/* ---- Navbar ---- */
.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-brand {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--brand);
  text-decoration: none;
  letter-spacing: -0.5px;
}
.navbar-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.navbar-links a {
  color: var(--gray-600);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  transition: color .15s;
}
.navbar-links a:hover, .navbar-links a.active { color: var(--brand); }
.navbar-divider { width: 1px; height: 20px; background: var(--gray-200); }
.navbar-user { font-size: .85rem; font-weight: 500; color: var(--gray-800); }
.plan-badge {
  font-size: .68rem; font-weight: 600; padding: .15rem .45rem;
  border-radius: 4px; letter-spacing: .3px;
  background: var(--gray-100); color: var(--gray-600);
}
.plan-badge--baslangic {
  background: #DBEAFE; color: #1E40AF;
}
.plan-badge--premium {
  background: #FEF3C7; color: #92400E;
}
.plan-badge--pro {
  background: var(--brand-light); color: var(--brand-dark);
}
.navbar-profile-link { font-size: .8rem; color: var(--gray-600) !important; }

/* ---- Main ---- */
.main-content { padding: 2rem; max-width: 1100px; margin: 0 auto; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem 1.2rem;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background .15s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn-primary    { background: var(--brand); color: var(--white); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary  { background: var(--gray-100); color: var(--gray-800); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-danger     { background: #FEE2E2; color: #B91C1C; }
.btn-danger:hover { background: #FECACA; }
.btn-ghost      { background: transparent; color: var(--gray-600); border: 1px solid var(--gray-200); }
.btn-ghost:hover { background: var(--gray-100); }
.btn-sm         { padding: .4rem .8rem; font-size: .8rem; }
.btn-lg         { padding: .8rem 1.6rem; font-size: 1rem; }
.btn-block      { width: 100%; justify-content: center; }
.btn-google     { background: var(--white); color: var(--gray-800); border: 1px solid var(--gray-200); }
.btn-google:hover { background: var(--gray-50); }

/* ---- Cards ---- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.card-header h2 { font-size: 1.1rem; font-weight: 600; }

/* ---- Page Header ---- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.page-header h1 { font-size: 1.5rem; font-weight: 700; }

/* ---- Auth Forms ---- */
.auth-wrapper {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.auth-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
}
.auth-card h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: .4rem; }
.auth-card p { color: var(--gray-600); font-size: .9rem; margin-bottom: 1.5rem; }
.auth-divider {
  display: flex; align-items: center; gap: 1rem;
  margin: 1.2rem 0; color: var(--gray-400); font-size: .8rem;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--gray-200);
}
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: .85rem; color: var(--gray-600); }
.auth-footer a { color: var(--brand); text-decoration: none; font-weight: 500; }

/* ---- Forms ---- */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .85rem; font-weight: 500; margin-bottom: .3rem; color: var(--gray-800); }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: .6rem .8rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: .9rem;
  font-family: inherit;
  background: var(--white);
  transition: border-color .15s;
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--brand); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ---- Error / Alert ---- */
.alert { padding: .75rem 1rem; border-radius: var(--radius); font-size: .85rem; margin-bottom: 1rem; }
.alert-error { background: #FEE2E2; color: #B91C1C; border: 1px solid #FECACA; display: none; }

/* ---- Table ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; padding: .7rem 1rem; border-bottom: 2px solid var(--gray-200); font-weight: 600; color: var(--gray-600); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
td { padding: .75rem 1rem; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-50); }
.table-actions { display: flex; gap: .5rem; }

/* ---- Empty State ---- */
.empty-state { text-align: center; padding: 4rem 2rem; color: var(--gray-400); }
.empty-state h3 { font-size: 1.1rem; font-weight: 600; color: var(--gray-600); margin-bottom: .5rem; }
.empty-state p { font-size: .9rem; margin-bottom: 1.5rem; }

/* ---- Dashboard Stats ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 1.5rem; }
.stat-card .stat-value { font-size: 2rem; font-weight: 700; color: var(--brand); }
.stat-card .stat-label { font-size: .85rem; color: var(--gray-600); margin-top: .2rem; }

/* ---- Badge ---- */
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 500; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }
.badge-brand { background: var(--brand-light); color: var(--brand); }

/* ---- Views Editor ---- */
.editor-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; }
.product-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--white);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.product-card:hover { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }
.product-card.selected { border-color: var(--brand); background: var(--brand-light); }
.product-card .product-name { font-weight: 600; font-size: .9rem; margin-bottom: .2rem; }
.product-card .product-price { color: var(--brand); font-weight: 600; font-size: .85rem; }
.product-card .product-unit { color: var(--gray-400); font-size: .75rem; }

/* ---- Landing Page ---- */
.hero {
  text-align: center;
  padding: 6rem 2rem;
}
.hero h1 { font-size: 3rem; font-weight: 700; margin-bottom: 1rem; letter-spacing: -1px; }
.hero h1 span { color: var(--brand); }
.hero p { font-size: 1.1rem; color: var(--gray-600); margin-bottom: 2rem; max-width: 500px; margin-left: auto; margin-right: auto; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; }

/* ---- Hamburger toggle ---- */
.navbar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: .3rem;
  color: var(--gray-600);
  align-items: center;
  justify-content: center;
}
.navbar-toggle:hover { color: var(--brand); }

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .editor-layout { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
  .navbar { padding: 0 1rem; }
  .main-content { padding: 1rem; }

  .navbar-toggle { display: flex; }

  .navbar-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-md);
    flex-direction: column;
    padding: .5rem 1rem 1rem;
    gap: 0 !important;
    z-index: 99;
  }
  .navbar-links.open { display: flex; }

  .navbar-links a {
    padding: .75rem .25rem;
    border-bottom: 1px solid var(--gray-100);
    font-size: .95rem !important;
    color: var(--gray-800) !important;
    width: 100%;
  }
  .navbar-links a:last-child { border-bottom: none; }

  .navbar-links .btn-primary {
    margin-top: .5rem;
    justify-content: center;
    color: #fff !important;
  }
  .navbar-links .btn-ghost {
    border: none;
    color: var(--gray-800) !important;
    padding-left: .25rem;
  }

  .navbar-links .navbar-divider { display: none; }

  /* logged-in user info row */
  .navbar-links > div {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    padding: .75rem .25rem;
    border-bottom: 1px solid var(--gray-100);
  }
}
