/* ==========================================================================
   STYLE.CSS - Fișier unic CSS pentru Serviciul ITP
   ========================================================================== */

:root {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --border-color: #e2e8f0;
  
  --danger-bg: #fef2f2;
  --danger-text: #991b1b;
  --warning-bg: #fefce8;
  --warning-text: #854d0e;
  --success-bg: #f0fdf4;
  --success-text: #166534;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

/* === Layout General (App Container) === */
.app-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  width: 260px;
  background-color: #1e293b;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem;
  flex-shrink: 0;
}

.sidebar-brand {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: #38bdf8;
}

.nav-list {
  list-style: none;
}

.nav-item {
  margin-bottom: 0.5rem;
}

.nav-link {
  display: block;
  padding: 0.75rem 1rem;
  color: #94a3b8;
  text-decoration: none;
  border-radius: 0.375rem;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
  background-color: #334155;
  color: #fff;
}

/* Main Content Area */
.main-content {
  flex-grow: 1;
  padding: 2rem;
  overflow-y: auto;
}

.header-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

/* === Carduri & Layout Interfețe === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 1.25rem;
}

.stat-title {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
}

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

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

.custom-table th, .custom-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.875rem;
}

.custom-table th {
  background-color: #f1f5f9;
  color: var(--text-muted);
  font-weight: 600;
}

/* Badges / Etichete Stare */
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 0.25rem;
}

.badge-danger { background-color: var(--danger-bg); color: var(--danger-text); }
.badge-warning { background-color: var(--warning-bg); color: var(--warning-text); }
.badge-success { background-color: var(--success-bg); color: var(--success-text); }

/* === Formular & Inputuri === */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

.form-control {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

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

/* Row-uri Dinamice Adăugare Multiplă */
.dynamic-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

/* === Butoane === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0.375rem;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
}

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

.btn-secondary { background-color: #e2e8f0; color: #334155; }
.btn-secondary:hover { background-color: #cbd5e1; }

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

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

/* === Modal Pop-Up === */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #fff;
  width: 100%;
  max-width: 450px;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}

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

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

/* === Ecran Login Centrat === */
.login-body {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f1f5f9;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  padding: 2.5rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

/* === Responsive (Mobil & Tabletă) === */
@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    padding: 1rem;
  }

  .nav-list {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
  }

  .nav-item { margin-bottom: 0; }

  .main-content {
    padding: 1rem;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .dynamic-row {
    flex-direction: column;
    align-items: stretch;
  }
}