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

/* Global Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    sans-serif;
  background-color: #020617; /* Slate 950 */
  color: #f8fafc; /* Slate 50 */
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #0f172a;
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

fragment {
  display: block;
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Interactive Elements Base */
a {
  color: inherit;
  text-decoration: none;
}

input,
select,
textarea {
  font-family: inherit;
  font-size: 14px;
  background-color: #0f172a;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #f8fafc;
  padding: 10px 14px;
  outline: none;
  transition: all 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #6366f1; /* Indigo 500 */
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

button {
  font-family: inherit;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all 0.2s ease;
}

/* UI Classes & Flex utilities (Tailwind-like shorthand utilities) */
.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.flex-1 {
  flex: 1 1 0%;
}
.shrink-0 {
  flex-shrink: 0;
}
.h-screen {
  height: 100vh;
}
.h-full {
  height: 100%;
}
.w-full {
  width: 100%;
}
.items-center {
  align-items: center;
}
.justify-between {
  justify-content: space-between;
}
.overflow-hidden {
  overflow: hidden;
}
.overflow-y-auto {
  overflow-y: auto;
}
.p-6 {
  padding: 1.5rem;
}
.p-8 {
  padding: 2rem;
}
.gap-4 {
  gap: 1rem;
}
.gap-6 {
  gap: 1.5rem;
}
.text-lg {
  font-size: 1.125rem;
}
.text-xl {
  font-size: 1.25rem;
}
.text-2xl {
  font-size: 1.5rem;
}
.text-slate-400 {
  color: #94a3b8;
}
.text-slate-500 {
  color: #64748b;
}
.font-semibold {
  font-weight: 600;
}
.font-bold {
  font-weight: 700;
}
.rounded-lg {
  border-radius: 0.5rem;
}
.rounded-xl {
  border-radius: 0.75rem;
}
.border-b {
  border-bottom: 1px solid #1e293b;
}

/* Custom components */
.btn-primary {
  background-color: #4f46e5;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}
.btn-primary:hover {
  background-color: #4338ca;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.4);
}

.btn-secondary {
  background-color: #1e293b;
  color: #e2e8f0;
  padding: 10px 18px;
  border-radius: 6px;
  border: 1px solid #334155;
}
.btn-secondary:hover {
  background-color: #334155;
  color: #ffffff;
}

.btn-danger {
  background-color: #be123c;
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(190, 18, 60, 0.15);
}
.btn-danger:hover {
  background-color: #9f1239;
  box-shadow: 0 2px 12px rgba(190, 18, 60, 0.3);
}

/* Card components */
.card {
  background-color: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

/* Dashboard statistics grid */
.grid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.stat-card {
  background-color: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Interactive Table styles */
.table-container {
  background-color: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px -3px rgba(0, 0, 0, 0.2);
}

table.y-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

table.y-table th {
  background-color: #0b0f19;
  color: #94a3b8;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 16px 24px;
  border-bottom: 1px solid #1e293b;
}

table.y-table td {
  padding: 18px 24px;
  border-bottom: 1px solid #1e293b;
  font-size: 14px;
  color: #cbd5e1;
}

table.y-table tr:last-child td {
  border-bottom: none;
}

table.y-table tr:hover td {
  background-color: #1e293b/30;
  color: #ffffff;
}

/* Glassmorphism Login wrapper */
.login-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(
      circle at 10% 20%,
      rgba(99, 102, 241, 0.15) 0%,
      transparent 40%
    ),
    radial-gradient(
      circle at 90% 80%,
      rgba(79, 70, 229, 0.1) 0%,
      transparent 45%
    ),
    #020617;
}

/* Glassmorphism Login wrapper */
.login-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(
      circle at 10% 20%,
      rgba(99, 102, 241, 0.15) 0%,
      transparent 40%
    ),
    radial-gradient(
      circle at 90% 80%,
      rgba(79, 70, 229, 0.1) 0%,
      transparent 45%
    ),
    #020617;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
}

/* CRM Predefined Layout & Component Styles */
.y-layout {
  display: flex;
  height: 100vh;
  background-color: #020617;
}

.y-main-window {
  flex: 1 1 0%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.y-main-content {
  flex: 1 1 0%;
  overflow-x: hidden;
  overflow-y: auto;
  background-color: #0b0f19;
  padding: 32px;
}

.y-sidebar {
  width: 260px;
  background-color: #0f172a;
  border-right: 1px solid #1e293b;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
}

.y-sidebar-brand {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid #1e293b;
  background-color: #0b0f19;
  font-size: 18px;
  font-weight: 700;
  color: #818cf8;
}

.y-sidebar-nav {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.y-sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #94a3b8;
  transition: all 0.2s ease;
}

.y-sidebar-link:hover {
  background-color: #1e293b;
  color: #f8fafc;
}

.y-sidebar-link.active {
  background-color: #4f46e5;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.y-sidebar-user {
  padding: 16px;
  border-top: 1px solid #1e293b;
  background-color: #0b0f19;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.y-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.y-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.y-user-details {
  overflow: hidden;
}

.y-user-name {
  font-size: 14px;
  font-weight: 600;
  color: #f8fafc;
  margin: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.y-user-email {
  font-size: 12px;
  color: #64748b;
  margin: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.y-signout-btn {
  display: block;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  padding: 8px;
  border-radius: 6px;
  background-color: #1e293b;
  color: #cbd5e1;
  transition: all 0.2s ease;
}

.y-signout-btn:hover {
  background-color: #be123c;
  color: #ffffff;
}

.y-navbar {
  height: 64px;
  border-bottom: 1px solid #1e293b;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.y-navbar-title h1 {
  font-size: 16px;
  font-weight: 600;
  color: #f8fafc;
  margin: 0;
}

.y-navbar-title p {
  font-size: 12px;
  color: #64748b;
  margin: 2px 0 0 0;
}

.y-navbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 500;
  background-color: rgba(16, 185, 129, 0.1);
  color: #34d399;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #10b981;
  display: inline-block;
}

.badge-mono {
  font-size: 11px;
  font-family: monospace;
  color: #64748b;
  border: 1px solid #1e293b;
  padding: 4px 8px;
  border-radius: 4px;
  background-color: #0b0f19;
}
