:root {
  /* Vertex Cyber Security Brand Colors */
  --primary: #00b4d8; /* Cyan/Teal from Spark CRM */
  --primary-hover: #0096c7;
  --bg-dark: #3a4c5d; /* Sidebar dark slate */
  --bg-body: #f4f7f9; /* Light gray/blue content background */
  --bg-panel: #ffffff;
  --accent-muted: #8096a6;
  --warning: #e07b22;
  --text-main: #1a252c;
  --text-muted: #64748b;
  --sidebar-active-bg: rgba(0, 180, 216, 0.15); /* Cyan highlight */

  --font-body: 'Lato', sans-serif;
  --font-heading: 'Roboto', sans-serif;
}

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

[x-cloak] { display: none !important; }

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 500;
  margin-bottom: 1rem;
}

/* Auth Pages Split Background */
.login-split-bg {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
  position: relative;
  background-color: var(--bg-body);
}

.login-split-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50vh;
  background-color: var(--primary);
  z-index: 0;
}

.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.login-box {
  width: 100%;
  max-width: 480px;
  background-color: #ffffff;
  border-radius: 12px;
  padding: 2.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

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

.login-header h1 {
  color: var(--text-main);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 0;
}

.login-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.form-help {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: var(--text-main);
  font-family: var(--font-body);
  transition: all 0.3s ease;
}

select {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: var(--text-main);
  font-family: var(--font-body);
  transition: all 0.3s ease;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2364748b%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem top 50%;
  background-size: 0.65rem auto;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.2);
}

/* Buttons */
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  border: none;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.5;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  box-sizing: border-box;
}
.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(0, 180, 216, 0.3);
}

.btn-secondary {
  background-color: #f1f5f9;
  color: var(--text-main);
  box-shadow: inset 0 0 0 1px #cbd5e1;
}

.btn-secondary:hover:not(:disabled) {
  background-color: #e2e8f0;
}

.btn-danger {
  background-color: #ef4444;
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background-color: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-block {
  width: 100%;
}

/* Alerts / Toasts */
.alert {
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.alert-error {
  background-color: #fef2f2;
  border-left: 4px solid #ef4444;
  color: #991b1b;
}
.alert-close {
  background: none;
  border: none;
  color: currentColor;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.alert-close:hover {
  opacity: 1;
}

/* Dashboard Layout */
.dashboard-layout {
  display: flex;
  width: 100%;
  height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 250px;
  background-color: var(--bg-dark);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h1 {
  font-size: 1.5rem;
  margin: 0;
  color: #ffffff;
  letter-spacing: 1px;
}

.sidebar-nav {
  list-style: none;
  flex-grow: 1;
  padding: 1rem 0;
}

.sidebar-nav li {
  margin-bottom: 0.25rem;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.sidebar-nav a svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
  background-color: var(--sidebar-active-bg);
  color: #ffffff;
  border-left: 4px solid var(--primary);
  padding-left: calc(1.5rem - 4px);
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Main Content */
.main-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.top-bar {
  height: 48px;
  background-color: var(--primary);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0 2rem;
  flex-shrink: 0;
}

.top-bar-icons {
  display: flex;
  gap: 1rem;
}

.top-bar-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
}

.top-bar-icon svg {
  width: 18px;
  height: 18px;
}

.main-content {
  flex-grow: 1;
  padding: 2rem 3rem;
  overflow-y: auto;
}

.page-title {
  font-size: 1.5rem;
  color: var(--text-main);
  margin-bottom: 2rem;
  font-weight: 700;
}

/* Cards & Grids */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.card {
  background-color: var(--bg-panel);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

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

.badge {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-admin {
  background-color: #fff7ed;
  color: #ef4444;
  border: 1px solid #fca5a5;
}

.table-container {
  overflow-x: auto;
  background-color: var(--bg-panel);
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 1rem 1.5rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.9rem;
}

th {
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  background-color: #f8fafc;
}

tbody tr:hover {
  background-color: #f1f5f9;
}
