/* =========================================================
   Life ERP - Premium Stylesheet (v2)
   Purple/Violet SaaS theme — Zoho/Odoo-inspired premium look.
   Supports LTR (English/Malayalam) and RTL (Arabic)
   ========================================================= */

:root {
  --sidebar-bg: #1c1533;
  --sidebar-bg-2: #241a45;
  --sidebar-bg-hover: #2f2358;
  --accent: #7c3aed;
  --accent-2: #a855f7;
  --accent-dark: #6d28d9;
  --accent-soft: #f3edfe;
  --text-light: #f3f0fb;
  --text-muted: #a99fc9;
  --bg-page: #f7f6fc;
  --card-bg: #ffffff;
  --border: #ece8f7;
  --danger: #e0455a;
  --warning: #d69e2e;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(76, 29, 149, 0.06);
  --shadow-md: 0 4px 14px rgba(76, 29, 149, 0.08), 0 1px 3px rgba(76, 29, 149, 0.06);
  --shadow-lg: 0 20px 48px rgba(45, 15, 99, 0.18);
  --font: 'Plus Jakarta Sans', 'Noto Sans Malayalam', 'Noto Sans Arabic', -apple-system, 'Segoe UI', Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg-page);
  color: #241c3d;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
h1, h2, h3, h4 { letter-spacing: -0.01em; }

/* ---------------- Layout Shell ---------------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

[dir="rtl"] .app-shell { flex-direction: row-reverse; }

.sidebar {
  width: 270px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  z-index: 10;
}

.sidebar-brand {
  padding: 24px 22px;
  font-size: 19px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 11px;
  letter-spacing: -0.01em;
}

.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent-dark));
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.45);
  flex-shrink: 0;
}

.brand-logo-img {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: contain;
  flex-shrink: 0;
  background: #fff;
  padding: 3px;
  box-shadow: 0 3px 10px rgba(124, 58, 237, 0.35);
}

.auth-logo {
  display: block;
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(124, 58, 237, 0.28));
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-light);
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
  transition: background 0.15s, transform 0.1s;
}

.sidebar-nav a:hover { background: var(--sidebar-bg-hover); }
.sidebar-nav a.active {
  background: linear-gradient(135deg, var(--accent-2), var(--accent-dark));
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}
.sidebar-nav a.locked { color: var(--text-muted); }
.sidebar-nav a.locked .lock-icon { margin-inline-start: auto; opacity: 0.7; font-size: 12px; }

.sidebar-footer {
  padding: 16px 22px;
  font-size: 11.5px;
  color: var(--text-muted);
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* ---------------- Main content ---------------- */
.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 16px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar h1 { font-size: 21px; margin: 0; font-weight: 700; }

.lang-switch { display: flex; gap: 6px; }
.lang-switch a {
  padding: 6px 13px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.lang-switch a.active { background: linear-gradient(135deg, var(--accent-2), var(--accent-dark)); color: #fff; border-color: transparent; }

.page-body { padding: 28px 30px; }

.trial-banner {
  background: linear-gradient(135deg, #fdf6e3, #fdf0d5);
  border: 1px solid #ecc94b;
  color: #8a6d1a;
  padding: 13px 20px;
  border-radius: var(--radius);
  margin-bottom: 22px;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.trial-banner.expired { background: linear-gradient(135deg, #fdecec, #fbe0e0); border-color: var(--danger); color: #8a2323; }

/* ---------------- Cards / Grid ---------------- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.module-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s;
}
.module-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.module-card.locked { opacity: 0.65; }
.module-card .badge {
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent-dark));
  color: #fff;
  letter-spacing: 0.02em;
}
.module-card .badge.locked-badge { background: #cbc3e0; color: #453a6b; }

/* ---------------- Auth pages (login/signup/forgot) ---------------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 20%, #3d2778, #1c1533 60%);
  padding: 20px;
}

.auth-box {
  background: var(--card-bg);
  width: 100%;
  max-width: 420px;
  border-radius: 20px;
  padding: 38px 34px;
  box-shadow: var(--shadow-lg);
}

.auth-box h2 { margin-top: 0; font-weight: 800; }
.auth-box .tagline { color: var(--text-muted); font-size: 14px; margin-bottom: 26px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #453a6b; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.14);
}

.btn {
  display: inline-block;
  width: 100%;
  padding: 12px 18px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent-dark));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3);
  transition: transform 0.1s, box-shadow 0.15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(124, 58, 237, 0.4); }
.btn:active { transform: translateY(0); }
.btn.btn-outline { background: transparent; color: var(--accent-dark); border: 1.5px solid var(--accent); box-shadow: none; }
.btn.btn-outline:hover { background: var(--accent-soft); }
.btn.btn-danger { background: linear-gradient(135deg, #ef5164, var(--danger)); }
.btn.btn-sm { width: auto; padding: 9px 16px; font-size: 13px; }

.auth-links { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-muted); }
.auth-links a { color: var(--accent-dark); font-weight: 700; }

.alert {
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
}
.alert-success { background: #eafaf0; color: #1a7a45; border: 1px solid #b8ebc9; }
.alert-error { background: #fdecee; color: #b12b3c; border: 1px solid #f6c1c9; }

/* ---------------- Tables ---------------- */
.data-table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data-table th, table.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: start;
}
table.data-table th { background: #fbfaff; font-weight: 700; color: #6b5f96; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.02em; }
table.data-table tr:last-child td { border-bottom: none; }

/* status pills */
.pill { display:inline-block; padding: 4px 11px; border-radius: 20px; font-size: 11.5px; font-weight: 700; }
.pill-trial { background:#fdf3d8; color:#8a6d1a; }
.pill-active { background:#e3f9ea; color:#1a7a45; }
.pill-expired, .pill-locked { background:#fdecee; color:#b12b3c; }

@media (max-width: 768px) {
  .sidebar { position: fixed; inset-inline-start: -280px; top: 0; bottom: 0; z-index: 50; transition: inset-inline-start 0.2s; width: 260px; }
  .sidebar.open { inset-inline-start: 0; }
  .page-body { padding: 18px 16px; }
  .topbar { padding: 14px 16px; }
  .topbar h1 { font-size: 18px; }
  .card { padding: 18px; }
  .auth-box { padding: 30px 24px; border-radius: 16px; }
  table.data-table { font-size: 13px; }
  table.data-table th, table.data-table td { padding: 9px 10px; }
}
