/* ══ YUBA CLIENT PORTAL ══════════════════════════════════════ */
:root {
  --ypc-blue:   #334F9D;
  --ypc-purple: #4D4C9B;
  --ypc-green:  #009640;
  --ypc-border: #E2E8F0;
  --ypc-bg:     #F0F3FA;
  --ypc-surface:#fff;
  --ypc-text:   #1e293b;
  --ypc-muted:  #64748B;
  --ypc-radius: 10px;
  --ypc-shadow: 0 2px 12px rgba(51,79,157,.08);
}

#ypc-app * { box-sizing: border-box; font-family: Helvetica, Arial, sans-serif; }
#ypc-app { min-height: 100vh; background: var(--ypc-bg); }

/* ── LOGIN ── */
.ypc-login-wrap { max-width: 420px; margin: 60px auto; background: var(--ypc-surface); border-radius: 16px; box-shadow: 0 8px 40px rgba(51,79,157,.14); overflow: hidden; }
.ypc-login-header { background: linear-gradient(135deg,#334F9D,#4D4C9B); padding: 36px 32px 28px; text-align: center; color: #fff; }
.ypc-login-avatar { width: 72px; height: 72px; border-radius: 50%; border: 3px solid rgba(255,255,255,.4); object-fit: cover; margin-bottom: 14px; }
.ypc-login-title { font-family: Poppins, sans-serif; font-size: 22px; font-weight: 700; margin: 0 0 6px; }
.ypc-login-sub { font-size: 14px; color: rgba(255,255,255,.8); margin: 0; }
.ypc-login-form { padding: 28px 32px; }
.ypc-login-support { padding: 0 32px 24px; text-align: center; font-size: 13px; color: var(--ypc-muted); }
.ypc-login-support a { color: var(--ypc-blue); text-decoration: none; font-weight: 600; }

/* ── LAYOUT ── */
.ypc-layout { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }

/* ── SIDEBAR ── */
.ypc-sidebar { background: linear-gradient(180deg,#334F9D,#2b3f7e) !important; color: #fff !important; display: flex; flex-direction: column; padding: 0; }
.ypc-sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px 18px; border-bottom: 1px solid rgba(255,255,255,.12); }
.ypc-brand-avatar { width: 56px !important; height: 56px !important; border-radius: 50% !important; border: 3px solid rgba(255,255,255,.6) !important; object-fit: cover !important; flex-shrink: 0 !important; box-shadow: 0 0 0 2px rgba(255,255,255,.2) !important; display: block !important; overflow: hidden !important; }
.ypc-brand-name { font-family: Poppins, sans-serif !important; font-weight: 700 !important; font-size: 14px !important; color: #fff !important; }
.ypc-brand-role { font-size: 11px !important; color: rgba(255,255,255,.7) !important; margin-top: 2px !important; }

.ypc-user-info { padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,.12); }
.ypc-user-badge { background: rgba(255,255,255,.08); border-radius: 8px; padding: 10px 14px; }
.ypc-user-name { font-weight: 700 !important; font-size: 14px !important; color: #fff !important; }
.ypc-user-email { font-size: 12px !important; color: rgba(255,255,255,.7) !important; margin-top: 2px !important; }

.ypc-nav { padding: 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.ypc-nav-item { display: flex !important; align-items: center !important; gap: 10px !important; padding: 10px 14px !important; border-radius: 8px !important; color: rgba(255,255,255,.85) !important; text-decoration: none !important; font-size: 13px !important; font-weight: 600 !important; transition: all .15s !important; }
.ypc-nav-item svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }
.ypc-nav-item:hover { background: rgba(255,255,255,.1) !important; color: #fff !important; }
.ypc-nav-item.active { background: rgba(255,255,255,.18) !important; color: #fff !important; }

.ypc-sidebar-support { margin-top: auto; padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.12); }
.ypc-support-title { font-size: 11px !important; font-weight: 700 !important; text-transform: uppercase !important; letter-spacing: .6px !important; color: rgba(255,255,255,.6) !important; margin-bottom: 10px !important; }
.ypc-support-link { display: flex !important; align-items: center !important; gap: 8px !important; color: rgba(255,255,255,.9) !important; text-decoration: none !important; font-size: 13px !important; padding: 5px 0 !important; transition: color .15s !important; }
.ypc-support-link:hover { color: #fff !important; }
.ypc-logout-btn { margin-top: 14px; width: 100%; padding: 8px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); border-radius: 8px; color: rgba(255,255,255,.8); font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s; font-family: Helvetica, Arial, sans-serif; }
.ypc-logout-btn:hover { background: rgba(255,255,255,.2); color: #fff; }

/* ── MAIN ── */
.ypc-main { padding: 28px; overflow-y: auto; }
.ypc-welcome { margin-bottom: 22px; }
.ypc-welcome-title { font-family: Poppins, sans-serif; font-size: 22px; font-weight: 700; color: var(--ypc-text); margin: 0 0 4px; }

/* ── SECTIONS ── */
.ypc-section { background: var(--ypc-surface); border: 1px solid var(--ypc-border); border-radius: 12px; margin-bottom: 16px; overflow: hidden; box-shadow: var(--ypc-shadow); }
.ypc-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--ypc-muted); padding: 12px 18px; border-bottom: 1px solid var(--ypc-border); background: #F8FAFC; }
.ypc-proj-item { padding: 14px 18px; border-bottom: 1px solid var(--ypc-border); cursor: pointer; transition: background .15s; }
.ypc-proj-item:last-child { border-bottom: none; }
.ypc-proj-item:hover { background: #F0F6FF; }
.ypc-svc-item { padding: 12px 18px; border-bottom: 1px solid var(--ypc-border); }
.ypc-svc-item:last-child { border-bottom: none; }
.ypc-rem-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--ypc-border); flex-wrap: wrap; }
.ypc-rem-item:last-child { border-bottom: none; }
.ypc-doc-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--ypc-border); transition: background .15s; }
.ypc-doc-item:last-child { border-bottom: none; }
.ypc-doc-item:hover { background: #F0F6FF; }

/* ── FORMS ── */
.ypc-field { margin-bottom: 14px; }
.ypc-label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--ypc-muted); margin-bottom: 6px; }
.ypc-input { width: 100%; padding: 10px 14px; border: 1.5px solid var(--ypc-border); border-radius: 8px; font-size: 14px; color: var(--ypc-text); background: #fff; outline: none; transition: border-color .2s; font-family: Helvetica, Arial, sans-serif; }
.ypc-input:focus { border-color: var(--ypc-blue); }
.ypc-password-wrap { max-width: 480px; background: var(--ypc-surface); border-radius: 12px; padding: 24px; box-shadow: var(--ypc-shadow); }

/* ── BUTTONS ── */
.ypc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all .15s; border: 1.5px solid transparent; font-family: Helvetica, Arial, sans-serif; }
.ypc-btn--primary { background: var(--ypc-blue); border-color: var(--ypc-blue); color: #fff; }
.ypc-btn--primary:hover { background: #2a4080; border-color: #2a4080; }

/* ── ALERTS ── */
.ypc-alert { padding: 10px 14px; border-radius: 8px; font-size: 14px; }
.ypc-alert--error   { background: #FEE2E2; color: #DC2626; border: 1px solid #FCA5A5; }
.ypc-alert--success { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; }
.ypc-empty { text-align: center; padding: 40px; color: var(--ypc-muted); font-size: 15px; }

/* ── LOADING ── */
.ypc-loading { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 60px; color: var(--ypc-muted); }
.ypc-spinner { width: 36px; height: 36px; border: 3px solid #E2E8F0; border-top-color: var(--ypc-blue); border-radius: 50%; animation: ypc-spin .8s linear infinite; }
@keyframes ypc-spin { to { transform: rotate(360deg); } }

/* ── MODAL ── */
.ypc-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 20px; }
.ypc-modal { background: #fff; border-radius: 14px; width: 100%; max-width: 640px; max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 8px 40px rgba(0,0,0,.2); }
.ypc-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--ypc-border); }
.ypc-modal-header h3 { font-family: Poppins, sans-serif; font-size: 16px; font-weight: 700; margin: 0; color: var(--ypc-text); }
.ypc-modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--ypc-muted); line-height: 1; padding: 0 4px; }
.ypc-modal-body { flex: 1; overflow-y: auto; padding: 20px 22px; font-size: 14px; line-height: 1.75; color: var(--ypc-text); }
.ypc-modal-footer { padding: 14px 22px; border-top: 1px solid var(--ypc-border); display: flex; justify-content: flex-end; }

/* ── MOBILE ── */
@media (max-width: 768px) {
  .ypc-layout { grid-template-columns: 1fr; }
  .ypc-sidebar { min-height: auto; }
  .ypc-sidebar-support { display: none; }
  .ypc-main { padding: 16px; }
  .ypc-login-wrap { margin: 20px; }
}

/* ══ 2-COLUMN GRID ════════════════════════════════════════ */
.ypc-grid-2 {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 16px !important;
  margin-bottom: 0 !important;
}
.ypc-grid-2 > div { min-width: 0 !important; }
.ypc-grid-2 .ypc-section { margin-bottom: 16px !important; height: 100% !important; }

@media (max-width: 640px) {
  .ypc-grid-2 { grid-template-columns: 1fr !important; }
}

/* ══ GRID ROWS SPACING ════════════════════════════════════ */
.ypc-grid-2 + .ypc-grid-2 {
  margin-top: 16px !important;
}

/* ══ MOBILE SIDEBAR — hamburger + overlay ═════════════════ */
.ypc-topbar {
  display: none !important;
  align-items: center !important;
  gap: 12px !important;
  background: linear-gradient(135deg,#334F9D,#2b3f7e) !important;
  padding: 12px 16px !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 100 !important;
}
.ypc-hamburger {
  background: none !important;
  border: none !important;
  cursor: pointer !important;
  padding: 4px !important;
  color: #fff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}
.ypc-hamburger svg { width: 24px !important; height: 24px !important; fill: #fff !important; }
.ypc-topbar-title {
  font-family: Poppins, sans-serif !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  color: #fff !important;
}
.ypc-sidebar-overlay {
  display: none !important;
  position: fixed !important;
  inset: 0 !important;
  background: rgba(0,0,0,.5) !important;
  z-index: 200 !important;
}
.ypc-sidebar-overlay.open { display: block !important; }

@media (max-width: 768px) {
  .ypc-topbar { display: flex !important; }

  .ypc-layout { grid-template-columns: 1fr !important; }

  .ypc-sidebar {
    position: fixed !important;
    left: -280px !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 270px !important;
    z-index: 300 !important;
    transition: left .25s ease !important;
    overflow-y: auto !important;
  }
  .ypc-sidebar.open { left: 0 !important; }

  .ypc-sidebar-support { display: flex !important; flex-direction: column !important; }

  .ypc-main { padding: 14px !important; }
}
