/* =========================================
   RESET
========================================= */

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

/* =========================================
   ROOT
========================================= */

:root {

  --primary: #1F3B2D;
  --primary-dark: #172C22;

  --secondary: #5C4033;

  --background: #F5F2EB;

  --card: #FFFFFF;

  --border: #E6DED0;

  --text: #243126;

  --text-light: #7D877E;

  --gold: #C8A96B;

  --success: #20C76F;

  --shadow:
    0 4px 20px rgba(0, 0, 0, 0.04);

  --radius: 22px;

  --transition: 0.25s ease;
}

/* =========================================
   BODY
========================================= */

body {

  font-family: 'Inter', sans-serif;

  background: var(--background);

  color: var(--text);

  display: flex;

  min-height: 100vh;
}

/* =========================================
   SIDEBAR
========================================= */

.sidebar {

  width: 280px;

  background: var(--card);

  border-right: 1px solid var(--border);

  padding: 28px 22px;

  display: flex;
  flex-direction: column;
}

/* =========================================
   LOGO
========================================= */

.logo {

  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {

  width: 56px;
  height: 56px;

  border-radius: 18px;

  background: #dbdbdb;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;

  padding: 6px;
}

.logo-icon img {

  width: 100%;
  height: 100%;

  object-fit: contain;
}

.logo-text h2 {

  font-size: 18px;
  font-weight: 700;

  color: var(--primary);

  margin-bottom: 4px;
}

.logo-text span {

  font-size: 14px;

  color: var(--text-light);
}

/* =========================================
   MENU
========================================= */

.menu {

  margin-top: 42px;

  display: flex;
  flex-direction: column;
  gap: 14px;
}

.menu-item {

  display: flex;
  align-items: center;
  gap: 14px;

  text-decoration: none;

  color: var(--text-light);

  padding: 18px 20px;

  border-radius: 18px;

  font-size: 16px;
  font-weight: 600;

  transition: var(--transition);
}

.menu-item:hover {

  background: #F1EDE6;

  color: var(--primary);
}

.menu-item.active {

  background: var(--primary);

  color: white;

  box-shadow:
    0 8px 24px rgba(31, 59, 45, 0.18);
}

/* =========================================
   THEME WRAPPER
========================================= */

.theme-wrapper {

  margin-top: 18px;
}

/* =========================================
   THEME TOGGLE
========================================= */

.theme-toggle {

  width: 100%;

  border: 1px solid var(--border);

  background: #F7F4EE;

  border-radius: 18px;

  padding: 16px 18px;

  display: flex;
  align-items: center;
  gap: 14px;

  cursor: pointer;

  color: var(--primary);

  font-size: 15px;
  font-weight: 600;

  transition: var(--transition);
}

.theme-toggle:hover {

  background: #ECE6DB;
}

.theme-toggle i {

  font-size: 16px;
}

/* =========================================
   MAIN
========================================= */

.main {

  flex: 1;

  display: flex;
  flex-direction: column;
}

/* =========================================
   TOPBAR
========================================= */

.topbar {

  background: white;

  border-bottom: 1px solid var(--border);

  padding: 28px 36px;

  display: flex;
  justify-content: space-between;
  align-items: center;
}

.breadcrumb {

  display: flex;
  align-items: center;
  gap: 10px;

  font-size: 13px;

  color: var(--text-light);

  margin-bottom: 10px;
}

.topbar h1 {

  font-size: 30px;
  font-weight: 700;

  color: var(--primary);
}

/* =========================================
   HEADER ACTIONS
========================================= */

.header-actions {

  display: flex;
  align-items: center;
  gap: 14px;
}

/* =========================================
   BUTTONS
========================================= */

.btn {

  border: none;

  border-radius: 16px;

  padding: 14px 22px;

  display: flex;
  align-items: center;
  gap: 10px;

  cursor: pointer;

  font-size: 14px;
  font-weight: 600;

  transition: var(--transition);
}

.btn:hover {

  transform: translateY(-2px);
}

.btn-light {

  background: white;

  border: 1px solid var(--border);

  color: var(--primary);
}

.btn-dark {

  background: var(--primary);

  color: white;
}

.btn-dark:hover {

  background: var(--primary-dark);
}

.btn-success {

  background: var(--success);

  color: white;
}

.btn-success:hover {

  opacity: 0.92;
}

.btn.small {

  padding: 12px 18px;

  font-size: 13px;
}

/* =========================================
   CONTENT
========================================= */

.content {

  padding: 34px;

  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* =========================================
   CARD
========================================= */

.card {

  background: var(--card);

  border-radius: 26px;

  padding: 30px;

  border: 1px solid #EFE7DA;

  box-shadow: var(--shadow);
}

/* =========================================
   CARD TITLE
========================================= */

.card-title {

  display: flex;
  align-items: center;
  gap: 14px;

  margin-bottom: 28px;
}

.card-title h2 {

  font-size: 24px;
  font-weight: 700;

  color: var(--primary);
}

/* =========================================
   ICON BOX
========================================= */

.icon-box {

  width: 48px;
  height: 48px;

  border-radius: 16px;

  background: #EDF2EE;

  color: var(--primary);

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 18px;
}

.icon-box.brown {

  background: #F3ECE6;

  color: var(--secondary);
}

.icon-box.gold {

  background: #FAF3E6;

  color: var(--gold);
}

.icon-box.green {

  background: #EDF5EF;

  color: var(--primary);
}

/* =========================================
   FORM GRID
========================================= */

.form-grid {

  display: grid;

  grid-template-columns: repeat(2, 1fr);

  gap: 20px;
}

/* =========================================
   INPUT GROUP
========================================= */

.input-group {

  position: relative;
}

.input-group i {

  position: absolute;

  left: 18px;
  top: 50%;

  transform: translateY(-50%);

  color: #9AA39B;

  font-size: 14px;
}

.input-group input {

  width: 100%;

  height: 60px;

  border-radius: 18px;

  border: 1px solid var(--border);

  background: #FCFBF9;

  padding: 0 18px 0 50px;

  outline: none;

  font-size: 15px;

  transition: var(--transition);
}

.input-group input:focus {

  border-color: var(--primary);

  background: white;

  box-shadow:
    0 0 0 4px rgba(31, 59, 45, 0.08);
}

/* =========================================
   SECTION HEADER
========================================= */

.section-header {

  display: flex;
  justify-content: space-between;
  align-items: center;

  margin-bottom: 24px;
}

/* =========================================
   TABLE
========================================= */

.table-wrapper {

  overflow-x: auto;
}

table {

  width: 100%;

  border-collapse: collapse;

  overflow: hidden;

  border-radius: 20px;
}

thead {

  background: var(--primary);

  color: white;
}

thead th {

  text-align: left;

  padding: 18px 16px;

  font-size: 13px;
  font-weight: 600;

  letter-spacing: 1px;
}

tbody {

  background: white;
}

tbody tr {

  border-bottom: 1px solid #F0EBE3;
}

tbody td {

  padding: 14px;
}

tbody input {

  width: 100%;

  border: none;

  background: transparent;

  outline: none;

  font-size: 14px;

  color: var(--text);

  padding: 10px 4px;
}

/* =========================================
   UPLOAD
========================================= */

.upload-area {

  border: 2px dashed #E5D1A8;

  border-radius: 24px;

  padding: 60px 30px;

  background: #FFFCF6;

  text-align: center;

  cursor: pointer;

  transition: var(--transition);
}

.upload-area:hover {

  background: #FFF7EB;
}

.upload-area i {

  font-size: 54px;

  color: var(--gold);

  margin-bottom: 18px;
}

.upload-area p {

  font-size: 18px;
  font-weight: 500;

  color: var(--text);

  margin-bottom: 8px;
}

.upload-area span {

  font-size: 14px;

  color: var(--text-light);
}

/* =========================================
   TEXTAREA
========================================= */

textarea {

  width: 100%;

  min-height: 180px;

  border-radius: 22px;

  border: 1px solid var(--border);

  background: #FCFBF9;

  padding: 22px;

  resize: vertical;

  outline: none;

  font-size: 15px;

  font-family: inherit;

  transition: var(--transition);
}

textarea:focus {

  border-color: var(--primary);

  background: white;

  box-shadow:
    0 0 0 4px rgba(31, 59, 45, 0.08);
}

/* =========================================
   DAYS COUNTER
========================================= */

.days-counter {

  margin-top: 24px;

  padding: 18px 20px;

  border-radius: 16px;

  background: #F6F3ED;

  font-size: 15px;

  color: var(--text);
}

.days-counter strong {

  color: var(--primary);
}

/* =========================================
   DARK MODE
========================================= */

body.dark-mode {

  --background: #111827;

  --card: #1B2430;

  --border: #2A3544;

  --text: #F3F4F6;

  --text-light: #AAB3C2;

  --primary: #3FA46A;

  background: var(--background);

  color: var(--text);
}

body.dark-mode .sidebar {

  background: #18212B;
}

body.dark-mode .topbar {

  background: #18212B;

  border-color: var(--border);
}

body.dark-mode .card {

  background: #1B2430;

  border-color: #2A3544;
}

body.dark-mode input,
body.dark-mode textarea {

  background: #111827;

  color: white;

  border-color: #2A3544;
}

body.dark-mode .upload-area {

  background: #111827;

  border-color: #3A4658;
}

body.dark-mode tbody {

  background: #1B2430;
}

body.dark-mode tbody tr {

  border-color: #2A3544;
}

body.dark-mode .theme-toggle {

  background: #111827;

  border-color: #2A3544;

  color: white;
}

body.dark-mode .btn-light {

  background: #111827;

  border-color: #2A3544;

  color: white;
}

body.dark-mode .input-group input {

  background: #111827;
}

body.dark-mode textarea {

  background: #111827;
}

body.dark-mode .days-counter {

  background: #111827;
}

/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 1200px) {

  .sidebar {

    width: 240px;
  }

  .topbar h1 {

    font-size: 24px;
  }

}

@media (max-width: 992px) {

  .form-grid {

    grid-template-columns: 1fr;
  }

  .topbar {

    flex-direction: column;
    align-items: flex-start;

    gap: 24px;
  }

  .header-actions {

    flex-wrap: wrap;
  }

}

@media (max-width: 768px) {

  body {

    flex-direction: column;
  }

  .sidebar {

    width: 100%;

    border-right: none;

    border-bottom: 1px solid var(--border);
  }

  .content {

    padding: 22px;
  }

  .card {

    padding: 24px;
  }

  .topbar {

    padding: 24px;
  }

  .topbar h1 {

    font-size: 22px;
  }

}

@media (max-width: 576px) {

  .header-actions {

    flex-direction: column;

    width: 100%;
  }

  .btn {

    justify-content: center;

    width: 100%;
  }

  .section-header {

    flex-direction: column;
    align-items: flex-start;

    gap: 18px;
  }

}

/* =========================================
   SELECT
========================================= */

.input-group select {

  width: 100%;

  height: 60px;

  border-radius: 18px;

  border: 1px solid var(--border);

  background: #FCFBF9;

  padding: 0 18px 0 50px;

  outline: none;

  font-size: 15px;

  font-family: inherit;

  color: var(--text);

  appearance: none;

  cursor: pointer;

  transition: var(--transition);
}

.input-group select:focus {

  border-color: var(--primary);

  background: white;

  box-shadow:
    0 0 0 4px rgba(31, 59, 45, 0.08);
}

/* =========================================
   MODAL
========================================= */

.modal-overlay {

  position: fixed;

  inset: 0;

  background:
    rgba(0,0,0,0.45);

  display: none;

  align-items: center;
  justify-content: center;

  z-index: 999999;
}

/* =========================================
   MODAL BOX
========================================= */

.modal-box {

  width: 900px;

  max-width: 95%;

  height: 700px;

  background: white;

  border-radius: 28px;

  overflow: hidden;

  display: flex;
  flex-direction: column;

  box-shadow:
    0 20px 60px rgba(0,0,0,0.18);
}

/* =========================================
   HEADER
========================================= */

.modal-header {

  height: 90px;

  padding: 0 30px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  border-bottom:
    1px solid #ECE7DD;
}

.modal-header h2 {

  font-size: 24px;

  color: var(--primary);
}

.modal-header button {

  width: 44px;
  height: 44px;

  border: none;

  border-radius: 14px;

  background: #F5F2EB;

  cursor: pointer;

  font-size: 18px;
}

/* =========================================
   SEARCH
========================================= */

.modal-search {

  padding: 24px 30px;
}

.modal-search input {

  width: 100%;

  height: 62px;

  border-radius: 18px;

  border: 1px solid var(--border);

  padding: 0 22px;

  font-size: 16px;

  outline: none;
}

/* =========================================
   RESULTS
========================================= */

.modal-results {

  flex: 1;

  overflow-y: auto;

  padding: 0 24px 24px;
}

/* =========================================
   ITEM
========================================= */

.modal-item {

  padding: 18px 22px;

  border-radius: 18px;

  cursor: pointer;

  margin-bottom: 10px;

  transition: var(--transition);

  border: 1px solid #EFE7DA;
}

.modal-item:hover {

  background: #F5F2EB;

  border-color: #DCCFB7;
}

.modal-item strong {

  display: block;

  margin-bottom: 6px;

  color: var(--primary);
}

.modal-item span {

  font-size: 14px;

  color: #7D877E;
}

/* =========================================
   DARK MODE SELECT
========================================= */

body.dark-mode .input-group select {

  background: #111827;

  color: white;

  border-color: #2A3544;
}

/* OPTIONS */

body.dark-mode .input-group select option {

  background: #1B2430;

  color: white;
}

/* =========================================
   DARK MODE MODAL
========================================= */

body.dark-mode .modal-box {

  background: #1B2430;

  border: 1px solid #2A3544;
}

/* HEADER */

body.dark-mode .modal-header {

  border-bottom: 1px solid #2A3544;
}

body.dark-mode .modal-header h2 {

  color: white;
}

/* BOTÃO FECHAR */

body.dark-mode .modal-header button {

  background: #111827;

  color: white;
}

/* SEARCH */

body.dark-mode .modal-search input {

  background: #111827;

  border-color: #2A3544;

  color: white;
}

body.dark-mode .modal-search input::placeholder {

  color: #8A94A6;
}

/* ITENS */

body.dark-mode .modal-item {

  background: #111827;

  border-color: #2A3544;
}

body.dark-mode .modal-item:hover {

  background: #243244;

  border-color: #3FA46A;
}

body.dark-mode .modal-item strong {

  color: white;
}

body.dark-mode .modal-item span {

  color: #9AA5B5;
}

/* SCROLL */

body.dark-mode .modal-results::-webkit-scrollbar {

  width: 10px;
}

body.dark-mode .modal-results::-webkit-scrollbar-track {

  background: #111827;
}

body.dark-mode .modal-results::-webkit-scrollbar-thumb {

  background: #2A3544;

  border-radius: 20px;
}

/* =========================================
   FULL WIDTH
========================================= */

.full-width {

  margin-top: 20px;
}

.remove-row-btn {

  background:#DC2626;

  color:white;

  border:none;

  padding:8px 12px;

  border-radius:8px;

  cursor:pointer;

  font-size:13px;

  transition:.2s;

}

.remove-row-btn:hover {

  background:#B91C1C;

}

.preview-container{

  display:flex;

  flex-wrap:wrap;

  gap:18px;

  margin-top:24px;

}

.preview-image{

  position:relative;

  width:160px;

  height:120px;

  border-radius:16px;

  overflow:hidden;

  background:#F8F8F8;

  border:1px solid #E5E7EB;

  box-shadow:
    0 4px 12px rgba(0,0,0,.06);

}

.preview-image img{

  width:100%;

  height:100%;

  object-fit:cover;

}

.remove-image-btn{

  position:absolute;

  top:8px;
  right:8px;

  width:28px;
  height:28px;

  border:none;

  border-radius:50%;

  background:#EF4444;

  color:white;

  font-size:16px;

  cursor:pointer;

  display:flex;

  align-items:center;

  justify-content:center;

  transition:.2s;

}

.remove-image-btn:hover{

  background:#DC2626;

  transform:scale(1.08);

}