/* 
 * NeoDesk Corporate Design System
 * NeomanTech Labs
 * Branding: #1B5559 (Deep Teal) & #4FB5AA (Light Teal) on Clean White/Slate Surface
 */

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

:root {
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-code: 'JetBrains Mono', monospace;

  /* Corporate Brand Colors */
  --brand-primary: #1B5559;       /* Deep Corporate Teal */
  --brand-primary-hover: #144245;
  --brand-primary-light: rgba(27, 85, 89, 0.08);
  
  --brand-accent: #4FB5AA;        /* Light Teal / Mint */
  --brand-accent-hover: #3da398;
  --brand-accent-light: rgba(79, 181, 170, 0.15);

  /* Light Theme Surfaces & Backgrounds */
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-input: #ffffff;
  --bg-sidebar: #1B5559;

  /* Corporate Typography Colors */
  --text-heading: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-on-primary: #ffffff;

  /* Borders & Shadows */
  --border-color: #e2e8f0;
  --border-focus: #4FB5AA;
  --border-strong: #cbd5e1;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px 0 rgba(0, 0, 0, 0.04);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-body);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand-primary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}
a:hover {
  color: var(--brand-primary-hover);
  text-decoration: underline;
}

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

.sidebar {
  width: 270px;
  background: var(--bg-sidebar);
  border-right: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.25rem;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  width: 100%;
}

.logo-wrapper {
  background: #ffffff;
  padding: 10px 16px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  width: 100%;
  max-width: 220px;
  margin: 0 auto;
}

.logo-wrapper img {
  max-height: 65px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--brand-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1B5559;
  font-size: 1.25rem;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.brand-text h1 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #ffffff;
}
.brand-text span {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--brand-accent);
  font-weight: 700;
  display: block;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  font-size: 0.92rem;
  transition: var(--transition);
}

.nav-link i {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
}

.nav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

.nav-link.active {
  color: #1B5559;
  background: var(--brand-accent);
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.nav-link.active i {
  color: #1B5559;
}

.user-profile {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-info h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
}
.user-info p {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

.main-wrapper {
  margin-left: 270px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.top-bar {
  height: 64px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}

.page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-heading);
}

.content-area {
  padding: 2rem;
  flex: 1;
}

/* Corporate Cards & Containers */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  margin-bottom: 1.5rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.card-title i {
  color: var(--brand-primary);
}

/* Dashboard Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--brand-primary);
}

.stat-card.stat-warning::before { background: #d97706; }
.stat-card.stat-danger::before { background: #dc2626; }
.stat-card.stat-success::before { background: #0d9488; }

.stat-info h3 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-heading);
  margin-top: 0.2rem;
  line-height: 1.2;
}
.stat-info p {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--brand-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: var(--brand-primary);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.badge-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.badge-info { background: #f0f9ff; color: #075985; border: 1px solid #bae6fd; }
.badge-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.badge-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.badge-danger-glow { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; font-weight: 700; }
.badge-gray { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.table th {
  padding: 0.85rem 1rem;
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid var(--border-color);
}

.table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  color: var(--text-body);
}

.table tbody tr {
  transition: var(--transition);
}

.table tbody tr:hover {
  background: #f8fafc;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 1.15rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
  color: var(--text-heading);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-heading);
  font-family: var(--font-main);
  font-size: 0.92rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(27, 85, 89, 0.15);
}

textarea.form-control {
  resize: vertical;
  min-height: 110px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--brand-primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--brand-primary-hover);
  color: #ffffff;
  text-decoration: none;
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-body);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
  background: #f8fafc;
  color: var(--text-heading);
  border-color: var(--text-muted);
  text-decoration: none;
}

.btn-danger {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}
.btn-danger:hover {
  background: #dc2626;
  color: #ffffff;
  text-decoration: none;
}

.btn-sm {
  padding: 0.38rem 0.75rem;
  font-size: 0.82rem;
}

/* Ticket Chat / Forum Thread */
.chat-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.chat-bubble {
  max-width: 85%;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  position: relative;
  box-shadow: var(--shadow-sm);
}

.chat-bubble.admin-msg {
  align-self: flex-start;
  background: var(--brand-primary-light);
  border: 1px solid rgba(27, 85, 89, 0.2);
  border-top-left-radius: 2px;
}

.chat-bubble.client-msg {
  align-self: flex-end;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-top-right-radius: 2px;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.82rem;
}

.chat-author {
  font-weight: 700;
  color: var(--brand-primary);
}

.chat-time {
  color: var(--text-muted);
}

.chat-body {
  font-size: 0.92rem;
  color: var(--text-heading);
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-attachment {
  margin-top: 0.75rem;
  padding: 0.5rem 0.85rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

/* Login Screen Styles */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-body);
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-header .brand-icon {
  margin: 0 auto 1rem auto;
  width: 52px;
  height: 52px;
  font-size: 1.5rem;
  border-radius: 12px;
}

.login-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--brand-primary);
}

.login-tabs {
  display: flex;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
}

.login-tab-btn {
  flex: 1;
  padding: 0.6rem;
  text-align: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
}

.login-tab-btn.active {
  background: var(--brand-primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

/* Alerts */
.alert {
  padding: 0.9rem 1.15rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.alert-danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

/* Access Key Copy Pill */
.key-pill {
  font-family: var(--font-code);
  background: var(--brand-primary-light);
  color: var(--brand-primary);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(27, 85, 89, 0.2);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.key-pill:hover {
  background: var(--brand-accent);
  color: #1B5559;
}

/* Responsive Breakpoints */
@media (max-width: 992px) {
  .sidebar {
    width: 76px;
    padding: 1rem 0.5rem;
  }
  .sidebar-brand .brand-text, .nav-link span, .user-info {
    display: none;
  }
  .main-wrapper {
    margin-left: 76px;
  }
}
