/* KaamEasy — Premium Client Dashboard (scoped) */

/* Override global client_style.css `header` (dark bar) on this page only */
.cd-dash > header.cd-header {
  background: rgba(255, 255, 255, 0.92) !important;
  color: inherit !important;
  padding: 14px 24px !important;
}

.cd-dash > header.cd-header .cd-logo {
  color: #0b7f73 !important;
}

.cd-dash > header.cd-header .cd-nav-desktop a,
.cd-dash > header.cd-header .cd-nav-mobile a {
  color: #64748b !important;
}

.cd-dash > header.cd-header .cd-nav-desktop a:hover {
  color: #0b7f73 !important;
}

.cd-dash > header.cd-header .cd-nav-desktop a.is-active {
  color: #0b7f73 !important;
}

.cd-dash > header.cd-header .cd-logout {
  color: #b91c1c !important;
}

.cd-dash {
  --cd-green: #0f9d8f;
  --cd-green-dark: #0b7f73;
  --cd-blue: #1273de;
  --cd-text: #0f172a;
  --cd-muted: #64748b;
  --cd-surface: #ffffff;
  --cd-bg: #f0f7f6;
  --cd-border: #e2ebe9;
  --cd-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  --cd-shadow-hover: 0 12px 40px rgba(15, 23, 42, 0.1);
  --cd-radius: 16px;
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
  color: var(--cd-text);
  background: var(--cd-bg);
  min-height: 100vh;
  margin: 0;
}

.cd-dash * {
  box-sizing: border-box;
}

/* Header */
.cd-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--cd-border);
}

.cd-logo {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--cd-green-dark);
  text-decoration: none;
}

.cd-logo:hover {
  color: var(--cd-green);
}

.cd-nav-desktop {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cd-nav-desktop a {
  color: var(--cd-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 10px;
  transition: color 0.2s, background 0.2s;
}

.cd-nav-desktop a:hover {
  color: var(--cd-green-dark);
  background: rgba(15, 157, 143, 0.08);
}

.cd-nav-desktop a.is-active {
  color: var(--cd-green-dark);
  background: rgba(15, 157, 143, 0.12);
}

.cd-nav-desktop .cd-logout {
  color: #b91c1c;
}

.cd-nav-desktop .cd-logout:hover {
  background: #fef2f2;
  color: #991b1b;
}

.cd-menu-btn {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--cd-border);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font-size: 1.25rem;
  align-items: center;
  justify-content: center;
}

.cd-nav-mobile {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border-bottom: 1px solid var(--cd-border);
  padding: 12px 16px 20px;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
}

.cd-nav-mobile.is-open {
  display: flex;
}

.cd-nav-mobile a {
  padding: 12px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--cd-text);
  font-weight: 600;
  font-size: 0.95rem;
}

.cd-nav-mobile a:hover {
  background: #f1f5f9;
}

.cd-header-wrap {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

@media (max-width: 1024px) {
  .cd-nav-desktop {
    display: none;
  }
  .cd-menu-btn {
    display: inline-flex;
  }
}

@media (max-width: 640px) {
  /* Mobile: keep header a single compact row */
  .cd-dash > header.cd-header {
    padding: 12px 14px !important;
  }

  .cd-header-wrap {
    gap: 10px;
    flex-wrap: nowrap;
  }

  .cd-logo {
    font-size: 1.12rem;
    white-space: nowrap;
  }

  .cd-menu-btn {
    width: 44px;
    height: 40px;
    border-radius: 12px;
  }

  .cd-nav-mobile {
    padding: 10px 12px 14px;
    max-height: 70vh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Main */
.cd-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px 56px;
}

/* Hero */
.cd-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 28px 28px 32px;
  border-radius: 20px;
  background: linear-gradient(135deg, #e8f7f3 0%, #f0f9ff 45%, #ffffff 100%);
  border: 1px solid var(--cd-border);
  box-shadow: var(--cd-shadow);
  margin-bottom: 28px;
}

@media (max-width: 640px) {
  .cd-hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 24px 20px;
  }
}

.cd-greeting {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cd-green-dark);
  margin: 0 0 8px;
}

.cd-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 4vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.cd-hero .cd-sub {
  margin: 0;
  color: var(--cd-muted);
  font-size: 1rem;
  max-width: 480px;
}

.cd-hero .cd-sub strong {
  color: var(--cd-text);
  font-weight: 700;
}

.cd-avatar {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: linear-gradient(145deg, var(--cd-green), var(--cd-blue));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(15, 157, 143, 0.35);
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .cd-avatar {
    margin: 0 auto;
  }
}

.cd-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.cd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.cd-btn-primary {
  background: linear-gradient(135deg, var(--cd-green), #17b897);
  color: #fff;
  box-shadow: 0 8px 22px rgba(15, 157, 143, 0.35);
}

.cd-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15, 157, 143, 0.4);
}

.cd-btn-secondary {
  background: #fff;
  color: var(--cd-green-dark);
  border: 1px solid var(--cd-border);
}

.cd-btn-secondary:hover {
  border-color: var(--cd-green);
  background: #f8fffe;
}

/* Stats */
.cd-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

@media (max-width: 768px) {
  .cd-stats {
    grid-template-columns: 1fr;
  }
}

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

.cd-stat-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cd-muted);
  margin: 0 0 6px;
}

.cd-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--cd-green-dark);
  margin: 0;
  letter-spacing: -0.02em;
}

.cd-stat-hint {
  font-size: 0.82rem;
  color: var(--cd-muted);
  margin: 6px 0 0;
}

/* Grid */
.cd-section-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}

.cd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 36px;
}

.cd-tile {
  display: block;
  background: var(--cd-surface);
  border-radius: var(--cd-radius);
  padding: 22px;
  border: 1px solid var(--cd-border);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--cd-shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.2s;
  position: relative;
  overflow: hidden;
}

.cd-tile::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cd-green), var(--cd-blue));
  opacity: 0;
  transition: opacity 0.25s;
}

.cd-tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--cd-shadow-hover);
  border-color: #c5e8e0;
}

.cd-tile:hover::before {
  opacity: 1;
}

.cd-tile-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(145deg, #e8f7f3, #e0f2fe);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 14px;
}

.cd-tile h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
}

.cd-tile p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--cd-muted);
  line-height: 1.45;
}

.cd-tile-arrow {
  margin-top: 14px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--cd-green);
}

/* Footer strip */
.cd-foot {
  text-align: center;
  padding: 24px;
  color: var(--cd-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--cd-border);
  margin-top: 8px;
}

.cd-foot a {
  color: var(--cd-green-dark);
  font-weight: 600;
}
