/* ===============================
   RESET + GENERAL
=================================*/
* {
    box-sizing: border-box;
}

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

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


/* ===============================
   SIDEBAR
=================================*/
.sidebar {
    width: 240px;
    background: linear-gradient(180deg, #0b5ed7, #084298);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 25px 20px;
}

.logo {
    width: 150px;
    margin-bottom: 30px;
}

.sidebar a {
    color: white;
    text-decoration: none;
    padding: 12px 14px;
    margin-bottom: 8px;
    border-radius: 8px;
    font-size: 14px;
    transition: 0.2s ease;
}

.sidebar a:hover {
    background: rgba(255,255,255,0.15);
}


/* ===============================
   CONTENT
=================================*/
.content {
    flex: 1;
    padding: 35px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}


/* ===============================
   KPI CARDS
=================================*/
.kpi-grid {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.kpi {
    flex: 1;
    background: white;
    padding: 25px;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.05);
    text-align: center;
    transition: 0.2s ease;
}

.kpi:hover {
    transform: translateY(-3px);
}

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

.kpi p {
    margin-top: 12px;
    font-size: 24px;
    font-weight: 600;
}


/* ===============================
   FILTERS
=================================*/
.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.filters input,
.filters select {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 14px;
}


/* ===============================
   TABLE
=================================*/
.table-wrapper {
    max-height: 520px;
    overflow-y: auto;
    background: white;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.05);
}

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

th {
    background: #0b5ed7;
    color: white;
    padding: 14px;
    text-align: left;
    font-size: 14px;
    position: sticky;
    top: 0;
}

td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}

tr:hover {
    background: #f8fafc;
}


/* ===============================
   ACTION BUTTONS
=================================*/
.action-btn {
    text-decoration: none;
    font-size: 16px;
    margin-right: 8px;
    transition: 0.2s;
}

.action-btn:hover {
    transform: scale(1.15);
}

.action-btn.danger {
    color: #ef4444;
}


/* ===============================
   STATUS BADGES
=================================*/
.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    display: inline-block;
    text-align: center;
}

/* statusuri exacte salvate in DB */
.badge.angajat {
    background: #22c55e;
    color: white;
}

.badge.respins {
    background: #ef4444;
    color: white;
}

.badge.acceptat {
    background: #3b82f6;
    color: white;
}

.badge.in_asteptare {
    background: #f59e0b;
    color: white;
}



/* ===============================
   CHARTS
=================================*/
.charts {
    display: flex;
    gap: 20px;
    margin-top: 30px;
}

.chart-card {
    flex: 1;
    background: white;
    padding: 25px;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.05);
}


/* ===============================
   DARK MODE
=================================*/
body.dark {
    background: #0f172a;
    color: #e5e7eb;
}

body.dark .content,
body.dark .kpi,
body.dark .table-wrapper,
body.dark .chart-card {
    background: #111827;
    color: #e5e7eb;
}

body.dark th {
    background: #1d4ed8;
}

body.dark tr:hover {
    background: #1f2937;
}

.dark-toggle {
    padding: 6px 12px;
    border-radius: 8px;
    background: #e5e7eb;
    cursor: pointer;
}

body.dark .dark-toggle {
    background: #374151;
    color: white;
}


/* ===============================
   RESPONSIVE
=================================*/
@media (max-width: 1000px) {

    .kpi-grid {
        flex-direction: column;
    }

    .charts {
        flex-direction: column;
    }

    .sidebar {
        width: 180px;
    }
}

/* RÂND COLORAT */
tr.status-angajat {
    background: #e6f9ed;
}

tr.status-respins {
    background: #fde8e8;
}

tr.status-acceptat {
    background: #e6f0ff;
}

tr.status-in_asteptare {
    background: #fff7e6;
}

/* Statusuri noi (în CRM) */
tr.status-în_așteptare {
    background: #fff7e6;
}

tr.status-in_angajare,
tr.status-în_angajare {
    background: #f3e8ff;
}

tr.status-contract_de_munca,
tr.status-contract_de_muncă {
    background: #e0f2fe;
}

/* INLINE INPUT */
table input,
table select {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 14px;
}

table input:focus,
table select:focus {
    outline: none;
    background: #f1f5f9;
    border-radius: 6px;
}

/* NOTIFICARE */
.success-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #22c55e;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    animation: fadein 0.3s ease;
}

@keyframes fadein {
    from {opacity:0; transform:translateY(10px);}
    to {opacity:1; transform:translateY(0);}
}
.doc-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.doc-item a {
    margin-right: 6px;
    text-decoration: none;
}
.doc-badge {
    background: #0b5ed7;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 13px;
    cursor: pointer;
}

/* ===============================
   MOBILE IMPROVEMENTS (ADD AT END)
=================================*/

/* 1) Make form controls touch-friendly */
input, select, button, a {
  -webkit-tap-highlight-color: transparent;
}

.filters input,
.filters select,
table input,
table select {
  min-height: 42px;          /* touch target */
  font-size: 16px;           /* evită zoom iOS */
}

/* 2) Table wrapper: allow horizontal scroll on small screens */
.table-wrapper {
  overflow-x: auto;          /* important for mobile */
  -webkit-overflow-scrolling: touch;
}

/* Prevent table from squishing too much */
table {
  min-width: 900px;          /* desktop stays fine; mobile scrolls */
}

/* 3) Sidebar improvements for smaller screens */
@media (max-width: 900px) {
  .content {
    padding: 18px;
  }

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

  .topbar-right {
    width: 100%;
    justify-content: space-between;
  }

  .filters {
    flex-direction: column;
    gap: 10px;
  }

  .filters input,
  .filters select {
    width: 100%;
  }

  .kpi-grid {
    flex-direction: column;
    gap: 12px;
  }

  .kpi {
    padding: 16px;
  }

  .charts {
    flex-direction: column;
  }

  .chart-card {
    padding: 16px;
  }

  /* Sidebar becomes smaller and scrollable */
  .sidebar {
    width: 180px;          /* tu aveai deja 180 la 1000px, păstrăm */
    padding: 16px 12px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
  }

  .logo {
    width: 120px;
    margin-bottom: 16px;
  }

  .sidebar a {
    padding: 10px 12px;
    font-size: 13px;
  }

  th, td {
    padding: 10px 10px;
    font-size: 13px;
  }

  /* Inputs in table: a bit more visible on mobile */
  table input:focus,
  table select:focus {
    background: #eef2ff;
  }
}

/* 4) Very small phones */
@media (max-width: 520px) {
  .layout {
    flex-direction: column;  /* sidebar on top */
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    overflow: visible;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    justify-content: flex-start;
  }

  .logo {
    width: 110px;
    margin-bottom: 0;
    margin-right: 10px;
  }

  .sidebar .logo-area {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 10px;
    margin-bottom: 8px;
  }

  .sidebar a {
    margin-bottom: 0;
    font-size: 13px;
    padding: 10px 10px;
    border-radius: 10px;
    white-space: nowrap;
  }

  .content {
    padding: 14px;
  }

  /* Table: scroll is the safest option */
  table {
    min-width: 860px;
  }
}

/* 5) Optional: status select colored (works with my dropdown solution)
   If you use the <select class="status-select status-..."> */
.status-select {
  padding: 6px 10px;
  border-radius: 20px;
  border: none;
  font-weight: 700;
  color: white;
  cursor: pointer;
}
.status-angajat { background: #16a34a; }
.status-acceptat { background: #2563eb; }
.status-respins { background: #dc2626; }
.status-asteptare { background: #f59e0b; }
.status-angajare { background: #7c3aed; }
.status-contract { background: #0ea5e9; }

/* 6) Document badge: a bit bigger on mobile */
@media (max-width: 900px) {
  .doc-badge {
    padding: 6px 10px;
    border-radius: 14px;
    font-size: 14px;
  }
}