/* =============================================================
   PULSE POINT DIGITAL SOLUTIONS - CRM STYLESHEET
   Brand colors: Green #2ea043 | Orange #f79009
   ============================================================= */

:root {
  --pp-green: #2ea043;
  --pp-green-dark: #1f7a33;
  --pp-green-light: #e8f5ec;
  --pp-orange: #f79009;
  --pp-orange-dark: #d97706;
  --pp-orange-light: #fef3e2;
  --pp-black: #0d1117;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --surface-3: #e6e9ef;
  --border: #e1e4ea;
  --border-strong: #c9ced8;
  --text: #0d1117;
  --text-dim: #57606a;
  --text-mute: #8b94a3;
  --success: #16a34a;
  --warning: #f79009;
  --danger: #dc2626;
  --info: #0969da;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 1px 3px rgba(13,17,23,.04), 0 1px 2px rgba(13,17,23,.06);
  --shadow-md: 0 4px 12px rgba(13,17,23,.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

input, select, textarea {
  font-family: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  width: 100%;
  outline: none;
  transition: border-color .15s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--pp-green);
  box-shadow: 0 0 0 3px rgba(46,160,67,.1);
}

textarea { resize: vertical; min-height: 80px; }

label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-weight: 600;
}

a { color: var(--info); text-decoration: none; }

/* ============ LOGIN SCREEN ============ */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #f7f8fa 0%, #e8f5ec 50%, #fef3e2 100%);
  position: relative;
  overflow: hidden;
}

.login-wrap::before {
  content: "";
  position: absolute;
  top: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(46,160,67,.15), transparent 70%);
}

.login-wrap::after {
  content: "";
  position: absolute;
  bottom: -100px;
  left: -100px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(247,144,9,.15), transparent 70%);
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(13,17,23,.1);
  position: relative;
  z-index: 1;
}

.logo-block { text-align: center; margin-bottom: 28px; }
.logo-img { height: 72px; margin-bottom: 8px; max-width: 100%; }
.logo-tagline {
  font-size: 10px;
  color: var(--text-mute);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 600;
}

.login-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; text-align: center; }
.login-sub { color: var(--text-dim); margin-bottom: 24px; font-size: 13px; text-align: center; }

.role-tabs {
  display: flex;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 22px;
}

.role-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  transition: all .15s;
  cursor: pointer;
  text-decoration: none;
  display: block;
}

.role-tab.active { background: var(--pp-green); color: #fff; box-shadow: var(--shadow); }
.role-tab.active.orange { background: var(--pp-orange); }

.form-group { margin-bottom: 16px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  transition: all .15s;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary { background: var(--pp-green); color: #fff; width: 100%; padding: 12px; }
.btn-primary:hover { background: var(--pp-green-dark); }

.btn-orange { background: var(--pp-orange); color: #fff; }
.btn-orange:hover { background: var(--pp-orange-dark); }

.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface-2); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { color: var(--text-dim); padding: 6px 10px; font-size: 13px; }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-icon { padding: 8px; border-radius: 8px; width: 36px; height: 36px; }

.error-msg {
  background: rgba(220,38,38,.08);
  color: var(--danger);
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid rgba(220,38,38,.2);
}

.success-msg {
  background: rgba(22,163,74,.08);
  color: var(--success);
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid rgba(22,163,74,.2);
}

.hint {
  background: linear-gradient(135deg, var(--pp-green-light), var(--pp-orange-light));
  border: 1px solid rgba(46,160,67,.2);
  padding: 12px;
  border-radius: 10px;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 20px;
  line-height: 1.6;
}

.hint b { color: var(--text); display: block; margin-bottom: 4px; }
.hint code { background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 3px; font-family: monospace; }

/* ============ APP LAYOUT ============ */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 0 8px 16px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo img { height: 38px; }

.sidebar-brand {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.sidebar-brand small {
  display: block;
  font-size: 9px;
  color: var(--text-mute);
  letter-spacing: 1px;
  font-weight: 500;
  margin-top: 2px;
}

.nav-section {
  font-size: 10px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 12px 12px 6px 12px;
  font-weight: 700;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
  width: 100%;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.nav-item:hover { background: var(--surface-2); color: var(--text); }

.nav-item.active {
  background: linear-gradient(135deg, var(--pp-green), var(--pp-green-dark));
  color: #fff;
  font-weight: 600;
}

.nav-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.sidebar-footer { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }

.user-card { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; }

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pp-green), var(--pp-orange));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.avatar-lg { width: 48px; height: 48px; font-size: 16px; }

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-mute); }

.main { padding: 24px 32px; overflow-x: hidden; }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title { font-size: 24px; font-weight: 700; letter-spacing: -0.5px; }
.page-sub { color: var(--text-dim); font-size: 13px; margin-top: 3px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .15s;
}

.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 8px;
  font-weight: 700;
}

.stat-value { font-size: 28px; font-weight: 800; letter-spacing: -1px; color: var(--text); }
.stat-sub { font-size: 11px; color: var(--text-mute); margin-top: 4px; }

.stat-accent {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.acc-green { background: var(--pp-green-light); color: var(--pp-green-dark); }
.acc-orange { background: var(--pp-orange-light); color: var(--pp-orange-dark); }
.acc-blue { background: #dbeafe; color: #1e40af; }
.acc-red { background: #fee2e2; color: #b91c1c; }
.acc-purple { background: #f3e8ff; color: #7c3aed; }

.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.two-col-even { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

@media (max-width: 900px) {
  .two-col, .two-col-even, .three-col { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -240px; top: 0; width: 240px; z-index: 50; transition: left .2s; }
  .sidebar.open { left: 0; }
  .main { padding: 16px; }
  .mobile-toggle { display: inline-flex; }
}

.mobile-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 40;
  background: var(--pp-green);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}

.clock-display {
  font-size: 40px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -2px;
  background: linear-gradient(135deg, var(--pp-green), var(--pp-orange));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
}

.clock-date { text-align: center; color: var(--text-dim); font-size: 13px; margin-top: 4px; }

.activity-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.activity-text { font-size: 13px; flex: 1; }
.activity-time { font-size: 11px; color: var(--text-mute); margin-top: 2px; }

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  margin-right: 4px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

.empty { text-align: center; padding: 40px 20px; color: var(--text-mute); }
.empty-icon { font-size: 36px; margin-bottom: 10px; opacity: .4; }
.empty-title { font-size: 14px; font-weight: 600; color: var(--text-dim); margin-bottom: 4px; }
.empty-sub { font-size: 12px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  white-space: nowrap;
}

.b-success { background: rgba(22,163,74,.12); color: var(--pp-green-dark); }
.b-warning { background: rgba(247,144,9,.15); color: var(--pp-orange-dark); }
.b-danger { background: rgba(220,38,38,.1); color: var(--danger); }
.b-info { background: rgba(9,105,218,.1); color: var(--info); }
.b-gray { background: var(--surface-3); color: var(--text-dim); }

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--pp-orange);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}
