/* Global layout */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #ffffff;
  color: #1f2933;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: #b91c1c;
  border-right: 1px solid rgba(248, 250, 252, 0.3);
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 0.75rem;
  background: radial-gradient(circle at 10% 0%, #fecaca, #ef4444 55%, #7f1d1d);
  box-shadow: 0 0 18px rgba(248, 113, 113, 0.65);
}

.logo-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.logo-title {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fef2f2;
}

.logo-subtitle {
  font-size: 0.75rem;
  color: #fee2e2;
}

.nav-section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #fee2e2;
  margin-bottom: 0.4rem;
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.65rem;
  color: #fef2f2;
  font-size: 0.86rem;
  opacity: 0.8;
  transition: background 0.15s ease, opacity 0.15s ease, transform 0.1s ease;
}

.nav-link:hover {
  background: rgba(254, 242, 242, 0.16);
  opacity: 1;
  transform: translateX(1px);
}

.nav-link.active {
  background: linear-gradient(90deg, rgba(254, 202, 202, 0.9), rgba(239, 68, 68, 0.95));
  border: 1px solid rgba(248, 113, 113, 0.9);
  opacity: 1;
}

.nav-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 10%, #fee2e2, #ef4444);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.sidebar-footer {
  margin-top: auto;
  font-size: 0.75rem;
  color: #fee2e2;
}

/* Main area */
.main {
  flex: 1;
  padding: 1.75rem 2.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.main-title-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.page-title {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.page-subtitle {
  font-size: 0.9rem;
  color: #4b5563;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.6);
  color: #b91c1c;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  border: 1px solid rgba(248, 113, 113, 0.5);
  color: #7f1d1d;
}

.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 0 10px rgba(248, 113, 113, 0.9);
}

.controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn {
  border: none;
  outline: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #ffffff;
  color: #7f1d1d;
  border: 1px solid rgba(248, 113, 113, 0.7);
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  background: #fef2f2;
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(248, 113, 113, 0.35);
}

.btn-primary {
  background: linear-gradient(135deg, #fee2e2, #f97373, #b91c1c);
  border-color: transparent;
  color: #7f1d1d;
  font-weight: 600;
}

.btn-primary:hover {
  box-shadow: 0 14px 35px rgba(248, 113, 113, 0.55);
}

/* Content layout */
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr);
  gap: 1.5rem;
}

.card {
  background: radial-gradient(circle at 0% 0%, rgba(254, 226, 226, 0.85), #ffffff);
  border-radius: 1rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid rgba(248, 113, 113, 0.35);
  box-shadow: 0 18px 40px rgba(248, 113, 113, 0.2);
  backdrop-filter: blur(12px);
}

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

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.card-subtitle {
  font-size: 0.8rem;
  color: #6b7280;
}

.card-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 0.8rem;
}

.kpi {
  background: #fef2f2;
  border: 1px solid rgba(248, 113, 113, 0.45);
  border-radius: 0.7rem;
  padding: 0.6rem 0.7rem;
}

.kpi-label {
  font-size: 0.7rem;
  color: #6b7280;
  margin-bottom: 0.25rem;
}

.kpi-value {
  font-size: 1.1rem;
  font-weight: 600;
}

.kpi-tag {
  margin-top: 0.2rem;
  font-size: 0.7rem;
  color: #b91c1c;
}

/* Table */
.table-wrapper {
  max-height: 420px;
  overflow: auto;
  border-radius: 0.8rem;
  border: 1px solid rgba(248, 113, 113, 0.4);
  background: #ffffff;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

thead {
  position: sticky;
  top: 0;
  background: #fee2e2;
  z-index: 1;
}

th,
td {
  padding: 0.55rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid rgba(248, 113, 113, 0.25);
  white-space: nowrap;
}

th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #b91c1c;
}

tbody tr:hover {
  background: #fef2f2;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
}

.status-open {
  background: rgba(248, 250, 252, 0.95);
  color: #b91c1c;
}

.status-in-progress {
  background: rgba(254, 226, 226, 0.9);
  color: #7f1d1d;
}

.status-closed {
  background: rgba(220, 252, 231, 0.9);
  color: #166534;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
}

.status-open .status-dot {
  background: #b91c1c;
}

.status-in-progress .status-dot {
  background: #f97373;
}

.status-closed .status-dot {
  background: #22c55e;
}

/* Form layout */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}

.form-row-full {
  grid-column: 1 / -1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
}

.field label {
  color: #7f1d1d;
}

.hint {
  font-size: 0.7rem;
  color: #6b7280;
}

input[type="text"],
input[type="number"],
input[type="email"],
select,
textarea {
  background: #ffffff;
  border-radius: 0.55rem;
  border: 1px solid rgba(248, 113, 113, 0.6);
  padding: 0.5rem 0.6rem;
  color: #1f2933;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(248, 113, 113, 0.9);
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.4);
  background: #fff7f7;
}

textarea {
  resize: vertical;
  min-height: 70px;
}

.form-footer {
  margin-top: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.form-footer .hint {
  max-width: 260px;
}

/* Utility */
.muted {
  color: #6b7280;
  font-size: 0.78rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(254, 226, 226, 0.9);
  color: #7f1d1d;
  font-size: 0.7rem;
}

.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #ef4444;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.small {
  font-size: 0.78rem;
}

/* Responsive */
@media (max-width: 960px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .main {
    padding: 1.25rem;
  }

  .content-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .main-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .controls {
    align-self: stretch;
    justify-content: flex-end;
    width: 100%;
  }
}

