/* ===========================
   Admin Dashboard — admin.css
   =========================== */

/* --- Reset & base --- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'DM Sans', system-ui, sans-serif;
  background: #f4f4f0;
  color: #1a1a1a;
}

/* --- Layout --- */
.admin-content {
  margin-left: 6rem;
  padding: 2rem 2.5rem;
  min-height: 100vh;
}

@media (max-width: 600px) {
  .admin-content {
    margin-left: 0;
    margin-bottom: 6rem;
    padding: 1.25rem 1rem;
  }
}

/* --- Page header --- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 22px;
  font-weight: 600;
  margin: 0;
  color: #1a1a1a;
}

/* --- Tabs --- */
.tab-group {
  display: flex;
  gap: 4px;
  background: #e8e8e4;
  padding: 4px;
  border-radius: 10px;
}

.tab {
  padding: 7px 18px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  border: none;
  background: transparent;
  border-radius: 7px;
  cursor: pointer;
  color: #666;
  transition: all 0.15s;
}

.tab.active {
  background: #fff;
  color: #1a1a1a;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tab-content.hidden { display: none; }

/* --- Stats grid --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 2rem;
}

.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  border: 1px solid #e8e8e4;
}

.stat-label {
  font-size: 12px;
  color: #888;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 6px;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
  letter-spacing: -0.02em;
}

.stat-value.success { color: #1a7a4a; }
.stat-value.danger  { color: #c0392b; }

/* --- Cards grid --- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

/* --- Rent card --- */
.rent-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e8e8e4;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow 0.2s;
}

.rent-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

/* card header */
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.card-dates {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 4px;
}

.card-dates svg { flex-shrink: 0; color: #888; }

.card-nights {
  font-size: 13px;
  color: #888;
  margin: 0;
  padding-left: 20px;
}

/* badge */
.badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-paid {
  background: #d4f0e2;
  color: #0f6e3a;
}

.badge-unpaid {
  background: #fde8e8;
  color: #c0392b;
}

/* divider */
.card-divider {
  height: 1px;
  background: #f0f0ec;
}

/* contact */
.card-contact {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: #555;
}

.contact-row svg { flex-shrink: 0; color: #aaa; }

.contact-row a {
  color: #23232e;
  text-decoration: none;
  font-weight: 500;
}

.contact-row a:hover { text-decoration: underline; }

/* desc */
.card-desc {
  font-size: 13px;
  color: #666;
  line-height: 1.55;
  background: #f7f7f4;
  border-radius: 8px;
  padding: 8px 12px;
  border-left: 3px solid #e0e0d8;
}

/* footer */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.card-price {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
  letter-spacing: -0.02em;
}

.card-price span {
  font-size: 13px;
  font-weight: 400;
  color: #888;
}

/* card actions */
.card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #fff;
  color: #444;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn:hover { background: #f4f4f0; border-color: #bbb; }
.btn:active { transform: scale(0.97); }

.btn-success {
  border-color: #a8ddc0;
  color: #0f6e3a;
  background: #f0faf5;
}

.btn-success:hover { background: #d4f0e2; }

.btn-danger {
  border-color: #f5c0c0;
  color: #c0392b;
  background: #fff5f5;
}

.btn-danger:hover { background: #fde8e8; }

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}

.modal-overlay.hidden { display: none; }

.modal {
  background: #fff;
  border-radius: 14px;
  padding: 1.75rem 2rem;
  max-width: 360px;
  width: 90%;
  text-align: center;
  border: 1px solid #e8e8e4;
}

.modal p {
  font-size: 15px;
  color: #333;
  margin: 0 0 1.25rem;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

/* --- Block calendar --- */
.block-calendar-wrapper {
  max-width: 520px;
}

.block-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: #fff;
  border: 1px solid #e8e8e4;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  font-size: 14px;
  color: #555;
  line-height: 1.5;
}

.block-info p { margin: 0; }

.save-btn { flex-shrink: 0; }

.calendar {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e8e8e4;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

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

.calendar-nav h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: #1a1a1a;
}

.cal-nav-btn {
  background: none;
  border: 1px solid #e0e0d8;
  border-radius: 8px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #555;
  transition: all 0.15s;
}

.cal-nav-btn:hover { background: #f4f4f0; }

/* weekday headers */
.weekdays {
  list-style: none;
  padding: 0;
  margin: 0 0 4px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
}

.weekdays li {
  font-size: 12px;
  font-weight: 600;
  color: #aaa;
  padding: 6px 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* block dates grid */
.block-dates {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  text-align: center;
}

.block-dates li {
  font-size: 13.5px;
  padding: 8px 0;
  border-radius: 8px;
  cursor: default;
  color: #1a1a1a;
}

.bc-day {
  cursor: pointer;
  transition: background 0.12s;
}

.bc-day:hover:not(.bc-past):not(.bc-reserved):not(.bc-reserved-edge) {
  background: #f0f0ec;
}

.bc-past {
  color: #ccc !important;
  cursor: default;
}

.bc-blocked {
  background: #23232e !important;
  color: #fff !important;
  font-weight: 600;
  border-radius: 8px;
}

.bc-reserved {
  background: #fde8e8 !important;
  color: #c0392b !important;
  cursor: not-allowed;
}

.bc-reserved-edge {
  background: #fde8e8 !important;
  color: #c0392b !important;
  font-weight: 600;
  cursor: not-allowed;
}

.bc-other { visibility: hidden; }

/* legend */
.block-legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 13px;
  color: #666;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.dot-blocked  { background: #23232e; }
.dot-reserved { background: #fde8e8; border: 1px solid #f5c0c0; }
.dot-free     { background: #f4f4f0; border: 1px solid #ddd; }

/* --- Prices form --- */
.prices-form {
  max-width: 560px;
  background: #fff;
  border: 1px solid #e8e8e4;
  border-radius: 14px;
  padding: 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.prices-form h1 {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 1.75rem;
  color: #1a1a1a;
}

.form-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 14px 0;
  border-bottom: 1px solid #f0f0ec;
}

.form-group:last-of-type {
  border-bottom: none;
}

.form-group label {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  white-space: nowrap;
}

.form-group input[type="number"] {
  width: 140px;
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid #e0e0d8;
  border-radius: 8px;
  background: #f7f7f4;
  color: #1a1a1a;
  text-align: right;
  transition: border-color 0.15s, background 0.15s;
  outline: none;
}

.form-group input[type="number"]:focus {
  border-color: #23232e;
  background: #fff;
}

.form-divider {
  height: 1px;
  background: #e8e8e4;
  margin: 1.25rem 0;
}

.specials-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 1rem;
}

.specials-section > label {
  font-size: 12px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#specials-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#specials-container div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f7f7f4;
  border-radius: 8px;
  border: 1px solid #e8e8e4;
}

#specials-container span {
  font-size: 14px;
  color: #333;
  font-weight: 500;
}

#specials-container button {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #f5c0c0;
  background: #fff5f5;
  color: #c0392b;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

#specials-container button:hover { background: #fde8e8; }

.add-special-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 0 4px;
}

.add-special-row label {
  font-size: 13px;
  color: #666;
  white-space: nowrap;
}

.add-special-row input[type="date"],
.add-special-row input[type="number"] {
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
  border: 1px solid #e0e0d8;
  border-radius: 8px;
  background: #f7f7f4;
  color: #1a1a1a;
  outline: none;
  transition: border-color 0.15s;
}

.add-special-row input:focus { border-color: #23232e; background: #fff; }

.add-special-row input[type="date"] { width: 150px; }
.add-special-row input[type="number"] { width: 110px; }

.add-special-row button {
  padding: 7px 14px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid #a8ddc0;
  background: #f0faf5;
  color: #0f6e3a;
  cursor: pointer;
  transition: background 0.15s;
}

.add-special-row button:hover { background: #d4f0e2; }

.form-submit-row {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
}

#saveButton {
  padding: 10px 28px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  background: #23232e;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}

#saveButton:hover { background: #3a3a47; }

/* --- Login form (istniejący styl zachowany) --- */
.login-container {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  width: 300px;
}

.login-container h2 { text-align: center; margin-bottom: 20px; }

.login-container input[type="text"],
.login-container input[type="password"] {
  width: 100%;
  padding: 10px;
  margin: 10px 0;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.login-container button {
  width: 100%;
  padding: 10px;
  background-color: #23232e;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
}

.login-container button:hover { background-color: #3a3a47; }

/* --- Navbar (istniejący styl zachowany) --- */
.admin-navbar {
  width: 6rem;
  height: 100vh;
  position: fixed;
  background-color: #23232e;
  left: 0;
  top: 0;
  z-index: 100;
}

.admin-navbar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding-top: 1.5rem;
}

.nav-link {
  display: flex;
  align-items: center;
  flex-direction: column;
  height: 5rem;
  color: #aaa;
  text-decoration: none;
  font-size: 12px;
  gap: 4px;
  transition: color 0.15s;
}

.nav-link:hover { color: #fff; }

@media (max-width: 600px) {
  .admin-navbar {
    bottom: 0;
    top: auto;
    width: 100vw;
    height: 6rem;
  }

  .admin-navbar-nav {
    flex-direction: row;
    justify-content: space-evenly;
    padding-top: 0;
    height: 100%;
  }
}