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

:root {
  --bg: #f9fafb;
  --bg-card: #ffffff;
  --text: #111827;
  --subtext: #6b7280;
  --border: #e5e7eb;
  --green: #000000;
  --green-dark: #333333;
  --primary: #000000;
  --primary-hover: #333333;
  --sidebar-bg: #ffffff;
  --sidebar-text: #111827;
  --sidebar-hover: #f3f4f6;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius-md: 12px;
  --radius-lg: 16px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

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

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-right: 1px solid var(--border);
  z-index: 10;
}

.sidebar.collapsed {
  width: 80px;
}

.logo {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 40px;
  gap: 12px;
}

.logo img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.2);
}

.logo-text {
  font-weight: 700;
  font-size: 18px;
  color: white;
  transition: opacity 0.3s;
}

.sidebar.collapsed .logo-text {
  display: none;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 16px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--sidebar-text);
  font-size: 15px;
  font-weight: 500;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.nav a:hover, .nav a.active {
  background: var(--sidebar-hover);
  color: white;
  transform: translateX(4px);
}

.nav i {
  font-size: 18px;
  width: 24px;
  text-align: center;
  color: #94a3b8;
}

.nav a:hover i, .nav a.active i {
  color: var(--primary);
}

.sidebar.collapsed .nav span {
  display: none;
}

.sidebar.collapsed .nav a {
  justify-content: center;
  padding: 14px;
}
.sidebar.collapsed .nav a:hover {
  transform: translateX(0);
}

.sidebar.collapsed .nav i {
  margin: 0;
}

/* Main */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Navbar */
.navbar {
  height: 70px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 32px;
  justify-content: space-between;
  z-index: 5;
  box-shadow: var(--shadow-sm);
}

.menu-btn {
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1px solid var(--border);
  transition: all 0.2s;
  color: var(--text);
}

.menu-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.user-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  font-weight: 600;
  color: var(--text);
}

.user-nav img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
}

/* Content */
.content {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid rgba(226, 232, 240, 0.5);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card.gradient {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  border: none;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
}

.card.gradient h1 {
  color: white;
}

.card.gradient p {
  color: #bfdbfe;
}

/* Buttons */
.btn {
  background: var(--primary);
  color: white;
  padding: 10px 18px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

.btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: var(--bg);
  box-shadow: none;
  transform: none;
}

/* Table */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  color: var(--subtext);
  padding: 16px 8px;
  border-bottom: 2px solid var(--border);
}

td {
  padding: 16px 8px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

tbody tr {
  transition: background 0.2s;
}

tbody tr:hover {
  background: #f8fafc;
}

/* Headings & Text */
h1 {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -1px;
}

h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

p {
  font-size: 14px;
  color: var(--subtext);
  line-height: 1.6;
}

/* Dashboard Grid & Responsive */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.welcome-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 16px;
}

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

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    height: 100vh;
    z-index: 1000;
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }
  
  .sidebar.collapsed {
    transform: translateX(-100%);
  }

  .main {
    margin-left: 0;
  }

  .welcome-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .welcome-header h1 {
    font-size: 24px;
  }
}

/* Launch CRM polish */
:root {
  --accent: #00A651;
  --accent-dark: #008F45;
  --danger: #dc2626;
}

button, input, select {
  font: inherit;
}

input, select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline: none;
}

input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 166, 81, 0.14);
}

.logo-text {
  color: var(--text);
}

.nav a:hover, .nav a.active {
  background: #ecfdf3;
  color: var(--text);
}

.btn {
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
}

.btn:hover {
  background: var(--accent-dark);
  box-shadow: 0 8px 18px rgba(0, 166, 81, 0.18);
}

.btn-small {
  padding: 7px 12px;
  font-size: 13px;
}

.btn-danger {
  background: var(--danger);
}

.btn-danger:hover {
  background: #b91c1c;
}

.auth-page {
  min-height: 100vh;
  background: #f8fafc;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.auth-brand {
  background: #0b0f14;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px;
}

.auth-brand img {
  width: 112px;
  margin-bottom: 28px;
}

.auth-brand h1 {
  color: #fff;
  font-size: 42px;
  margin-bottom: 12px;
}

.auth-brand p {
  color: #d1d5db;
}

.auth-card {
  align-self: center;
  justify-self: center;
  width: min(430px, calc(100% - 32px));
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 34px;
  box-shadow: var(--shadow-md);
}

.auth-card h2 {
  margin-bottom: 8px;
}

.auth-card form,
.stack-form {
  display: grid;
  gap: 12px;
}

.back-link {
  display: inline-block;
  color: var(--subtext);
  font-size: 14px;
  margin-bottom: 18px;
}

.otp-input {
  text-align: center;
  font-size: 24px;
  letter-spacing: 5px;
  font-weight: 700;
}

.tiny {
  font-size: 12px;
  margin-top: 14px;
}

.admin-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
}

.admin-sidebar {
  background: #0b0f14;
  color: #fff;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-sidebar img {
  width: 92px;
  margin-bottom: 28px;
}

.admin-sidebar a {
  color: #e5e7eb;
  padding: 12px 14px;
  border-radius: 8px;
}

.admin-sidebar a.active,
.admin-sidebar a:hover {
  background: rgba(0, 166, 81, 0.18);
  color: #fff;
}

.admin-main,
.form-page {
  padding: 32px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.page-head h1 {
  font-size: 32px;
  letter-spacing: 0;
}

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 4px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}

.stat-card span {
  display: block;
  color: var(--subtext);
  font-size: 13px;
  margin-bottom: 8px;
}

.stat-card strong {
  font-size: 28px;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 24px;
  margin-bottom: 24px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px 16px;
  margin-top: 16px;
}

.detail-grid.wide {
  grid-template-columns: 120px 1fr 120px 1fr;
}

.detail-grid span {
  color: var(--subtext);
  font-size: 13px;
}

.alert {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 18px;
  font-weight: 600;
}

.alert.success {
  background: #ecfdf3;
  color: #027a48;
}

.alert.error {
  background: #fef2f2;
  color: #b42318;
}

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

.empty {
  text-align: center;
  color: var(--subtext);
  padding: 28px !important;
}

.document-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.document-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.document-item i {
  color: var(--accent);
}

.document-item small {
  color: var(--subtext);
}

.form-page {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.form-card {
  width: min(860px, 100%);
}

.grid-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.grid-form label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

.full {
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .auth-shell,
  .admin-layout,
  .two-column,
  .detail-grid.wide,
  .grid-form {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    min-height: 260px;
    padding: 32px;
  }

  .admin-sidebar {
    position: static;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
