/* KarbisV3 Frontend - Custom Styles */

:root {
  --color-primary: #18181b;
  --color-primary-foreground: #fafafa;
  --color-background: #ffffff;
  --color-foreground: #09090b;
  --color-card: #ffffff;
  --color-card-foreground: #09090b;
  --color-muted: #f4f4f5;
  --color-muted-foreground: #71717a;
  --color-accent: #f4f4f5;
  --color-accent-foreground: #18181b;
  --color-border: #e4e4e7;
  --color-input: #e4e4e7;
  --color-ring: #18181b;
  --color-destructive: #ef4444;
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-info: #3b82f6;
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 68px;
  --topbar-height: 56px;
  --radius: 0.5rem;
}

.dark {
  --color-primary: #fafafa;
  --color-primary-foreground: #18181b;
  --color-background: #09090b;
  --color-foreground: #fafafa;
  --color-card: #0a0a0a;
  --color-card-foreground: #fafafa;
  --color-muted: #27272a;
  --color-muted-foreground: #a1a1aa;
  --color-accent: #27272a;
  --color-accent-foreground: #fafafa;
  --color-border: #27272a;
  --color-input: #27272a;
  --color-ring: #d4d4d8;
  --color-destructive: #dc2626;
  --color-success: #16a34a;
  --color-warning: #d97706;
  --color-info: #2563eb;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--color-background);
  color: var(--color-foreground);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-muted-foreground); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-foreground); }

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

.app-sidebar {
  width: var(--sidebar-width);
  background: var(--color-card);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 40;
  transition: width 0.2s ease, transform 0.2s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

.app-sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.app-sidebar.collapsed .sidebar-label,
.app-sidebar.collapsed .sidebar-group-title,
.app-sidebar.collapsed .sidebar-user-info {
  display: none;
}

.app-sidebar.collapsed .sidebar-nav-item {
  justify-content: center;
  padding: 0.5rem;
}

.app-sidebar.collapsed .sidebar-nav-item svg {
  margin-right: 0;
}

.app-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  transition: margin-left 0.2s ease;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-main.sidebar-collapsed {
  margin-left: var(--sidebar-collapsed-width);
}

.app-topbar {
  height: var(--topbar-height);
  background: var(--color-card);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 30;
  gap: 1rem;
}

.app-content {
  flex: 1;
  padding: 1.5rem;
  background: var(--color-muted);
  overflow-y: auto;
}

/* Sidebar components */
.sidebar-logo {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--color-border);
  min-height: var(--topbar-height);
}

.sidebar-logo-icon {
  width: 32px;
  height: 32px;
  background: var(--color-foreground);
  color: var(--color-background);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-foreground);
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  padding: 0.5rem 0.75rem;
  overflow-y: auto;
}

.sidebar-group-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted-foreground);
  padding: 1rem 0.5rem 0.375rem;
  white-space: nowrap;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.625rem;
  border-radius: calc(var(--radius) - 2px);
  color: var(--color-muted-foreground);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  gap: 0.75rem;
  white-space: nowrap;
}

.sidebar-nav-item:hover {
  background: var(--color-accent);
  color: var(--color-accent-foreground);
}

.sidebar-nav-item.active {
  background: var(--color-accent);
  color: var(--color-foreground);
  font-weight: 600;
}

.sidebar-nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-badge {
  margin-left: auto;
  font-size: 0.6875rem;
  font-weight: 600;
  background: var(--color-muted);
  color: var(--color-muted-foreground);
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
}

.sidebar-badge.new {
  background: #dcfce7;
  color: #16a34a;
}

.dark .sidebar-badge.new {
  background: #14532d;
  color: #4ade80;
}

/* Sidebar submenu system */
.sidebar-nav-parent {
  display: flex;
  flex-direction: column;
}

.sidebar-nav-toggle {
  width: 100%;
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
}

.sidebar-chevron {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.sidebar-chevron.rotated {
  transform: rotate(90deg);
}

.sidebar-submenu {
  display: flex;
  flex-direction: column;
  padding-left: 0.5rem;
  margin-left: 1.25rem;
  border-left: 1px solid var(--color-border);
  gap: 0.0625rem;
  margin-top: 0.125rem;
  margin-bottom: 0.25rem;
}

.sidebar-sub-item {
  display: flex;
  align-items: center;
  padding: 0.375rem 0.625rem;
  border-radius: calc(var(--radius) - 2px);
  color: var(--color-muted-foreground);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  gap: 0.5rem;
  white-space: nowrap;
}

.sidebar-sub-item:hover {
  background: var(--color-accent);
  color: var(--color-accent-foreground);
}

.sidebar-sub-item.active {
  background: var(--color-accent);
  color: var(--color-foreground);
  font-weight: 600;
}

.sidebar-sub-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sidebar-nav-parent.has-active-child > .sidebar-nav-toggle {
  color: var(--color-foreground);
}

/* Collapsed sidebar: hide submenu */
.app-sidebar.collapsed .sidebar-submenu {
  display: none !important;
}

.app-sidebar.collapsed .sidebar-chevron {
  display: none;
}

.app-sidebar.collapsed .sidebar-nav-toggle {
  justify-content: center;
  padding: 0.5rem;
}

/* ─── Settings Layout ───────────────────────────────── */
.settings-layout {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 1.5rem;
}

.settings-sidebar {
  width: 220px;
  flex-shrink: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-card);
  padding: 0.25rem;
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
}

.settings-sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  height: 36px;
  padding: 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-muted-foreground);
  text-decoration: none;
  border-radius: calc(var(--radius) - 2px);
  transition: background 0.15s, color 0.15s;
}

.settings-sidebar-item:hover {
  background: var(--color-accent);
  color: var(--color-foreground);
}

.settings-sidebar-item.active {
  background: var(--color-accent);
  color: var(--color-foreground);
  font-weight: 600;
}

.settings-content {
  flex: 1;
  min-width: 0;
}

@media (max-width: 768px) {
  .settings-layout {
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
  }
  .settings-sidebar {
    width: 100%;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.25rem;
  }
  .settings-sidebar-item {
    height: 34px;
    flex: 0 0 auto;
  }
}

.sidebar-user {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-accent-foreground);
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-email {
  font-size: 0.6875rem;
  color: var(--color-muted-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Cards */
.card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-foreground);
}

.card-description {
  font-size: 0.8125rem;
  color: var(--color-muted-foreground);
  margin-top: 0.125rem;
}

/* Stat Cards */
.stat-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.stat-card-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-muted-foreground);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-card-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-foreground);
  margin-top: 0.25rem;
  line-height: 1.2;
}

.stat-card-change {
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 0.375rem;
}

.stat-card-change.positive { color: var(--color-success); }
.stat-card-change.negative { color: var(--color-destructive); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 36px;
  padding: 0 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--color-foreground);
  color: var(--color-background);
  border-color: var(--color-foreground);
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.9;
}

.btn-secondary {
  background: var(--color-card);
  color: var(--color-foreground);
  border-color: var(--color-border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--color-accent);
}

.btn-ghost {
  background: transparent;
  color: var(--color-foreground);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--color-accent);
}

.btn-destructive {
  background: var(--color-destructive);
  color: #fff;
  border-color: var(--color-destructive);
}

.btn-sm { height: 32px; padding: 0 0.75rem; font-size: 0.8125rem; }
.btn-lg { height: 40px; padding: 0 1.25rem; font-size: 1rem; }
.btn-icon { height: 36px; width: 36px; padding: 0; }

/* Inputs */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-foreground);
}

.form-input,
.form-select,
.form-textarea {
  height: 36px;
  padding: 0 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  border: 1px solid var(--color-input);
  border-radius: calc(var(--radius) - 2px);
  background: var(--color-background);
  color: var(--color-foreground);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

.form-textarea {
  height: auto;
  padding: 0.5rem 0.75rem;
  line-height: 1.5;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
  cursor: pointer;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--color-ring);
  box-shadow: 0 0 0 2px rgba(24, 24, 27, 0.1);
}

.dark .form-input:focus,
.dark .form-select:focus,
.dark .form-textarea:focus {
  box-shadow: 0 0 0 2px rgba(212, 212, 216, 0.15);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-muted-foreground);
}

.form-error {
  font-size: 0.75rem;
  color: var(--color-destructive);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.1875rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1;
  border-radius: 9999px;
  border: 1px solid transparent;
  white-space: nowrap;
  height: 22px;
  box-sizing: border-box;
}

.badge-default { background: var(--color-muted); color: var(--color-muted-foreground); border-color: var(--color-border); }
.badge-success { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.badge-warning { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.badge-destructive { background: #fee2e2; color: #dc2626; border-color: #fecaca; }
.badge-info { background: #dbeafe; color: #2563eb; border-color: #bfdbfe; }

.dark .badge-default { border-color: transparent; }
.dark .badge-success { background: #14532d; color: #4ade80; border-color: #166534; }
.dark .badge-warning { background: #451a03; color: #fbbf24; border-color: #78350f; }
.dark .badge-destructive { background: #450a0a; color: #f87171; border-color: #7f1d1d; }
.dark .badge-info { background: #1e3a5f; color: #60a5fa; border-color: #1e40af; }

/* Avatar */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--color-accent);
  color: var(--color-accent-foreground);
  font-weight: 600;
}

.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar-md { width: 40px; height: 40px; font-size: 0.875rem; }
.avatar-lg { width: 48px; height: 48px; font-size: 1rem; }

.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Dropdown */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  min-width: 180px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  padding: 0.25rem;
  z-index: 50;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem;
  font-size: 0.8125rem;
  color: var(--color-foreground);
  border-radius: calc(var(--radius) - 4px);
  cursor: pointer;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
}

.dropdown-item:hover {
  background: var(--color-accent);
}

.dropdown-item-danger { color: var(--color-destructive); }
.dropdown-item-danger:hover { background: color-mix(in srgb, var(--color-destructive) 10%, transparent); }

.dropdown-divider {
  height: 1px;
  background: var(--color-border);
  margin: 0.25rem 0;
}

.dropdown-separator {
  height: 1px;
  background: var(--color-border);
  margin: 0.25rem 0;
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--color-muted) 25%, var(--color-accent) 50%, var(--color-muted) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: calc(var(--radius) - 2px);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 380px;
}

.toast {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  animation: toast-in 0.3s ease;
}

.toast.toast-error { border-left: 3px solid var(--color-destructive); }
.toast.toast-success { border-left: 3px solid var(--color-success); }
.toast.toast-warning { border-left: 3px solid var(--color-warning); }

.toast-title { font-weight: 600; font-size: 0.8125rem; }
.toast-message { font-size: 0.8125rem; color: var(--color-muted-foreground); margin-top: 0.125rem; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

/* Responsive */
@media (max-width: 1024px) {
  .app-sidebar {
    transform: translateX(-100%);
  }

  .app-sidebar.mobile-open {
    transform: translateX(0);
  }

  .app-main {
    margin-left: 0 !important;
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 35;
  }

  .sidebar-overlay.active {
    display: block;
  }
}

/* Login page */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-muted);
  padding: 1rem;
}

.login-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.login-logo-icon {
  width: 44px;
  height: 44px;
  background: var(--color-foreground);
  color: var(--color-background);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.125rem;
}

.login-title {
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.375rem;
}

.login-subtitle {
  font-size: 0.875rem;
  color: var(--color-muted-foreground);
  text-align: center;
  margin-bottom: 1.5rem;
}

/* Grid utilities */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Transition */
[v-cloak] { display: none; }

/* ─── intl-tel-input Overrides ─────────────────────────────── */

/* Container full width */
.iti {
  width: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Selected flag + dial code area ── */
.iti .iti__selected-country-primary {
  background: transparent !important;
  padding: 0 0.375rem 0 0.625rem !important;
  gap: 0.375rem;
}

.iti .iti__selected-country-primary:hover {
  background: var(--color-accent) !important;
  border-radius: calc(var(--radius) - 2px) 0 0 calc(var(--radius) - 2px);
}

/* Dial code font must match input exactly */
.iti .iti__selected-dial-code {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--color-foreground);
  margin-left: 0.25rem;
}

/* Arrow indicator */
.iti .iti__arrow {
  border-top-color: var(--color-muted-foreground);
  margin-left: 0.25rem;
}
.iti .iti__arrow--up {
  border-bottom-color: var(--color-muted-foreground);
}

/* Separator between flag area and input */
.iti--separate-dial-code .iti__selected-country-primary {
  border-right: 1px solid var(--color-border);
  margin-right: 0;
}

/* ── Phone input field ── */
.iti .iti-phone-input {
  height: 36px !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-size: 0.875rem !important;
  font-weight: 400 !important;
  /* padding-left is calculated dynamically by intl-tel-input JS — do not override */
}

/* ── Dropdown container ── */
.iti__dropdown-content {
  background: var(--color-card) !important;
  border: 1px solid var(--color-border) !important;
  border-radius: var(--radius) !important;
  box-shadow: 0 4px 12px -2px rgba(0,0,0,0.12), 0 2px 4px -2px rgba(0,0,0,0.08) !important;
  overflow: hidden;
  margin-top: 4px !important;
}

/* ── Search input inside dropdown ── */
.iti__search-input {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-size: 0.8125rem !important;
  font-weight: 400 !important;
  color: var(--color-foreground) !important;
  background: var(--color-background) !important;
  border: 1px solid var(--color-border) !important;
  border-radius: calc(var(--radius) - 2px) !important;
  padding: 0.4375rem 0.625rem !important;
  margin: 0.375rem !important;
  width: calc(100% - 0.75rem) !important;
  outline: none !important;
  transition: border-color 0.15s ease;
}
.iti__search-input:focus {
  border-color: var(--color-ring) !important;
  box-shadow: 0 0 0 2px rgba(24,24,27,0.08) !important;
}
.iti__search-input::placeholder {
  color: var(--color-muted-foreground) !important;
}

/* ── Country list ── */
.iti__country-list {
  background: var(--color-card) !important;
  max-height: 180px;
}

/* ── Country item rows ── */
.iti__country {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  padding: 0.3125rem 0.625rem !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-size: 0.8125rem !important;
  color: var(--color-foreground) !important;
  line-height: 1.4;
  cursor: pointer;
}

.iti__country:hover,
.iti__country--highlight {
  background: var(--color-accent) !important;
  color: var(--color-accent-foreground) !important;
}

.iti__country-name {
  color: var(--color-foreground) !important;
  font-size: 0.8125rem !important;
}

.iti__dial-code {
  color: var(--color-muted-foreground) !important;
  font-size: 0.8125rem !important;
}

/* Flag size */
.iti__flag {
  transform: scale(0.9);
}

/* ── Dark mode ── */
.dark .iti__dropdown-content {
  box-shadow: 0 4px 12px -2px rgba(0,0,0,0.5), 0 2px 4px -2px rgba(0,0,0,0.3) !important;
}
.dark .iti__search-input:focus {
  box-shadow: 0 0 0 2px rgba(212,212,216,0.12) !important;
}
.dark .iti .iti__selected-dial-code {
  color: var(--color-foreground);
}

/* ═══════════════════════════════════════════════════════════════
   Social Dashboard
   ═══════════════════════════════════════════════════════════════ */

/* ─── Layout ──────────────────────────────────────────────────── */
.social-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  max-width: 1368px;
  margin-inline: auto;
}

@media (min-width: 1024px) {
  .social-layout {
    grid-template-columns: minmax(200px, 280px) minmax(0, 680px) minmax(200px, 280px);
    justify-content: center;
    align-items: start;
  }
}

/* ─── Post Create ─────────────────────────────────────────────── */
.post-create-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.post-create-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.post-create-input {
  width: 100%;
  border: none;
  background: var(--color-muted);
  border-radius: calc(var(--radius) - 2px);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--color-foreground);
  resize: none;
  outline: none;
  min-height: 44px;
  max-height: 200px;
  transition: all 0.15s ease;
  line-height: 1.5;
}

.post-create-input:focus {
  background: var(--color-background);
  box-shadow: inset 0 0 0 1px var(--color-border);
  min-height: 80px;
}

.post-create-input::placeholder {
  color: var(--color-muted-foreground);
}

.post-create-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
}

.post-create-tools {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.post-create-tools .btn-ghost {
  color: var(--color-muted-foreground);
  padding: 0.375rem;
}

.post-create-tools .btn-ghost:hover {
  color: var(--color-foreground);
}

/* ─── Post Feed ───────────────────────────────────────────────── */
.post-feed {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 680px;
}

.social-profile-aside,
.post-feed,
.social-aside {
  align-self: start;
}

/* ─── Reels Strip ──────────────────────────────────────────────── */
.reel-strip-card {
  position: sticky;
  top: 0;
  z-index: 24;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.reel-strip-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 32px;
  height: 32px;
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  background: var(--color-card);
  color: var(--color-foreground);
  cursor: pointer;
  font-size: 1.125rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.reel-strip-btn:hover {
  background: var(--color-background);
}

.reel-strip-btn-prev {
  left: 0.25rem;
}

.reel-strip-btn-next {
  right: 0.25rem;
}

.reel-strip-track {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.reel-story-item {
  flex: 0 0 118px;
  width: 118px;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  scroll-snap-align: start;
}

.reel-story-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.reel-story-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.reel-story-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 6%, rgba(0, 0, 0, 0.08) 56%);
}

.reel-story-user {
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  min-width: 0;
}

.reel-story-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #1877f2;
  background: rgba(255, 255, 255, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  flex-shrink: 0;
}

.reel-story-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.reel-story-name {
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reel-story-item-create .reel-story-thumb {
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--color-info) 22%, #ffffff) 0%, color-mix(in srgb, var(--color-info) 10%, #f3f4f6) 100%);
  border: 1px solid color-mix(in srgb, var(--color-info) 28%, var(--color-border));
}

.reel-story-thumb-create {
  position: relative;
}

.reel-story-create-body {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 32px;
}

.reel-story-create-plus {
  width: 42px;
  height: 42px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1877f2;
  color: #fff;
  font-size: 2rem;
  font-weight: 500;
  line-height: 1;
  box-shadow: 0 10px 20px rgba(24, 119, 242, 0.3);
}

.reel-story-create-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.5rem;
  background: color-mix(in srgb, var(--color-card) 88%, #ffffff);
  color: var(--color-foreground);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

html.dark .reel-story-create-label {
  background: color-mix(in srgb, var(--color-card) 92%, #0f172a);
}

/* ─── Post Item ───────────────────────────────────────────────── */
.post-item {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: visible;
  position: relative;
  z-index: 0;
}

.post-item-menu .dropdown-menu {
  z-index: 60;
}

.post-item-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem 0.5rem;
}

.post-item-author {
  flex: 1;
  min-width: 0;
}

.post-item-author-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-foreground);
}

.post-item-author-meta {
  font-size: 0.75rem;
  color: var(--color-muted-foreground);
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.125rem;
}

.post-item-menu {
  position: relative;
}

.post-item-content {
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  color: var(--color-foreground);
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.post-item-media {
  margin-top: 0.25rem;
  background: var(--color-muted);
  max-height: 500px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-item-media img {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: cover;
  display: block;
}

.post-item-media-single {
  padding: 0;
  max-height: none;
}

.post-item-media-single img,
.post-item-media-single video {
  width: min(100%, 680px);
  max-width: 100%;
  max-height: 420px;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border-radius: calc(var(--radius) - 4px);
  background: var(--color-background);
}

.post-item-media.post-item-media-reel {
  background: transparent;
  max-height: none;
  padding: 0.625rem 0.75rem 0.25rem;
}

.post-reel-card {
  position: relative;
  width: min(100%, 360px);
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22);
}

.post-reel-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-reel-badge {
  position: absolute;
  left: 0.625rem;
  top: 0.625rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
}

/* ─── Facebook-like Multi Image Layout ─────────────────────────── */
.post-media-fb {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2px;
  width: 100%;
  height: clamp(220px, 46vw, 380px);
  overflow: hidden;
}

.post-media-fb-main,
.post-media-fb-side-item {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  margin: 0;
  background: var(--color-muted);
  cursor: pointer;
  overflow: hidden;
}

.post-media-fb-side {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  min-width: 0;
}

.post-media-fb-side.post-media-fb-side-single {
  grid-template-rows: 1fr;
}

.post-media-fb-main img,
.post-media-fb-side-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-media-fb-more {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.48);
  color: #fff;
  font-size: 1.375rem;
  font-weight: 700;
}

/* ─── Post Image Lightbox ──────────────────────────────────────── */
.post-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.post-lightbox-content {
  max-width: min(96vw, 1200px);
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-lightbox-image {
  max-width: 100%;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.post-lightbox-close {
  position: absolute;
  top: 0.875rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.post-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.post-lightbox-prev {
  left: 0.75rem;
}

.post-lightbox-next {
  right: 0.75rem;
}

.post-lightbox-counter {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ─── Reel Viewer ──────────────────────────────────────────────── */
.reel-viewer-overlay {
  position: fixed;
  inset: 0;
  z-index: 1250;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.reel-viewer-content {
  position: relative;
  width: min(92vw, 420px);
  aspect-ratio: 9 / 16;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.reel-viewer-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}

.reel-viewer-meta {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  right: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 2;
}

.reel-viewer-avatar {
  width: 30px;
  height: 30px;
}

.reel-viewer-meta-text {
  min-width: 0;
}

.reel-viewer-meta-name {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reel-viewer-meta-time {
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.15;
  margin-top: 0.125rem;
}

.reel-viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.9rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.reel-viewer-prev {
  left: 0.75rem;
}

.reel-viewer-next {
  right: 0.75rem;
}

.reel-viewer-counter {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
}

.post-item-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1.25rem;
  font-size: 0.8125rem;
  color: var(--color-muted-foreground);
}

.post-item-stats span {
  cursor: pointer;
}

.post-item-stats span:hover {
  text-decoration: underline;
}

.post-item-actions {
  display: flex;
  align-items: center;
  border-top: 1px solid var(--color-border);
  padding: 0.25rem 0.5rem;
}

.post-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border: none;
  background: none;
  color: var(--color-muted-foreground);
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border-radius: calc(var(--radius) - 2px);
  transition: all 0.15s ease;
}

.post-action-btn:hover {
  background: var(--color-accent);
  color: var(--color-foreground);
}

.post-action-btn.liked {
  color: var(--color-destructive);
}

.post-action-btn.liked:hover {
  background: rgba(239, 68, 68, 0.08);
}

/* ─── Comments ────────────────────────────────────────────────── */
.post-comments {
  border-top: 1px solid var(--color-border);
  padding: 0.75rem 1.25rem 1rem;
}

.post-comment-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.post-comment-item {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.post-comment-body {
  flex: 1;
  min-width: 0;
}

.post-comment-bubble {
  background: var(--color-muted);
  border-radius: 12px;
  padding: 0.5rem 0.75rem;
  display: inline-block;
  max-width: 100%;
}

.post-comment-author {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-foreground);
}

.post-comment-text {
  font-size: 0.8125rem;
  color: var(--color-foreground);
  margin-top: 0.125rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.post-comment-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.25rem;
  padding-left: 0.75rem;
  font-size: 0.6875rem;
  color: var(--color-muted-foreground);
}

.post-comment-meta button {
  border: none;
  background: none;
  color: var(--color-muted-foreground);
  font-size: 0.6875rem;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
}

.post-comment-meta button:hover {
  color: var(--color-destructive);
}

.post-comment-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.post-comment-input {
  flex: 1;
  height: 36px;
  padding: 0 0.875rem;
  font-size: 0.8125rem;
  font-family: inherit;
  border: 1px solid var(--color-input);
  border-radius: 9999px;
  background: var(--color-muted);
  color: var(--color-foreground);
  outline: none;
  transition: all 0.15s ease;
}

.post-comment-input:focus {
  border-color: var(--color-ring);
  background: var(--color-background);
}

.post-comment-input::placeholder {
  color: var(--color-muted-foreground);
}

/* ─── Social Aside (Right Sidebar) ────────────────────────────── */
.social-aside {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.social-profile-aside {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ─── Profile Summary Card ────────────────────────────────────── */
.profile-summary-card {
  text-align: center;
}

.profile-summary-cover {
  height: 80px;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #ec4899 100%);
  border-radius: var(--radius) var(--radius) 0 0;
  margin: -1.25rem -1.25rem 0;
}

.dark .profile-summary-cover {
  background: linear-gradient(135deg, #1e3a5f 0%, #3b1f6e 50%, #6b1d47 100%);
}

.profile-summary-avatar-wrap {
  margin-top: -24px;
  position: relative;
  z-index: 1;
  display: inline-block;
}

.profile-summary-avatar-wrap .avatar {
  border: 3px solid var(--color-card);
}

.profile-summary-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-foreground);
  margin-top: 0.5rem;
}

.profile-summary-role {
  font-size: 0.8125rem;
  color: var(--color-muted-foreground);
  margin-top: 0.125rem;
}

.profile-summary-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.profile-stat-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-foreground);
}

.profile-stat-label {
  font-size: 0.6875rem;
  color: var(--color-muted-foreground);
  margin-top: 0.125rem;
}

/* ─── Birthday Widget ─────────────────────────────────────────── */
.birthday-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.375rem 0;
}

.birthday-item-info {
  flex: 1;
  min-width: 0;
}

.birthday-item-name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-foreground);
}

.birthday-item-dept {
  font-size: 0.6875rem;
  color: var(--color-muted-foreground);
}

/* Birthday Celebration Card */
.birthday-celebration-card {
  position: relative;
  overflow: hidden;
  padding: 1rem;
  background:
    linear-gradient(165deg, color-mix(in srgb, var(--color-info) 12%, transparent) 0%, transparent 48%),
    var(--color-card);
}

.birthday-celebration-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.confetti-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  opacity: 0.92;
}

.confetti-dot.c1 { top: 12%; left: 6%; background: #3b82f6; }
.confetti-dot.c2 { top: 18%; left: 32%; background: #f97316; }
.confetti-dot.c3 { top: 14%; right: 18%; background: #10b981; }
.confetti-dot.c4 { top: 33%; right: 8%; background: #ef4444; }
.confetti-dot.c5 { top: 22%; right: 34%; background: #8b5cf6; }
.confetti-dot.c6 { top: 44%; left: 48%; background: #14b8a6; }
.confetti-dot.c7 { top: 52%; right: 24%; background: #3b82f6; }
.confetti-dot.c8 { bottom: 12%; right: 10%; background: #6366f1; }

.birthday-celebration-top,
.birthday-celebration-hero,
.birthday-celebration-list {
  position: relative;
  z-index: 1;
}

.birthday-celebration-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.625rem;
}

.birthday-celebration-title {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-foreground);
}

.birthday-celebration-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.birthday-celebration-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  min-width: 56px;
  padding: 0 0.5rem;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--color-warning) 16%, transparent);
  color: var(--color-foreground);
  font-size: 0.6875rem;
  font-weight: 600;
}

.birthday-celebration-cta {
  height: 24px;
  padding: 0 0.5625rem;
  font-size: 0.6875rem;
}

.birthday-celebration-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.625rem;
  padding: 0.625rem;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-background);
}

.birthday-celebration-user {
  display: flex;
  align-items: center;
  gap: 0.5625rem;
  min-width: 0;
}

.birthday-celebration-avatar {
  width: 42px;
  height: 42px;
  font-size: 0.75rem;
  flex-shrink: 0;
  border: 2px solid color-mix(in srgb, var(--color-info) 35%, var(--color-background));
}

.birthday-celebration-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 9999px;
}

.birthday-celebration-meta {
  min-width: 0;
}

.birthday-celebration-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.birthday-celebration-dept {
  font-size: 0.6875rem;
  color: var(--color-muted-foreground);
  margin-top: 0.125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.birthday-celebration-date {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  height: 28px;
  padding: 0 0.625rem;
  border-radius: 9999px;
  border: 1px solid var(--color-border);
  background: color-mix(in srgb, var(--color-info) 12%, transparent);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-foreground);
}

.birthday-celebration-list {
  margin-top: 0.625rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4375rem;
}

.birthday-celebration-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  padding: 0.4375rem 0.5rem;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-background);
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.birthday-celebration-list-item:hover {
  border-color: color-mix(in srgb, var(--color-info) 50%, var(--color-border));
  background: color-mix(in srgb, var(--color-info) 8%, var(--color-background));
}

.birthday-celebration-list-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.birthday-celebration-mini-avatar {
  width: 28px;
  height: 28px;
  font-size: 0.625rem;
  flex-shrink: 0;
}

.birthday-celebration-mini-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 9999px;
}

.birthday-celebration-mini-meta {
  min-width: 0;
}

.birthday-celebration-mini-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.birthday-celebration-mini-dept {
  margin-top: 0.0625rem;
  font-size: 0.6875rem;
  color: var(--color-muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.birthday-celebration-mini-date {
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--color-muted-foreground);
}

.birthday-celebration-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  border-radius: 9999px;
  border: 1px solid var(--color-border);
  background: var(--color-muted);
  color: var(--color-muted-foreground);
  font-size: 0.6875rem;
  font-weight: 700;
}

/* Birthday Congrats Modal */
.birthday-congrats-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.birthday-congrats-dialog {
  width: min(92vw, 500px);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  padding: 1rem;
}

.birthday-congrats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.625rem;
}

.birthday-congrats-title {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--color-foreground);
}

.birthday-congrats-person {
  margin-top: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-background);
}

.birthday-congrats-avatar {
  width: 40px;
  height: 40px;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.birthday-congrats-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 9999px;
}

.birthday-congrats-person-meta {
  min-width: 0;
}

.birthday-congrats-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.birthday-congrats-dept {
  font-size: 0.75rem;
  color: var(--color-muted-foreground);
  margin-top: 0.0625rem;
}

.birthday-congrats-label {
  margin-top: 0.875rem;
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-muted-foreground);
}

.birthday-congrats-textarea {
  margin-top: 0.375rem;
  width: 100%;
  min-height: 118px;
  resize: vertical;
  border: 1px solid var(--color-input);
  border-radius: 10px;
  background: var(--color-background);
  color: var(--color-foreground);
  font-family: inherit;
  font-size: 0.8125rem;
  line-height: 1.5;
  padding: 0.625rem 0.75rem;
  outline: none;
}

.birthday-congrats-textarea:focus {
  border-color: var(--color-ring);
}

.birthday-congrats-actions {
  margin-top: 0.875rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Timed Pin Modal */
.pin-timed-modal {
  position: fixed;
  inset: 0;
  z-index: 82;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(2px);
  animation: pinTimedFadeIn 180ms ease;
}

.pin-timed-dialog {
  width: min(92vw, 430px);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  padding: 1rem;
  transform-origin: center;
  animation: pinTimedPopIn 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes pinTimedFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pinTimedPopIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.pin-timed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.625rem;
}

.pin-timed-title {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--color-foreground);
}

.pin-timed-description {
  margin-top: 0.625rem;
  font-size: 0.8125rem;
  color: var(--color-muted-foreground);
  line-height: 1.5;
}

.pin-timed-presets {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.375rem;
}

.pin-timed-preset {
  border: 1px solid var(--color-border);
  border-radius: 9px;
  background: var(--color-background);
  color: var(--color-foreground);
  height: 34px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pin-timed-preset:hover {
  border-color: color-mix(in srgb, var(--color-info) 60%, var(--color-border));
}

.pin-timed-preset.active {
  border-color: var(--color-info);
  background: color-mix(in srgb, var(--color-info) 13%, transparent);
  color: var(--color-foreground);
}

.pin-timed-preset:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.pin-timed-label {
  margin-top: 0.875rem;
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-muted-foreground);
}

.pin-timed-input {
  margin-top: 0.375rem;
}

.pin-timed-hint {
  margin-top: 0.375rem;
  font-size: 0.6875rem;
  color: var(--color-muted-foreground);
}

.pin-timed-actions {
  margin-top: 0.875rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* ─── Prayer Widget ───────────────────────────────────────────── */
.prayer-widget-card {
  padding: 1rem;
  background:
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--color-info) 10%, transparent), transparent 45%),
    var(--color-card);
}

.prayer-widget-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.prayer-widget-title {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-foreground);
}

.prayer-city-picker {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.prayer-city-picker label {
  font-size: 0.625rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-muted-foreground);
}

.prayer-city-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.prayer-city-select-wrap i {
  position: absolute;
  right: 0.4375rem;
  color: var(--color-muted-foreground);
  pointer-events: none;
}

.prayer-city-select {
  appearance: none;
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  background: var(--color-background);
  color: var(--color-foreground);
  height: 30px;
  min-width: 118px;
  padding: 0 1.375rem 0 0.625rem;
  font-size: 0.75rem;
  line-height: 1;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.prayer-city-select:focus {
  border-color: var(--color-ring);
}

.prayer-city-select:disabled {
  opacity: 0.65;
  cursor: wait;
}

.prayer-widget-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.6875rem;
  color: var(--color-muted-foreground);
  margin-bottom: 0.625rem;
}

.prayer-widget-city {
  font-weight: 600;
  color: var(--color-foreground);
}

.prayer-time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.prayer-time-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4375rem 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-background);
}

.prayer-time-name {
  font-size: 0.75rem;
  color: var(--color-muted-foreground);
}

.prayer-time-value {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-foreground);
}

/* ─── Standings Widget ────────────────────────────────────────── */
.standings-widget-card {
  padding: 0.875rem;
}

.standings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.625rem;
}

.standings-title {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-foreground);
}

.standings-season {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.4375rem;
  border-radius: 9999px;
  font-size: 0.625rem;
  color: var(--color-muted-foreground);
  border: 1px solid var(--color-border);
  background: var(--color-muted);
}

.standings-table-wrap {
  overflow-x: auto;
}

.standings-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 0.6875rem;
}

.standings-table th {
  padding: 0.375rem 0.25rem;
  text-align: center;
  color: var(--color-muted-foreground);
  font-weight: 600;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.standings-table th:nth-child(2) {
  text-align: left;
}

.standings-table td {
  padding: 0.375rem 0.25rem;
  text-align: center;
  color: var(--color-foreground);
  border-bottom: 1px solid color-mix(in srgb, var(--color-border) 72%, transparent);
  white-space: nowrap;
}

.standings-col-rank {
  color: var(--color-muted-foreground) !important;
  width: 16px;
}

.standings-col-team {
  display: flex;
  align-items: center;
  gap: 0.3125rem;
  min-width: 0;
  text-align: left !important;
}

.standings-col-team img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  flex-shrink: 0;
}

.standings-col-team span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.standings-col-points {
  font-size: 0.75rem;
  font-weight: 700;
}

.standings-row-top td:first-child {
  box-shadow: inset 2px 0 0 0 var(--color-success);
}

.standings-row-drop td:first-child {
  box-shadow: inset 2px 0 0 0 var(--color-destructive);
}

/* ─── Poll Widget ─────────────────────────────────────────────── */
.poll-option-bar {
  position: relative;
  background: var(--color-muted);
  border-radius: calc(var(--radius) - 2px);
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
  overflow: hidden;
  border: 1px solid transparent;
}

.poll-option-bar:hover {
  border-color: var(--color-border);
}

.poll-option-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background: var(--color-info);
  opacity: 0.12;
  border-radius: calc(var(--radius) - 2px);
  transition: width 0.4s ease;
}

.poll-option-bar.voted {
  border-color: var(--color-info);
}

.poll-option-bar.voted .poll-option-fill {
  opacity: 0.18;
}

.poll-option-label {
  position: relative;
  z-index: 1;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-foreground);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.poll-option-pct {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-muted-foreground);
}

/* ─── Post Skeleton ───────────────────────────────────────────── */
.post-skeleton {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.post-skeleton-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

/* ─── Announcement Feed Item ──────────────────────────────────── */
.announcement-feed-item {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--color-info);
}

.announcement-feed-label {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--color-info);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.375rem;
}

.announcement-feed-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-foreground);
  margin-bottom: 0.25rem;
}

.announcement-feed-summary {
  font-size: 0.8125rem;
  color: var(--color-muted-foreground);
  line-height: 1.5;
}

.announcement-feed-time {
  font-size: 0.6875rem;
  color: var(--color-muted-foreground);
  margin-top: 0.5rem;
}

/* ─── Quick Shortcuts Widget ─────────────────────────────────── */
.shortcut-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  min-width: 72px;
  padding: 0.75rem 0.5rem;
  background: var(--color-accent);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
  color: var(--color-foreground);
}
.shortcut-btn:hover {
  background: var(--color-border);
}
.shortcut-btn span {
  font-size: 0.6875rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
}

/* ─── Multi-media Grid ────────────────────────────────────────── */
.post-media-grid {
  display: grid;
  gap: 2px;
  overflow: hidden;
  max-height: 360px;
}

.post-media-grid.grid-2 { grid-template-columns: 1fr 1fr; }
.post-media-grid.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.post-media-grid.grid-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }

.post-media-grid img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

/* ─── TinyMCE Rich Editor Wrapper ─────────────────────────────── */
.karbis-rich-editor-wrap {
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
  background: var(--color-card);
}

.karbis-rich-editor-wrap .tox-tinymce {
  border: none !important;
  border-radius: 0 !important;
}

.post-item-content p { margin: 0 0 0.35em; }
.post-item-content p:last-child { margin-bottom: 0; }
.post-item-content ul, .post-item-content ol { padding-left: 1.4em; margin: 0.25em 0; }

/* ─── Pinned Badge ────────────────────────────────────────────── */
.pinned-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  color: var(--color-warning);
  font-weight: 500;
}

/* ─── Social Mobile ───────────────────────────────────────────── */
@media (max-width: 1023px) {
  .social-layout {
    grid-template-columns: 1fr;
  }

  .profile-summary-cover {
    height: 60px;
  }

  .reel-strip-card {
    top: 0.25rem;
  }

  .reel-strip-track {
    padding: 0;
  }

  .reel-strip-btn {
    width: 30px;
    height: 30px;
    font-size: 1rem;
  }

  .reel-story-item {
    flex-basis: 106px;
    width: 106px;
  }

  .prayer-widget-header {
    flex-direction: column;
    align-items: stretch;
  }

  .birthday-celebration-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .birthday-celebration-top {
    flex-wrap: wrap;
  }

  .birthday-celebration-actions {
    width: 100%;
    justify-content: space-between;
  }

  .birthday-celebration-date {
    height: 26px;
  }

  .birthday-congrats-dialog {
    width: min(96vw, 460px);
    padding: 0.875rem;
  }

  .birthday-congrats-actions {
    flex-direction: column;
  }

  .birthday-congrats-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .pin-timed-dialog {
    width: min(96vw, 420px);
    padding: 0.875rem;
  }

  .pin-timed-presets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pin-timed-actions {
    flex-direction: column;
  }

  .pin-timed-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .prayer-city-picker {
    align-items: flex-start;
  }

  .prayer-time-grid {
    grid-template-columns: 1fr;
  }

  .standings-widget-card {
    padding: 0.75rem;
  }

  .standings-table {
    font-size: 0.65625rem;
    min-width: 340px;
  }

  .post-lightbox-nav {
    width: 40px;
    height: 40px;
    font-size: 1.75rem;
  }

  .post-lightbox-prev {
    left: 0.5rem;
  }

  .post-lightbox-next {
    right: 0.5rem;
  }

  .reel-viewer-content {
    width: min(96vw, 390px);
  }

  .reel-viewer-nav {
    width: 38px;
    height: 38px;
    font-size: 1.75rem;
  }

  .reel-viewer-prev {
    left: 0.5rem;
  }

  .reel-viewer-next {
    right: 0.5rem;
  }
}

/* ─── AG Grid Overrides ─────────────────────────────────────────── */
.ag-root-wrapper {
  border: none !important;
  border-radius: 0 !important;
}
.ag-header-cell-label {
  font-weight: 600 !important;
  text-transform: uppercase !important;
  font-size: 0.6875rem !important;
  letter-spacing: 0.04em !important;
}
.ag-cell {
  display: flex !important;
  align-items: center !important;
}
.ag-row {
  cursor: default;
}
.ag-overlay-loading-center,
.ag-overlay-no-rows-center {
  font-size: 0.875rem;
  color: var(--color-muted-foreground);
}
.ag-paging-panel {
  border-top: 1px solid var(--color-border) !important;
  padding: 0.75rem 1rem !important;
  font-size: 0.8125rem !important;
}
/* Floating filter */
.ag-floating-filter-input input {
  font-size: 0.75rem !important;
}
.ag-floating-filter {
  border-top: 1px solid var(--color-border) !important;
}
/* Header menu button */
.ag-header-cell-menu-button {
  opacity: 0.4;
  transition: opacity 0.15s;
}
.ag-header-cell:hover .ag-header-cell-menu-button {
  opacity: 1;
}
/* Column Chooser */
.karbis-column-chooser {
  position: fixed;
  z-index: 9999;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px -2px rgba(0,0,0,0.15);
  padding: 0.5rem;
  min-width: 220px;
  max-height: 360px;
  overflow-y: auto;
  font-family: 'Inter', sans-serif;
}
.karbis-cc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.375rem 0.5rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.karbis-cc-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem;
  cursor: pointer;
  border-radius: calc(var(--radius) - 4px);
  font-size: 0.8125rem;
  color: var(--color-foreground);
  transition: background 0.1s;
}
.karbis-cc-row:hover {
  background: var(--color-accent);
}
.karbis-cc-row input[type="checkbox"] {
  accent-color: var(--color-primary);
  width: 14px;
  height: 14px;
  cursor: pointer;
}
.karbis-column-chooser::-webkit-scrollbar {
  width: 6px;
}
.karbis-column-chooser::-webkit-scrollbar-thumb {
  background: var(--color-muted-foreground);
  border-radius: 3px;
}

/* ─── Asset Create Responsive ──────────────────────────────────── */
@media (max-width: 1200px) {
  .asset-create-layout {
    grid-template-columns: 1fr !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   WhatsApp Module Styles
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Chat Layout ─────────────────────────────────────────────── */
.wa-chat-layout {
  display: flex;
  height: calc(100vh - 200px);
  min-height: 500px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-background);
}

/* ─── Chat List (Left Panel) ──────────────────────────────────── */
.wa-chat-list-panel {
  width: 360px;
  min-width: 300px;
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  background: var(--color-background);
}
.wa-chat-list-header {
  padding: 12px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wa-chat-list-header select,
.wa-chat-list-header input {
  height: 36px;
}
.wa-chat-list-body {
  flex: 1;
  overflow-y: auto;
}
.wa-chat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--color-border);
  transition: background 0.15s;
}
.wa-chat-item:hover {
  background: var(--color-accent);
}
.wa-chat-item.active {
  background: var(--color-accent);
  border-left: 3px solid var(--color-primary);
}
.wa-chat-item-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-muted-foreground);
  flex-shrink: 0;
  overflow: hidden;
}
.wa-chat-item-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.wa-chat-item-info {
  flex: 1;
  min-width: 0;
}
.wa-chat-item-name {
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wa-chat-item-preview {
  font-size: 12px;
  color: var(--color-muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.wa-chat-item-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.wa-chat-item-time {
  font-size: 11px;
  color: var(--color-muted-foreground);
}
.wa-chat-item-unread {
  background: #25d366;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* ─── Message Area (Right Panel) ──────────────────────────────── */
.wa-message-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.wa-message-header {
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--color-background);
}
.wa-message-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.wa-message-header-name {
  font-weight: 600;
  font-size: 14px;
}
.wa-message-header-phone {
  font-size: 12px;
  color: var(--color-muted-foreground);
}
.wa-message-header-actions {
  display: flex;
  gap: 6px;
}
.wa-message-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--color-muted);
}
.wa-empty-state {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted-foreground);
  font-size: 14px;
  background: var(--color-muted);
}

/* ─── Message Bubbles ─────────────────────────────────────────── */
.wa-bubble {
  max-width: 65%;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
  word-wrap: break-word;
  position: relative;
}
.wa-bubble-in {
  align-self: flex-start;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-top-left-radius: 2px;
}
.wa-bubble-out {
  align-self: flex-end;
  background: #dcf8c6;
  border-top-right-radius: 2px;
  color: #111;
}
.wa-bubble-time {
  font-size: 10px;
  color: #667781;
  text-align: right;
  margin-top: 4px;
}
.wa-bubble-status {
  font-size: 10px;
  margin-left: 4px;
}
.wa-bubble img.wa-media {
  max-width: 100%;
  max-height: 300px;
  border-radius: 6px;
  margin-bottom: 4px;
}
.wa-bubble video.wa-media {
  max-width: 100%;
  max-height: 300px;
  border-radius: 6px;
  margin-bottom: 4px;
}
.wa-bubble audio.wa-media {
  width: 100%;
  margin-bottom: 4px;
}
.wa-bubble .wa-document-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: rgba(0,0,0,0.05);
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
  font-size: 12px;
  margin-bottom: 4px;
}
.wa-bubble .wa-location-preview {
  padding: 6px 8px;
  background: rgba(0,0,0,0.05);
  border-radius: 4px;
  font-size: 12px;
  margin-bottom: 4px;
}

/* ─── Input Bar ───────────────────────────────────────────────── */
.wa-input-bar {
  padding: 10px 16px;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--color-background);
}
.wa-input-bar textarea {
  flex: 1;
  resize: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 13px;
  min-height: 36px;
  max-height: 120px;
  font-family: inherit;
  background: var(--color-background);
  color: var(--color-foreground);
}
.wa-input-bar textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}
.wa-send-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: #25d366;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.wa-send-btn:hover {
  background: #20bd5a;
}
.wa-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ─── Attachment Menu ─────────────────────────────────────────── */
.wa-attach-wrap {
  position: relative;
}
.wa-attach-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid var(--color-border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted-foreground);
  flex-shrink: 0;
  transition: background 0.15s;
}
.wa-attach-btn:hover {
  background: var(--color-accent);
}
.wa-attach-menu {
  position: absolute;
  bottom: 42px;
  left: 0;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 160px;
  z-index: 50;
  overflow: hidden;
}
.wa-attach-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
  border: none;
  background: none;
  width: 100%;
  color: var(--color-foreground);
}
.wa-attach-menu-item:hover {
  background: var(--color-accent);
}

/* ─── Status Badge ────────────────────────────────────────────── */
.wa-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
}
.wa-status-badge.connected {
  background: #dcf8c6;
  color: #1b5e20;
}
.wa-status-badge.disconnected {
  background: #ffebee;
  color: #b71c1c;
}
.wa-status-badge.qr_pending {
  background: #fff3e0;
  color: #e65100;
}

/* ─── Queue Stats Cards ───────────────────────────────────────── */
.wa-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.wa-stat-card {
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-background);
  text-align: center;
}
.wa-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-foreground);
}
.wa-stat-label {
  font-size: 12px;
  color: var(--color-muted-foreground);
  margin-top: 4px;
}
.wa-stat-card.pending .wa-stat-value { color: #f59e0b; }
.wa-stat-card.processing .wa-stat-value { color: #3b82f6; }
.wa-stat-card.sent .wa-stat-value { color: #22c55e; }
.wa-stat-card.failed .wa-stat-value { color: #ef4444; }

/* ─── WhatsApp Tabs ───────────────────────────────────────────── */
.wa-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 16px;
}
.wa-tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--color-muted-foreground);
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.wa-tab:hover {
  color: var(--color-foreground);
}
.wa-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* ─── WhatsApp Dark Mode ──────────────────────────────────────── */
.dark .wa-bubble-out {
  background: #005c4b;
  color: #e9edef;
}
.dark .wa-bubble-time {
  color: #8696a0;
}
.dark .wa-send-btn {
  background: #00a884;
}
.dark .wa-send-btn:hover {
  background: #06cf9c;
}
.dark .wa-status-badge.connected {
  background: rgba(37, 211, 102, 0.15);
  color: #25d366;
}
.dark .wa-status-badge.disconnected {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}
.dark .wa-status-badge.qr_pending {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}
.dark .wa-chat-item-unread {
  background: #00a884;
}
.dark .wa-bubble .wa-document-link,
.dark .wa-bubble .wa-location-preview {
  background: rgba(255,255,255,0.08);
}

/* ─── WhatsApp Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
  .wa-chat-layout {
    height: calc(100vh - 160px);
  }
  .wa-chat-list-panel {
    width: 100%;
    min-width: unset;
  }
  .wa-chat-layout.chat-open .wa-chat-list-panel {
    display: none;
  }
  .wa-chat-layout:not(.chat-open) .wa-message-panel {
    display: none;
  }
  .wa-bubble {
    max-width: 85%;
  }
  .wa-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ─── Stock Management (Stok Yönetimi) ─────────────────────────── */

/* Tab navigation */
.stock-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1.5rem;
}
.stock-tab {
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-muted-foreground);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.stock-tab:hover {
  color: var(--color-foreground);
  background: var(--color-accent);
}
.stock-tab.active {
  color: var(--color-foreground);
  border-bottom-color: var(--color-foreground);
}

/* Inline editable table for units/barcodes */
.stock-unit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.stock-unit-table th {
  text-align: left;
  padding: 0.5rem 0.625rem;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--color-muted-foreground);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-muted);
  white-space: nowrap;
}
.stock-unit-table td {
  padding: 0.375rem 0.5rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.stock-unit-table td .form-input,
.stock-unit-table td .form-select {
  height: 32px;
  font-size: 0.8125rem;
  padding: 0 0.5rem;
}
.stock-unit-table tr.primary-unit {
  background: color-mix(in srgb, var(--color-info) 8%, transparent);
}

/* Voucher lines table */
.voucher-lines-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.voucher-lines-table th {
  text-align: left;
  padding: 0.5rem 0.625rem;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--color-muted-foreground);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-muted);
  white-space: nowrap;
}
.voucher-lines-table td {
  padding: 0.375rem 0.5rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.voucher-lines-table td .form-input,
.voucher-lines-table td .form-select {
  height: 32px;
  font-size: 0.8125rem;
  padding: 0 0.5rem;
}
.voucher-lines-table .line-total {
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

/* Stock level indicators */
.stock-level-critical { color: var(--color-destructive); font-weight: 600; }
.stock-level-warning { color: var(--color-warning); font-weight: 600; }
.stock-level-normal { color: var(--color-success); }
.stock-level-over { color: var(--color-info); font-weight: 600; }

/* Count difference colors */
.count-match { color: var(--color-success); }
.count-surplus { color: var(--color-info); font-weight: 600; }
.count-deficit { color: var(--color-destructive); font-weight: 600; }

/* Form grid for detail pages */
.stock-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.stock-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.stock-form-group label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-foreground);
}
.stock-form-group .form-hint {
  font-size: 0.75rem;
  color: var(--color-muted-foreground);
}

/* Inline add button next to select (for category/brand/unit quick add) */
.stock-select-with-add {
  display: flex;
  gap: 0.375rem;
  align-items: center;
}
.stock-select-with-add .form-select {
  flex: 1;
}
.stock-select-with-add .btn-add {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Transfer status steps */
.transfer-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 1.5rem;
}
.transfer-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  color: var(--color-muted-foreground);
  position: relative;
}
.transfer-step.active {
  color: var(--color-foreground);
  font-weight: 600;
}
.transfer-step.completed {
  color: var(--color-success);
}
.transfer-step-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--color-muted);
  color: var(--color-muted-foreground);
  flex-shrink: 0;
}
.transfer-step.active .transfer-step-dot {
  background: var(--color-foreground);
  color: var(--color-background);
}
.transfer-step.completed .transfer-step-dot {
  background: var(--color-success);
  color: #fff;
}
.transfer-step-line {
  width: 40px;
  height: 2px;
  background: var(--color-border);
}
.transfer-step.completed + .transfer-step-line {
  background: var(--color-success);
}

/* KPI summary cards */
.stock-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Count summary bar */
.count-summary {
  display: flex;
  gap: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--color-muted);
  border-radius: var(--radius);
  margin-top: 1rem;
  flex-wrap: wrap;
}
.count-summary-item {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.count-summary-item .label {
  font-size: 0.75rem;
  color: var(--color-muted-foreground);
}
.count-summary-item .value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-foreground);
}

/* Responsive stock forms */
@media (max-width: 768px) {
  .stock-form-grid {
    grid-template-columns: 1fr;
  }
  .stock-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stock-tabs {
    overflow-x: auto;
  }
  .transfer-steps {
    flex-wrap: wrap;
  }
}
