@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

body { background: #F9EBEF; font-family: 'Plus Jakarta Sans', sans-serif; margin: 0; padding: 20px; color: #1A1A1A; display: flex; justify-content: center; align-items: center; min-height: 100vh; box-sizing: border-box; }
.dashboard-wrapper { display: flex; width: 100%; max-width: 1250px; height: 90vh; min-height: 700px; background: #FCF5F6; border-radius: 30px; box-shadow: 0 30px 60px rgba(160, 24, 44, 0.08); overflow: hidden; }

.sidebar { width: 250px; background: transparent; padding: 35px 25px; overflow-y: auto; flex-shrink: 0; }
.brand { font-size: 22px; font-weight: 800; color: #1A1A1A; margin-bottom: 40px; display: flex; align-items: center; gap: 10px; padding-left: 10px; }
.brand span { color: #A0182C; }
.nav-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #8C8C94; margin: 30px 0 10px 10px; font-weight: 700; }
.nav-item { display: block; padding: 12px 18px; text-decoration: none; color: #6A6A72; border-radius: 50px; margin-bottom: 5px; font-size: 14px; font-weight: 600; transition: all 0.3s ease; }
.nav-item:hover { background: rgba(160, 24, 44, 0.05); color: #1A1A1A; }
.nav-item.active { background: #A0182C; color: #FFFFFF; box-shadow: 0 8px 20px rgba(160, 24, 44, 0.25); }

/* Hamburger button — hidden on desktop */
.hamburger { display: none; flex-direction: column; justify-content: center; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; border-radius: 10px; }
.hamburger span { display: block; width: 22px; height: 2.5px; background: #1A1A1A; border-radius: 3px; transition: 0.3s; }
/* Top row inside sidebar (brand + hamburger) */
.sidebar-top { display: flex; align-items: center; justify-content: space-between; }

.main-area { flex: 1; padding: 45px 55px; display: flex; flex-direction: column; overflow-y: auto; background: transparent; min-width: 0; }
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; }
.header h1 { font-size: 24px; margin: 0; color: #1A1A1A; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.header-user { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 12px; color: #1A1A1A; background: #FFFFFF; padding: 8px 16px; border-radius: 50px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); white-space: nowrap; }
.avatar { width: 32px; height: 32px; background: #A0182C; border-radius: 50%; display: inline-block; flex-shrink: 0; }

.calc-layout { display: flex; gap: 40px; flex: 1; }
.calc-input { flex: 1; background: #FFFFFF; padding: 35px; border-radius: 24px; box-shadow: 0 10px 40px rgba(160, 24, 44, 0.04); min-width: 0; }
.calc-results { width: 320px; background: #FFFFFF; padding: 35px; border-radius: 24px; display: flex; flex-direction: column; align-items: center; box-shadow: 0 10px 40px rgba(160, 24, 44, 0.04); flex-shrink: 0; }

.calc-input h2 { font-size: 26px; margin-top: 0; margin-bottom: 8px; color: #1A1A1A; font-weight: 800; }
.calc-input > p { color: #8C8C94; font-size: 14px; margin-bottom: 35px; font-weight: 500; }
.input-group { margin-bottom: 25px; }
.input-group label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 12px; color: #4A4A52; }
.input-group label span { color: #1A1A1A; font-weight: 800; float: right; font-size: 15px; }

input[type="range"] { -webkit-appearance: none; width: 100%; height: 6px; background: #F0E2E4; border-radius: 10px; outline: none; margin-top: 5px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #A0182C; cursor: pointer; border: 3px solid #FFF; box-shadow: 0 2px 8px rgba(160, 24, 44, 0.4); }

input[type="number"], select { width: 100%; padding: 14px 18px; background: #FCF5F6; border: 1px solid #EAE0E2; border-radius: 16px; font-size: 16px; font-weight: 700; color: #1A1A1A; box-sizing: border-box; margin-top: 5px; font-family: 'Plus Jakarta Sans', sans-serif; transition: 0.3s; }
input[type="number"]:focus, select:focus { outline: none; border-color: #A0182C; background: #FFFFFF; box-shadow: 0 0 0 4px rgba(160, 24, 44, 0.1); }

.segment-group { display: flex; background: #FCF5F6; border-radius: 50px; padding: 6px; margin-bottom: 10px; border: 1px solid #EAE0E2; }
.segment-btn { flex: 1; padding: 12px; border: none; background: transparent; border-radius: 50px; font-weight: 700; color: #8C8C94; cursor: pointer; transition: 0.3s; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 13px; }
.segment-btn.active { background: #FFFFFF; color: #A0182C; box-shadow: 0 4px 12px rgba(160, 24, 44, 0.08); }

.btn-calc { width: 100%; padding: 18px; background: #A0182C; color: white; border: none; border-radius: 50px; font-size: 16px; font-weight: 800; cursor: pointer; margin-top: 10px; transition: 0.3s; font-family: 'Plus Jakarta Sans', sans-serif; box-shadow: 0 8px 20px rgba(160, 24, 44, 0.25); }
.btn-calc:hover { transform: translateY(-3px); background: #8A1325; box-shadow: 0 12px 25px rgba(160, 24, 44, 0.35); }

.calc-results h3 { font-size: 16px; color: #1A1A1A; margin-top: 0; text-align: center; width: 100%; margin-bottom: 30px; font-weight: 800; }
.result-circle { width: 170px; height: 170px; border-radius: 50%; background: #fff; border: 12px solid #FCF5F6; display: flex; flex-direction: column; justify-content: center; align-items: center; box-shadow: 0 10px 30px rgba(160, 24, 44, 0.06); margin-bottom: 35px; }
.result-circle span { font-size: 11px; font-weight: 700; color: #8C8C94; text-transform: uppercase; letter-spacing: 0.5px; }
.result-circle h2 { font-size: 28px; font-weight: 800; color: #1A1A1A; margin: 8px 0; letter-spacing: -1px; }

.mini-cards { display: flex; gap: 15px; width: 100%; justify-content: space-between; }
.mini-card { background: #FCF5F6; padding: 18px 12px; border-radius: 16px; flex: 1; text-align: center; border: 1px solid #EAE0E2; }
.mini-card span { display: block; font-size: 11px; color: #8C8C94; font-weight: 700; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.mini-card strong { font-size: 18px; color: #1A1A1A; font-weight: 800; }

.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; width: 100%; margin-top: 25px; }
.home-card { background: #FFFFFF; padding: 20px; border-radius: 20px; text-decoration: none; color: #1A1A1A; transition: all 0.3s ease; border: 1px solid #EAE0E2; box-shadow: 0 8px 25px rgba(160, 24, 44, 0.02); display: flex; align-items: center; gap: 20px; position: relative; overflow: hidden; }
.home-card:hover { transform: translateY(-4px); box-shadow: 0 15px 35px rgba(160, 24, 44, 0.08); border-color: #F0E2E4; }
.card-icon { width: 55px; height: 55px; border-radius: 16px; background: #FCF5F6; display: flex; justify-content: center; align-items: center; font-size: 24px; flex-shrink: 0; color: #A0182C; transition: 0.3s; }
.home-card:hover .card-icon { background: #A0182C; }
.card-content { flex: 1; }
.card-content h4 { margin: 0 0 5px 0; font-size: 16px; color: #1A1A1A; font-weight: 800; }
.card-content p { margin: 0; font-size: 13px; color: #8C8C94; line-height: 1.4; font-weight: 600; }
.card-arrow { color: #EAE0E2; font-weight: bold; font-size: 20px; transition: 0.3s; transform: translateX(-15px); opacity: 0; padding-right: 10px; }
.home-card:hover .card-arrow { color: #A0182C; transform: translateX(0); opacity: 1; }
.section-title { font-size: 14px; font-weight: 800; color: #A0182C; margin: 40px 0 10px 0; text-transform: uppercase; letter-spacing: 1px; border-bottom: 2px dashed #EAE0E2; padding-bottom: 10px; }

.seo-article { margin-top: 40px; background: #FFFFFF; padding: 40px; border-radius: 24px; box-shadow: 0 10px 40px rgba(160, 24, 44, 0.04); color: #4A4A52; line-height: 1.8; font-size: 15px; }
.seo-article h2 { color: #1A1A1A; font-weight: 800; font-size: 22px; margin-bottom: 15px; margin-top: 0; }
.seo-article h3 { color: #1A1A1A; font-weight: 800; font-size: 18px; margin-top: 25px; margin-bottom: 10px; }

.footer { margin-top: 40px; padding-top: 20px; border-top: 2px dashed #EAE0E2; text-align: center; color: #8C8C94; font-size: 12px; font-weight: 600; line-height: 1.6; }
.footer p { margin: 5px 0; }
.footer a { color: #A0182C; text-decoration: none; font-weight: 800; transition: 0.3s; }
.footer a:hover { text-decoration: underline; }

/* =============================================
   TABLET — ≤ 1024px
   ============================================= */
@media (max-width: 1024px) {
  body { padding: 15px; }
  .dashboard-wrapper { height: auto; min-height: 100vh; border-radius: 20px; }
  .sidebar { width: 200px; padding: 25px 15px; }
  .main-area { padding: 30px 25px; }
  .calc-layout { flex-direction: column; gap: 20px; }
  .calc-results { width: 100%; box-sizing: border-box; }
  .home-grid { grid-template-columns: 1fr 1fr; }
}

/* =============================================
   MOBILE — ≤ 768px
   ============================================= */
@media (max-width: 768px) {
  body { padding: 0; align-items: flex-start; background: #FCF5F6; }

  .dashboard-wrapper {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    border-radius: 0;
    box-shadow: none;
    width: 100%;
    max-width: 100%;
  }

  /* Sidebar becomes a collapsible top bar */
  .sidebar {
    width: 100%;
    box-sizing: border-box;
    padding: 0;
    overflow: visible;
    background: #FFFFFF;
    border-bottom: 1px solid #EAE0E2;
    box-shadow: 0 2px 10px rgba(160,24,44,0.06);
  }

  .sidebar-top {
    padding: 14px 18px;
  }

  .brand { margin-bottom: 0; padding-left: 0; font-size: 19px; }

  /* Show hamburger */
  .hamburger { display: flex; }

  /* Nav hidden by default; .open class reveals it */
  .sidebar nav {
    display: none;
    padding: 8px 14px 14px;
    border-top: 1px solid #EAE0E2;
  }
  .sidebar.open nav { display: block; }

  .nav-title { margin: 14px 0 5px 8px; }
  .nav-item { padding: 9px 14px; font-size: 14px; border-radius: 12px; margin-bottom: 2px; }

  /* Main content */
  .main-area { padding: 18px 16px 30px; }

  .header { margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
  .header h1 { font-size: 19px; }
  .header-user { font-size: 12px; padding: 6px 12px; gap: 8px; }

  /* Stack calculator panels */
  .calc-layout { flex-direction: column; gap: 14px; }

  .calc-input { padding: 20px 16px; border-radius: 18px; }
  .calc-input h2 { font-size: 20px; }
  .calc-input > p { font-size: 13px; margin-bottom: 18px; }

  /* Fix inline-flex two-column rows inside calculators */
  .input-row-flex { flex-direction: column !important; gap: 0 !important; }

  .calc-results {
    width: 100%;
    box-sizing: border-box;
    padding: 20px 16px;
    border-radius: 18px;
  }

  .result-circle { width: 140px; height: 140px; border-width: 10px; margin-bottom: 24px; }
  .result-circle h2 { font-size: 22px; }

  .mini-cards { gap: 8px; }
  .mini-card { padding: 12px 8px; border-radius: 12px; }
  .mini-card strong { font-size: 15px; }

  /* Dashboard grid: single column */
  .home-grid { grid-template-columns: 1fr; gap: 10px; margin-top: 10px; }
  .home-card { padding: 14px 16px; border-radius: 14px; gap: 12px; }
  .card-icon { width: 44px; height: 44px; font-size: 20px; border-radius: 12px; }
  .card-content h4 { font-size: 14px; }
  .card-content p { font-size: 12px; }
  /* Always visible arrow on touch */
  .card-arrow { transform: translateX(0); opacity: 1; }

  .section-title { font-size: 11px; margin: 22px 0 8px; }
  .seo-article { padding: 20px 16px; border-radius: 16px; font-size: 14px; margin-top: 20px; }
  .seo-article h2 { font-size: 17px; }
  .seo-article h3 { font-size: 15px; }

  .btn-calc { padding: 15px; font-size: 15px; }
  .segment-btn { padding: 9px 5px; font-size: 12px; }
  .footer { font-size: 11px; margin-top: 20px; }
}

/* =============================================
   SMALL PHONES — ≤ 380px
   ============================================= */
@media (max-width: 380px) {
  .mini-cards { flex-direction: column; }
  .result-circle { width: 120px; height: 120px; }
  .result-circle h2 { font-size: 18px; }
}
