/* =========================================================
   Base Styles
========================================================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --accent-a: #ff6a8b;
  --accent-b: #ff8a4b;
  --muted: #8b8f98;
  --bg: #f6f7fb;
  --radius: 16px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
}

body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: #1f2937;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =========================================================
   App Wrapper
========================================================= */
.app {
  display: flex;
  gap: 28px;
  width: 100%;
  max-width: 1400px;
  padding: 28px;
  margin: 0 auto;
  position: relative;
  overflow-x: hidden;
}

/* =========================================================
   Sidebar
========================================================= */
.sidebar {
  width: 220px;
  background: #fff;
  border-radius: 20px;
  padding: 24px 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 30px;
  transition: transform 0.32s cubic-bezier(.2, .9, .2, 1), opacity 0.32s ease;
  z-index: 60;
}

/* Sidebar: Mobile behavior */
@media (max-width: 1100px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    transform: translateX(-110%);
    opacity: 0;
    border-radius: 0;
    width: 260px;
    padding-top: 88px;
  }

  .sidebar.open {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
}

/* Navigation */
.nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: transform 0.18s ease, background 0.18s ease;
}

.nav-item span {
  line-height: 1;
}

.nav-item:hover {
  transform: translateX(4px);
  background: rgba(0, 0, 0, 0.04);
}

.nav-item.active {
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
  color: #fff;
  box-shadow: 0 8px 26px rgba(255, 75, 43, 0.12);
}

/* Sidebar Icons */
.icon {
  width: 20px;
  height: 20px;
  stroke-width: 2.6;
  stroke: currentColor;
  fill: none;
  flex-shrink: 0;
  transition: transform 0.18s ease, stroke 0.18s ease;
}

.nav-item:hover .icon {
  transform: scale(1.08);
}

.nav-item.active .icon {
  stroke: #fff;
}

/* =========================================================
   Main Area
========================================================= */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Topbar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

/* Hamburger Button */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--accent-a);
}

.hamburger-btn:focus {
  outline: 2px solid rgba(255, 106, 139, 0.2);
}

@media (max-width: 1100px) {
  .hamburger-btn {
    display: inline-flex;
  }
}

/* Hamburger Animation */
.hamburger-btn .hamburger-lines,
.hamburger-btn .hamburger-cross {
  transition: opacity 0.18s ease, transform 0.28s cubic-bezier(.2, .9, .2, 1);
  transform-origin: 12px 12px;
}

.hamburger-btn.active .hamburger-lines {
  opacity: 0;
  transform: scale(0.6) rotate(20deg);
}

.hamburger-btn.active .hamburger-cross {
  opacity: 1;
  transform: scale(1);
}

/* Title */
.title-block h1 {
  font-size: 20px;
  font-weight: 600;
}

.subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

/* User Info */
.user {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.avatar {
  width: 34px;
  height: 44px;
  border-radius: 20%;
  object-fit: cover;
}

/* =========================================================
   Canvas & Layout
========================================================= */
.canvas-inner {
  background: #fff;
  border-radius: 26px;
  padding: 34px;
  box-shadow: var(--shadow);
}

.grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 22px;
}

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

  .app {
    padding: 16px;
  }

  .canvas-inner {
    padding: 22px;
  }
}

/* =========================================================
   Cards
========================================================= */
.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.08);
}

/* =========================================================
   Profile Card
========================================================= */
.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 20px;
}

.profile-top {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-bottom: 12px;
}

.profile-image {
  width: 100%;
  max-width: 215px;
  height: auto;
  border-radius: 12px;
  object-fit: contain;
  object-position: center;
  background: #f4f4f4;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.profile-image:hover {
  transform: scale(1.03);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.profile-title {
  font-size: 25px;
  font-weight: 700;
  margin-bottom: 10px;
}

.profile-name {
  font-size: 20px;
  font-weight: 600;
}

.profile-contact,
.profile-email {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.sms-row {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ddd;
}

.status-dot.on {
  background: #22c55e;
}

/* Buttons */
.actions {
  margin-top: 18px;
}

.btn {
  border: none;
  cursor: pointer;
  font-weight: 600;
  border-radius: 20px;
  padding: 8px 14px;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
  color: #fff;
  margin-top: 14px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 75, 43, 0.18);
}

/* =========================================================
   Accounts & Bills
========================================================= */
.right-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
}

.btn-ghost {
  background: rgba(0, 0, 0, 0.04);
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 10px;
}

.account-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px dashed #f1f2f4;
  padding: 12px 0;
}

.account-item:first-child {
  border-top: none;
}

.account-number {
  font-family: monospace;
  font-size: 14px;
  letter-spacing: 2px;
  color: #111827;
  margin-top: 4px;
}

.btn-danger,
.btn-success {
  color: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
}

.btn-danger {
  background: #ff4b2b;
}

.btn-success {
  background: #22c55e;
}

/* =========================================================
/* --- THREE-COLUMN RESPONSIVE BILLS GRID --- */
.bills-grid {
  display: grid;
  grid-template-columns: 42% 42% 42%; /* first column slightly wider */
  gap: 50px;
  align-items: stretch;
}


/* Tablet view: two columns */
@media (max-width: 1000px) {
  .bills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile view: one column */
@media (max-width: 640px) {
  .bills-grid {
    grid-template-columns: 1fr;
  }
}

/* Make sure a single card still stretches full width even on large screens */
.bills-grid:has(> article:nth-child(1):last-child) {
  grid-template-columns: 1fr !important;
}

/* Equal height cards */
.bills-grid .card {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}


/* Bills List */
.bills-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bills-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border-radius: 10px;
  transition: background 0.14s ease;
}

.bills-list li:hover {
  background: #fafafa;
}

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

.status-dot.green { background: #22c55e; }
.status-dot.red { background: #ff4b2b; }

.pill {
  padding: 6px 12px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.pill.paid { background: #22c55e; }
.pill.unpaid { background: #ff4b2b; }

/* =========================================================
   Mobile Overlay
========================================================= */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 10, 12, 0.42);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
  z-index: 55;
}

.sidebar.open + .overlay,
.overlay[aria-hidden="false"],
.overlay:not([hidden]) {
  opacity: 1;
  visibility: visible;
}

    /* =========================================================
       Login Page Styles (added after main app styles)
    ========================================================= */
    body.login-page {
      background: linear-gradient(135deg, #3b5bdb, #d63384);
      display: flex;
      justify-content: center;
      align-items: center;
      height: 100vh;
      font-family: "Inter", sans-serif;
    }

    .login-container {
      background: #fff;
      border-radius: 16px;
      width: 800px;
      max-width: 90%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 40px 60px;
      box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    }

    .login-avatar {
      flex: 1;
      display: flex;
      justify-content: center;
    }

    .login-avatar img {
      width: 160px;
      height: 160px;
      border-radius: 50%;
      box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    }

    .login-form {
      flex: 1;
      display: flex;
      flex-direction: column;
      justify-content: center;
      padding-left: 40px;
    }

    .login-form h2 {
      font-size: 24px;
      font-weight: 700;
      margin-bottom: 24px;
      text-align: left;
    }

    .input-group {
      position: relative;
      margin-bottom: 18px;
    }

    .input-group input {
      width: 100%;
      box-sizing: border-box;
      padding: 12px 45px;
      border: none;
      border-radius: 25px;
      background: #f1f1f1;
      font-size: 15px;
      outline: none;
    }

    .input-group i {
      position: absolute;
      left: 16px;
      top: 50%;
      transform: translateY(-50%);
      color: #666;
      font-size: 16px;
    }

    .login-btn {
      background: #22c55e;
      border: none;
      color: #fff;
      font-weight: 600;
      border-radius: 25px;
      padding: 12px;
      cursor: pointer;
      transition: 0.2s ease;
      width: 100%;
    }

    .login-btn:hover {
      background: #1da851;
    }

    .forgot {
      text-align: center;
      margin-top: 14px;
      font-size: 14px;
    }

    .forgot a {
      color: #666;
      text-decoration: none;
    }

    .forgot a:hover {
      text-decoration: underline;
    }

    @media (max-width: 768px) {
      .login-container {
        flex-direction: column;
        padding: 30px;
      }

      .login-form {
        padding-left: 0;
        width: 100%;
      }

      .login-avatar {
        margin-bottom: 30px;
      }
    }

    @media (max-width: 768px) {
  .login-form h2 {
    text-align: center;
  }
}
/* Center align the heading with input fields */
.login-form h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
  text-align: left;
  margin-left: 6px; /* small shift to align visually with inputs */
}

/* On mobile, center the heading completely */
@media (max-width: 768px) {
  .login-form h2 {
    text-align: center;
    margin-left: 0;
  }
}
