/*
 * NeoHub Corporate Design System
 * NeomanTech Labs
 * Branding: #1B5559 (Deep Teal) & #4FB5AA (Light Teal)
 */

@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;

  --brand-primary: #1B5559;
  --brand-primary-hover: #144245;
  --brand-primary-light: rgba(27, 85, 89, 0.08);

  --brand-accent: #4FB5AA;
  --brand-accent-hover: #3da398;
  --brand-accent-light: rgba(79, 181, 170, 0.15);

  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-input: #ffffff;
  --bg-sidebar: #1B5559;

  --text-heading: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;

  --border-color: #e2e8f0;
  --border-strong: #cbd5e1;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 4px 10px -2px rgba(15, 23, 42, 0.05);
  --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;
}

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

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

.sidebar {
  width: 270px;
  background: var(--bg-sidebar);
  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.06);
}

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

.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: 62px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--brand-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1B5559;
  font-size: 1.25rem;
  font-weight: 800;
}

.brand-text h1 {
  font-size: 1.25rem;
  font-weight: 800;
  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.82);
  font-weight: 500;
  font-size: 0.92rem;
}

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

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

.nav-link.active {
  color: #1B5559;
  background: var(--brand-accent);
  font-weight: 700;
}

.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;
  gap: 0.5rem;
}

.user-info h4 {
  font-size: 0.86rem;
  font-weight: 700;
  color: #ffffff;
}
.user-info p {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.7);
  word-break: break-all;
}

.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);
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

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

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

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

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  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);
}

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.4rem;
  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 p {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-info h3 {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-heading);
  margin-top: 0.2rem;
}

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

/* Hero & Filters */
.hub-hero-card {
  border-left: 4px solid var(--brand-primary);
}

.hub-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.hub-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.hub-search-box {
  position: relative;
  flex: 1;
  min-width: 240px;
  max-width: 420px;
}

.hub-search-box i {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.hub-search-box .form-control {
  padding-left: 2.4rem;
}

.hub-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hub-cat-pill {
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-body);
  padding: 0.4rem 0.85rem;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.hub-cat-pill:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.hub-cat-pill.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #ffffff;
}

/* Tools Launcher Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.tool-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-accent);
}

.tool-card-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

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

.tool-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.tool-icon-sm {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.tool-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 99px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}

.status-dot.online { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); }
.status-dot.offline { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2); }

.tool-card-body {
  flex: 1;
}

.tool-meta {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}

.tool-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: 0.35rem;
}

.tool-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  line-height: 1.45;
}

.tool-url-preview {
  font-family: var(--font-code);
  font-size: 0.74rem;
  color: var(--text-muted);
  background: var(--bg-subtle);
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.26rem 0.65rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.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-gray { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.badge-sso { background: rgba(79, 181, 170, 0.16); color: #1B5559; border: 1px solid rgba(79, 181, 170, 0.45); }

/* Forms & Buttons */
.form-group {
  margin-bottom: 1.1rem;
}

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

.form-control {
  width: 100%;
  padding: 0.7rem 0.95rem;
  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.9rem;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.62rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-sm {
  padding: 0.42rem 0.75rem;
  font-size: 0.8rem;
}

.btn-primary {
  background: var(--brand-primary);
  color: #ffffff;
}
.btn-primary:hover {
  background: var(--brand-primary-hover);
  color: #ffffff;
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-body);
  border-color: var(--border-strong);
}
.btn-secondary:hover {
  background: var(--bg-subtle);
  color: var(--text-heading);
}

/* 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.76rem;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-color);
}

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

/* Alerts */
.alert {
  padding: 0.95rem 1.15rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* Login */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, #1B5559 0%, #144245 55%, #0f2f32 100%);
}

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

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

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

/* Modal */
.hub-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.hub-modal-card {
  width: 100%;
  max-width: 660px;
  max-height: 90vh;
  overflow-y: auto;
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
  }
  .app-container {
    flex-direction: column;
  }
  .main-wrapper {
    margin-left: 0;
  }
  .top-bar {
    padding: 0 1rem;
  }
  .content-area {
    padding: 1.25rem;
  }
}
