/* ============================================
   PENSIUNEA POTCOAVA - Main Stylesheet
   ============================================ */
:root {
  --primary: #c8a96e;
  --primary-dark: #b8935a;
  --primary-light: #f5ecd7;
  --dark: #1a1a2e;
  --dark2: #16213e;
  --green: #2d4a22;
  --bg: #f5f5f0;
  --white: #ffffff;
  --text: #2c2c2c;
  --muted: #888;
  --border: #e0e0e0;
  --danger: #e74c3c;
  --danger-light: #fdecea;
  --success: #27ae60;
  --success-light: #e8f5e9;
  --warning: #f39c12;
  --warning-light: #fff3cd;
  --info: #1976d2;
  --info-light: #e3f2fd;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.15);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--primary); }
img { max-width: 100%; }

/* ---- NAVBAR ---- */
.navbar {
  background: var(--dark);
  color: white;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.navbar-brand {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.5px;
}
.navbar-menu { display: flex; gap: 4px; align-items: center; flex: 1; padding: 0 20px; }
.nav-link {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.15s;
  white-space: nowrap;
}
.nav-link:hover { color: white; background: rgba(255,255,255,0.1); }
.nav-link.active { background: var(--primary); color: white; }
.navbar-right { display: flex; align-items: center; gap: 12px; }
.navbar-user { font-size: 13px; color: var(--primary); white-space: nowrap; }
.btn-logout {
  background: none;
  border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.8);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  text-decoration: none;
  transition: all 0.15s;
}
.btn-logout:hover { background: rgba(255,255,255,0.1); color: white; }
.hamburger { display: none; flex-direction: column; background: none; border: none; cursor: pointer; gap: 5px; padding: 4px; }
.hamburger span { display: block; width: 22px; height: 2px; background: white; border-radius: 2px; transition: all 0.2s; }
.notif-badge {
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 50%;
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  position: relative; top: -1px;
}

/* ---- CONTAINER ---- */
.container { max-width: 1280px; margin: 0 auto; padding: 28px 20px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-title { font-size: 22px; font-weight: 700; color: var(--dark); }
.page-subtitle { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ---- STATS GRID ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--primary);
  transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-icon { font-size: 30px; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--dark); }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 500; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 8px; font-size: 14px;
  font-weight: 600; text-decoration: none; cursor: pointer;
  border: none; transition: all 0.15s; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: white; color: var(--dark); border: 1.5px solid var(--border); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #c0392b; }
.btn-success { background: var(--success); color: white; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }

/* ---- CARDS ---- */
.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 15px; font-weight: 700; color: var(--dark); }
.card-body { padding: 20px; }

/* ---- ACTIVITY LIST ---- */
.activity-list { display: flex; flex-direction: column; gap: 10px; }
.activity-card {
  background: white;
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
  transition: box-shadow 0.15s;
}
.activity-card:hover { box-shadow: var(--shadow-lg); }
.activity-card.status-anulata { border-left-color: var(--danger); opacity: 0.75; }
.activity-card.status-efectuata { border-left-color: var(--success); }
.act-date { font-size: 12px; font-weight: 700; color: var(--primary); min-width: 46px; text-align: center; line-height: 1.3; }
.act-date span { display: block; font-size: 22px; font-weight: 800; color: var(--dark); }
.act-info { flex: 1; min-width: 0; }
.act-info strong { display: block; font-size: 14px; font-weight: 700; }
.act-info small { font-size: 12px; color: var(--muted); }
.act-actions { display: flex; gap: 6px; }

/* ---- TABLES ---- */
.table-wrap { background: white; border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
.table-toolbar { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 16px; text-align: left; font-size: 13.5px; border-bottom: 1px solid #f0f0f0; }
th { background: #fafafa; font-weight: 600; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
tr:hover td { background: #fffdf5; }
tr:last-child td { border-bottom: none; }

/* ---- FORMS ---- */
.form-card { background: white; border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); max-width: 680px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-control, select.form-control, textarea.form-control {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px; font-size: 14px;
  transition: border 0.15s; background: white;
  color: var(--text);
}
.form-control:focus, select.form-control:focus, textarea.form-control:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(200,169,110,0.15);
}
textarea.form-control { resize: vertical; min-height: 90px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }

/* ---- BADGES ---- */
.badge { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; display: inline-block; }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-muted { background: #f0f0f0; color: var(--muted); }
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }

/* ---- ALERTS ---- */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.alert-success { background: var(--success-light); color: var(--success); border: 1px solid #c3e6cb; }
.alert-danger { background: var(--danger-light); color: var(--danger); border: 1px solid #f5c6cb; }
.alert-warning { background: var(--warning-light); color: #856404; border: 1px solid #ffeaa7; }
.alert-info { background: var(--info-light); color: var(--info); border: 1px solid #bee5eb; }

/* ---- MODAL ---- */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 500; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { background: white; border-radius: 14px; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 17px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ---- SEARCH BAR ---- */
.search-bar { position: relative; }
.search-bar input { padding-left: 36px; }
.search-bar::before { content: '🔍'; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 14px; pointer-events: none; }

/* ---- CALENDAR ---- */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-header-cell { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 8px 4px; text-transform: uppercase; }
.cal-day {
  min-height: 90px; background: white; border-radius: 8px;
  padding: 6px; border: 1.5px solid var(--border);
  font-size: 12px; cursor: pointer; transition: border 0.15s; position: relative;
}
.cal-day:hover { border-color: var(--primary); }
.cal-day.today { border-color: var(--primary); background: var(--primary-light); }
.cal-day.other-month { opacity: 0.4; }
.cal-day-num { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.cal-event {
  background: var(--primary); color: white; border-radius: 4px;
  padding: 2px 6px; font-size: 10px; margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.cal-event.efectuata { background: var(--success); }
.cal-event.anulata { background: var(--danger); }
.cal-nav { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.cal-nav-title { font-size: 18px; font-weight: 700; flex: 1; text-align: center; }

/* ---- HORSE CARD ---- */
.horse-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.horse-card {
  background: white; border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; transition: transform 0.15s, box-shadow 0.15s;
}
.horse-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.horse-card-img { height: 160px; background: linear-gradient(135deg, #2d4a22, #1a1a2e); display: flex; align-items: center; justify-content: center; font-size: 60px; }
.horse-card-body { padding: 16px; }
.horse-card-name { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.horse-card-meta { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }

/* ---- SIDEBAR LAYOUT ---- */
.layout-split { display: grid; grid-template-columns: 1fr 360px; gap: 24px; }

/* ---- EMPTY STATE ---- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 16px; margin-bottom: 8px; color: var(--text); }
.empty-state p { font-size: 14px; }

/* ---- DASHBOARD MENU ---- */
.dashboard-menu {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.dash-card {
  background: white;
  border-radius: 14px;
  padding: 22px 12px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  transition: all 0.18s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.dash-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  color: var(--primary-dark);
}
.dash-card-primary {
  background: var(--primary);
  color: white;
}
.dash-card-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: white;
}
.dash-icon {
  font-size: 32px;
  line-height: 1;
}
.dash-label {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

/* ---- MOBILE ---- */
@media (max-width: 900px) {
  .layout-split { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .hamburger { display: flex; }
  .navbar-menu {
    display: none; position: absolute; top: 62px; left: 0; right: 0;
    background: var(--dark2); flex-direction: column; padding: 10px 12px;
    gap: 4px; box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  }
  .navbar-menu.open { display: flex; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .container { padding: 16px 12px; }
  .cal-day { min-height: 60px; }
  .cal-event { display: none; }
  .cal-day.has-events::after { content: '●'; color: var(--primary); font-size: 8px; position: absolute; bottom: 4px; right: 4px; }
  table th:nth-child(n+4), table td:nth-child(n+4) { display: none; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .modal { max-height: 100vh; border-radius: 14px 14px 0 0; align-self: flex-end; }
}
