* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f4f6f9;
  color: #1f2937;
}

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #111827, #1f2937);
}

.login-box {
  width: 100%;
  max-width: 400px;
  background: #ffffff;
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}

.login-box h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.login-box p {
  margin: 0 0 24px;
  color: #6b7280;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea,
.inline-form input,
.inline-form select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 15px;
}

.btn-primary,
.btn-secondary,
.btn-danger,
.btn-success,
.btn-logout {
  border: 0;
  text-decoration: none;
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 700;
}

.btn-primary {
  background: #2563eb;
  color: #fff;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-secondary {
  background: #e5e7eb;
  color: #111827;
  margin-left: 8px;
}

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

.btn-success {
  background: #16a34a;
  color: #fff;
}

.btn-logout {
  background: #ef4444;
  color: #fff;
}

.small-btn {
  min-width: 90px;
}

.alert {
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 16px;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
}

.topbar {
  height: 64px;
  background: #111827;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
}

.topbar-title {
  font-size: 20px;
  font-weight: 800;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 16px;
}

.app-shell {
  display: flex;
  min-height: calc(100vh - 64px);
}

.sidebar {
  width: 230px;
  background: #1f2937;
  padding: 18px;
}

.sidebar a {
  display: block;
  color: #d1d5db;
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 6px;
  font-weight: 600;
}

.sidebar a:hover {
  background: #374151;
  color: #fff;
}

.main-content {
  flex: 1;
  padding: 28px;
}

.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  margin: 0 0 6px;
  font-size: 30px;
}

.page-header p {
  margin: 0;
  color: #6b7280;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 18px;
}

.stat-card,
.panel-card {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.stat-card span {
  display: block;
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 10px;
}

.stat-card strong {
  display: block;
  font-size: 28px;
  color: #111827;
}

.panel-card {
  margin-bottom: 22px;
}

.panel-card h2 {
  margin-top: 0;
  font-size: 20px;
}

.inline-form {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
}

.data-table th,
.data-table td {
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
  padding: 12px;
  vertical-align: middle;
}

.data-table th {
  background: #f9fafb;
  font-size: 13px;
  text-transform: uppercase;
  color: #6b7280;
}

.actions-col {
  width: 220px;
}

.inline-action {
  display: inline-block;
  margin-left: 8px;
}

.btn-link {
  color: #2563eb;
  text-decoration: none;
  font-weight: 700;
}

.badge {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge-success {
  background: #dcfce7;
  color: #166534;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.form-card {
  max-width: 600px;
}

@media (max-width: 1000px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .inline-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    display: flex;
    overflow-x: auto;
    gap: 8px;
  }

  .sidebar a {
    white-space: nowrap;
  }

  .data-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

@media (max-width: 560px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    height: auto;
    padding: 14px;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .app-shell {
    min-height: auto;
  }
}

.clients-form {
  grid-template-columns: repeat(4, 1fr) auto;
}

.services-form {
  grid-template-columns: repeat(5, 1fr);
}

.hint {
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 0;
}

.note-box {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  padding: 14px;
  border-radius: 12px;
  margin-bottom: 10px;
}

.note-box small {
  display: block;
  color: #6b7280;
  margin-top: 4px;
}

.note-box p {
  margin-bottom: 0;
}

@media (max-width: 1200px) {
  .clients-form,
  .services-form {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .clients-form,
  .services-form {
    grid-template-columns: 1fr;
  }
}

.search-form {
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-form input {
  flex: 1;
  padding: 11px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 15px;
}

@media (max-width: 700px) {
  .search-form {
    flex-direction: column;
    align-items: stretch;
  }
}
.card-head {
  margin-bottom: 18px;
}

.card-head h2 {
  margin: 0 0 6px;
}

.card-head p {
  margin: 0;
  color: #6b7280;
}

.client-modern-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-block {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 18px;
}

.form-block h3 {
  margin: 0 0 14px;
  font-size: 18px;
  color: #111827;
}

.modern-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
}

.field label {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #374151;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 15px;
  background: #fff;
}

.field textarea {
  resize: vertical;
}

.form-actions {
  display: flex;
  justify-content: flex-start;
}

.badge-info {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

@media (max-width: 1100px) {
  .modern-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 700px) {
  .modern-grid {
    grid-template-columns: 1fr;
  }

  .form-actions {
    width: 100%;
  }

  .form-actions .btn-primary {
    width: 100%;
  }
}