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

:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --border: #e5e7eb;
  --muted: #64748b;
  --primary: #1d4ed8;
  --primary-100: #e0edff;
  --sidebar-bg: #ffffff;
  --sidebar-border: #e6e9f2;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

body {
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 220, 90, 0.12), transparent 45%),
    radial-gradient(circle at 100% 10%, rgba(59, 130, 246, 0.12), transparent 42%),
    linear-gradient(180deg, #f9fbff 0%, #f3f6fb 100%);
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: #0f172a;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 18px;
  position: relative;
  overflow: hidden;
}
.auth-shell::before,
.auth-shell::after {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, rgba(37, 99, 235, 0.18), rgba(14, 165, 233, 0.05));
  filter: blur(2px);
}
.auth-shell::before { top: -140px; right: -120px; }
.auth-shell::after { bottom: -160px; left: -120px; }
.auth-container {
  width: 100%;
  max-width: 640px;
  position: relative;
  z-index: 1;
}
.auth-header {
  margin: 0 auto 16px;
  max-width: 560px;
  text-align: left;
}
.auth-logo {
  width: 180px;
  height: 64px;
  display: block;
  object-fit: contain;
}
.auth-card-header {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}
.auth-card .auth-form {
  margin-top: 4px;
}
.auth-header h1 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.auth-card {
  border-radius: 20px;
  backdrop-filter: blur(4px);
  animation: rise-in 0.6s ease-out;
  width: 100%;
  margin: 0 auto;
  padding: 1.1rem 1.25rem;
}
.auth-card-compact {
  max-width: 440px;
}
.auth-card-wide {
  max-width: 960px;
}
.auth-form {
  width: 100%;
}
.auth-form .form-control,
.auth-form .form-select {
  height: 38px;
  padding: 6px 10px;
}
.auth-form textarea.form-control {
  height: auto;
}
.auth-form .form-control:focus,
.auth-form .form-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}
.form-grid .form-label { font-weight: 600; }
@keyframes rise-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.app-shell { display:flex; min-height:100vh; }
.main { flex:1; padding:28px 32px 40px; }

.sidebar {
  width:260px;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 210, 77, 0.18), transparent 45%),
    linear-gradient(180deg, #ffffff 0%, #f7f9ff 100%);
  border-right:1px solid var(--sidebar-border);
  padding:22px 18px 18px;
  display:flex;
  flex-direction:column;
  gap:18px;
  position:sticky;
  top:0;
  height:100vh;
}

.brand { display:flex; align-items:center; gap:12px; margin-bottom:6px; }
.brand-link {
  display: inline-flex;
}
.brand-mark {
  width:38px;
  height:38px;
  border-radius:12px;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color:#fff;
  font-weight:700;
  display:flex;
  align-items:center;
  justify-content:center;
}
.brand-name { font-weight:700; letter-spacing:0.4px; }
.brand-sub { font-size:0.8rem; color:var(--muted); }
.brand-logo {
  width: 210px;
  height: 72px;
  display: block;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}

.sidebar-section {
  font-size:0.7rem;
  text-transform:uppercase;
  letter-spacing:0.16em;
  color:var(--muted);
  font-weight:700;
  margin-top:6px;
}
.nav-link {
  color:#1f2937;
  border-radius:14px;
  padding:9px 12px;
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:600;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.nav-link:hover,
.nav-link.active {
  background: #e9f1ff;
  color: #1d4ed8;
  transform: translateX(2px);
}

.sidebar-footer {
  margin-top:auto;
  border-top:1px solid var(--sidebar-border);
  padding-top:16px;
  display:flex;
  align-items:center;
  gap:10px;
}
.profile-menu { position:relative; width:100%; }
.profile-toggle {
  display:flex;
  align-items:flex-start;
  gap:10px;
  background:transparent;
  border:0;
  padding:0;
  width:100%;
  text-align:left;
  cursor:pointer;
}
.profile-toggle .profile-meta {
  display:flex;
  flex-direction:column;
  min-width:0;
  line-height:1.2;
}
.profile-name {
  font-size:0.95rem;
  font-weight:600;
  color:#0f172a;
}
.profile-email {
  font-size:0.85rem;
  color:var(--muted);
  word-break:break-word;
}
.profile-dropdown {
  position:absolute;
  left:0;
  bottom:56px;
  min-width:220px;
  background:#fff;
  border:1px solid var(--border);
  border-radius:14px;
  box-shadow:var(--shadow);
  padding:10px;
  display:none;
  z-index:20;
}
.profile-dropdown.open { display:block; }
.profile-dropdown a {
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 10px;
  border-radius:10px;
  color:#0f172a;
  text-decoration:none;
  font-weight:600;
}
.profile-dropdown a:hover { background:#f1f5f9; }
.profile-dropdown .logout { color:#dc2626; }
.avatar {
  width:36px;
  height:36px;
  border-radius:12px;
  background:#0ea5e9;
  color:#fff;
  font-weight:700;
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
}

.topbar { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:16px; flex-wrap:wrap; }
.page-title { font-size:1.6rem; font-weight:700; margin:0; }
.eyebrow { text-transform:uppercase; letter-spacing:0.18em; font-size:0.7rem; color:var(--muted); font-weight:700; }

.card { border:1px solid var(--border); border-radius:18px; box-shadow:var(--shadow); background:var(--surface); }
.small-muted { color: var(--muted); font-size:.9rem; }
.hr-soft { border:0; border-top:1px solid var(--border); margin:18px 0; }
.logo { width:72px; height:72px; border:1px solid var(--border); border-radius:14px; object-fit:contain; padding:8px; background:#fff; }
.badge-soft {
  display:inline-flex;
  align-items:center;
  padding:4px 10px;
  border-radius:999px;
  background:#e0f2fe;
  color:#0369a1;
  font-size:.75rem;
  font-weight:700;
  letter-spacing:.04em;
}

.invoice-wrap { background:#fff; border:1px solid var(--border); border-radius:18px; padding:24px; }
.table thead th { background:#f3f6fb; font-weight:600; }

@media (max-width: 992px) {
  .app-shell { flex-direction:column; }
  .sidebar {
    width:100%;
    height:auto;
    position:relative;
    border-right:none;
    border-bottom:1px solid var(--sidebar-border);
  }
  .main { padding:22px 18px 32px; }
}

@media (max-width: 768px) {
  .topbar { align-items:flex-start; }
  .page-title { font-size:1.35rem; }
  .invoice-wrap { padding:18px; }
}
@media (max-width: 576px) {
  .auth-shell { padding: 20px 14px; }
  .auth-shell::before,
  .auth-shell::after {
    width: 220px;
    height: 220px;
  }
  .auth-shell::before { top: -120px; right: -120px; }
  .auth-shell::after { bottom: -140px; left: -120px; }
  .auth-container { max-width: 100%; }
  .auth-header { text-align: center; margin-bottom: 12px; }
  .auth-card { padding: 1rem 1rem; }
  .auth-logo { width: 150px; height: 54px; }
  .auth-form .d-flex { flex-direction: column; gap: 10px; }
  .auth-form .btn { width: 100%; }

  .sidebar { padding: 16px 14px 14px; }
  .brand-logo { width: 170px; height: auto; }
  .nav-link { padding: 8px 10px; border-radius: 12px; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .page-title { font-size: 1.2rem; }
  .main { padding: 18px 14px 28px; }
  .card { border-radius: 14px; }
  .invoice-wrap { padding: 14px; }
}
@media print {
  body { background:white; }
  .no-print { display:none !important; }
  .print-hide { display:none !important; }
  .sidebar { display:none !important; }
  .main { padding:0; }
  .app-shell { display:block; }
  .card { box-shadow:none; border:0; }
  .invoice-wrap {
    box-shadow:none !important;
    border:0 !important;
    padding:0 !important;
    margin:0 !important;
    background:transparent !important;
  }
  .invoice-wrap [class^="tpl"] .page,
  .invoice-wrap [class*=" tpl"] .page {
    margin:0 !important;
    page-break-after:auto !important;
    break-after:auto !important;
  }
  .table-responsive { overflow: visible !important; }
  .table-invoice thead th {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}


