/* BarberOS — Dark Barbershop Theme */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

/* ─── Variables ──────────────────────────────────────────── */
:root {
  --bg:        #0d0d0d;
  --bg2:       #161616;
  --bg3:       #1e1e1e;
  --border:    #2a2a2a;
  --text:      #e8e8e8;
  --text2:     #8a8a8a;
  --accent:    #c9a84c;       /* gold */
  --accent2:   #e8c87a;
  --red:       #e05252;
  --green:     #52b788;
  --blue:      #5294e0;
  --sidebar-w: 230px;
  --topbar-h:  56px;
  --radius:    10px;
  --font-head: 'Bebas Neue', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --shadow:    0 4px 24px rgba(0,0,0,.45);
}

/* ─── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { background: var(--bg); color: var(--text); font-family: var(--font-body); display: flex; min-height: 100vh; overflow-x: hidden; }

a { color: var(--accent); text-decoration: none; }
button { cursor: pointer; font-family: var(--font-body); -webkit-appearance: none; appearance: none; background: none; border: none; }
input, select, textarea { font-family: var(--font-body); }

/* ─── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 200;
  transition: transform .25s ease;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--border);
}
.logo-icon { font-size: 22px; color: var(--accent); }
.logo-text { font-family: var(--font-head); font-size: 24px; letter-spacing: 2px; color: var(--accent2); }

.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-section {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text2);
  padding: 14px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text2);
  font-size: 14px;
  font-weight: 500;
  transition: all .18s ease;
}
.nav-item i { width: 18px; text-align: center; font-size: 15px; }
.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item.active { background: rgba(201,168,76,.12); color: var(--accent); }
.nav-item.active i { color: var(--accent); }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text2); text-transform: capitalize; }
.btn-logout { background: none; border: none; color: var(--text2); font-size: 16px; padding: 6px; border-radius: 6px; transition: color .2s; }
.btn-logout:hover { color: var(--red); }

/* ─── Main ─────────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  max-width: calc(100% - var(--sidebar-w));
}

/* ─── Topbar ──────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 100;
}
.btn-menu { display: none; background: none; border: none; color: var(--text2); font-size: 18px; padding: 6px; }
.topbar-date { font-size: 13px; color: var(--text2); font-variant-numeric: tabular-nums; }
.topbar-right { display: flex; align-items: center; gap: 16px; }

/* ─── Page body ────────────────────────────────────────────── */
.page { padding: 28px 28px; }
.page-title { font-family: var(--font-head); font-size: 32px; letter-spacing: 1px; color: var(--accent2); margin-bottom: 24px; }
.page-title small { font-family: var(--font-body); font-size: 14px; font-weight: 400; color: var(--text2); margin-left: 10px; }

/* ─── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.card-title {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--text2); margin-bottom: 14px;
}

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.stat-icon.gold   { background: rgba(201,168,76,.15); color: var(--accent); }
.stat-icon.green  { background: rgba(82,183,136,.15); color: var(--green); }
.stat-icon.blue   { background: rgba(82,148,224,.15); color: var(--blue); }
.stat-icon.red    { background: rgba(224,82,82,.15);  color: var(--red); }

.stat-value { font-family: var(--font-head); font-size: 30px; line-height: 1; color: var(--text); }
.stat-label { font-size: 12px; color: var(--text2); margin-top: 4px; }

/* ─── Grid helpers ─────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
@media(max-width:900px) { .grid-4,.grid-3 { grid-template-columns: repeat(2,1fr); } }
@media(max-width:600px) { .grid-4,.grid-3 { grid-template-columns: 1fr; } }

/* ─── Tables ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: auto; min-width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 10px 14px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--text2); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.04); vertical-align: middle; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.02); }

/* ─── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.badge-green  { background: rgba(82,183,136,.15); color: var(--green); }
.badge-red    { background: rgba(224,82,82,.15);  color: var(--red); }
.badge-gold   { background: rgba(201,168,76,.15); color: var(--accent); }
.badge-blue   { background: rgba(82,148,224,.15); color: var(--blue); }
.badge-gray   { background: rgba(138,138,138,.12); color: var(--text2); }

/* ─── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 8px;
  font-size: 14px; font-weight: 500;
  border: none; transition: all .18s ease;
}
.btn-primary { background: var(--accent); color: #000; font-weight: 600; }
.btn-primary:hover { background: var(--accent2); }
.btn-secondary { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger  { background: rgba(224,82,82,.15); color: var(--red); border: 1px solid rgba(224,82,82,.2); }
.btn-danger:hover { background: rgba(224,82,82,.25); }
.btn-success { background: rgba(82,183,136,.15); color: var(--green); border: 1px solid rgba(82,183,136,.2); }
.btn-success:hover { background: rgba(82,183,136,.25); }
.btn-sm { padding: 6px 13px; font-size: 13px; }
.btn-lg { padding: 12px 26px; font-size: 16px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ─── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px; }
.form-control {
  width: 100%; padding: 10px 14px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 14px;
  transition: border-color .18s;
}
.form-control:focus { outline: none; border-color: var(--accent); }
.form-control::placeholder { color: var(--text2); }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a8a8a' fill='none' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

/* ─── Modal ─────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.75);
  z-index: 500; display: none;
  align-items: center; justify-content: center;
}
.modal-backdrop.show { display: flex; animation: fadeIn .2s ease; }
.modal {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 14px; padding: 28px;
  width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
  animation: slideUp .22s ease;
}
.modal-title { font-family: var(--font-head); font-size: 22px; color: var(--accent2); margin-bottom: 20px; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

/* ─── Alerts ─────────────────────────────────────────────────── */
.alert {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px; margin: 12px 28px 0;
  border-radius: 8px; font-size: 14px;
}
.alert-error   { background: rgba(224,82,82,.12); border: 1px solid rgba(224,82,82,.2); color: var(--red); }
.alert-success { background: rgba(82,183,136,.12); border: 1px solid rgba(82,183,136,.2); color: var(--green); }

/* ─── POS específico ──────────────────────────────────────── */
.pos-grid { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; }
.pos-grid > * { min-width: 0; }
@media(max-width:900px) { .pos-grid { grid-template-columns: 1fr; } }

.checkin-banner {
  background: linear-gradient(135deg, rgba(201,168,76,.12) 0%, rgba(201,168,76,.04) 100%);
  border: 1px solid rgba(201,168,76,.3);
  border-radius: 14px;
  padding: 32px;
  text-align: center;
}
.checkin-banner .form-control[type="file"] { padding: 8px; font-size: 13px; }

.card-no-cliente { text-align: center; padding: 28px; }
.card-no-cliente .emoji-scissors { font-size: 36px; margin-bottom: 12px; }
@media(max-width:480px) {
  .card-no-cliente { padding: 20px 16px; }
  .card-no-cliente .emoji-scissors { font-size: 28px; }
}
.checkin-banner h2 { font-family: var(--font-head); font-size: 28px; color: var(--accent2); margin-bottom: 8px; }
.checkin-banner p { color: var(--text2); margin-bottom: 24px; }

.service-chip {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px; background: var(--bg3);
  border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px;
  transition: border-color .18s;
}
.service-chip:hover { border-color: var(--accent); }
.service-chip-name { font-weight: 500; font-size: 14px; }
.service-chip-price { color: var(--accent); font-weight: 600; font-size: 14px; }
.service-chip-remove { background: none; border: none; color: var(--text2); font-size: 14px; padding: 2px 6px; border-radius: 4px; transition: color .15s; }
.service-chip-remove:hover { color: var(--red); }

.total-display {
  font-family: var(--font-head); font-size: 42px;
  color: var(--accent); text-align: center;
  padding: 16px 0; letter-spacing: 2px;
}

.service-btn,
.extra-btn {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 12px 16px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text);
  font-size: 14px; transition: all .18s ease;
  margin-bottom: 6px;
}
.service-btn:hover,
.extra-btn:hover { border-color: var(--accent); background: rgba(201,168,76,.06); }
.service-btn-price { color: var(--accent); font-weight: 600; }
/* standalone fallback para mobile */
.extra-btn { background: var(--bg3); border: 1px solid var(--border); }

.services-grid, .extras-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
}
.extras-grid { gap: 6px; }

@media(max-width:600px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .extras-grid { grid-template-columns: repeat(2, 1fr); gap: 5px; }
}
@media(max-width:380px) {
  .services-grid { grid-template-columns: 1fr; }
  .extras-grid { grid-template-columns: 1fr; }
}

.carrito-card { position: sticky; top: 72px; }
@media(max-width:900px) {
  .carrito-card { position: static; }
}

.extras-page-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start;
}
@media(max-width:768px) {
  .extras-page-grid { grid-template-columns: 1fr; }
}

/* ─── Dashboard ──────────────────────────────────────────── */
.chart-wrap { position: relative; height: 220px; }

/* ─── Reportes ───────────────────────────────────────────── */
.report-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.report-header .page-title { margin-bottom: 0; max-width: 100%; }
.report-tabs { display: flex; gap: 6px; flex-shrink: 0; }
.report-tab { padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; background: var(--bg3); border: 1px solid var(--border); color: var(--text2); transition: all .18s; white-space: nowrap; }
.report-tab.active, .report-tab:hover { background: var(--accent); color: #000; border-color: var(--accent); }
@media(max-width:480px) {
  .report-header .page-title { width: 100%; }
}

.date-filter-form {
  display: flex; gap: 10px; align-items: end; flex-wrap: wrap;
}
.date-filter-form .form-group { margin-bottom: 0; }
.date-filter-form input { width: auto; }
@media(max-width:480px) {
  .date-filter-form { flex-direction: column; }
  .date-filter-form .form-group { width: 100%; }
  .date-filter-form input { width: 100% !important; }
  .date-filter-form .btn { width: 100%; justify-content: center; }
}

.barbero-header {
  display: flex; align-items: center; gap: 14px; margin-bottom: 16px;
}
@media(max-width:480px) {
  .barbero-header { flex-wrap: wrap; gap: 8px; }
  .barbero-header .page-title { font-size: 18px; }
}

.barbero-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  display: flex; gap: 16px; align-items: center;
  transition: border-color .2s;
}
.barbero-card:hover { border-color: var(--accent); }
.barbero-mini-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(201,168,76,.2); color: #c9a84c;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; flex-shrink: 0;
}
.barbero-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: #000; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 20px; flex-shrink: 0;
}
.top-servicio-row { display: flex; justify-content: space-between; margin-bottom: 5px; }
.top-servicio-name { font-size: 14px; word-break: break-word; min-width: 0; }
.top-servicio-price { flex-shrink: 0; margin-left: 8px; }

/* ─── Login ──────────────────────────────────────────────── */
.login-body { min-height: 100vh; background: var(--bg); display: flex; align-items: center; justify-content: center; }
.login-card {
  width: 100%; max-width: 400px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 16px; padding: 40px 36px;
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo .icon { font-size: 40px; color: var(--accent); }
.login-logo h1 { font-family: var(--font-head); font-size: 36px; letter-spacing: 4px; color: var(--accent2); }
.login-logo p { color: var(--text2); font-size: 13px; }
.login-error { display: none; margin-bottom: 16px; }

/* ─── Misc ───────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.text-muted { color: var(--text2); }
.text-gold { color: var(--accent); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.fw-bold { font-weight: 600; }
.mt-1 { margin-top: 8px; }  .mt-2 { margin-top: 16px; }  .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; } .flex-1 { flex: 1; }
.gap-1 { gap: 8px; } .gap-2 { gap: 14px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-right { text-align: right; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 199; }

/* ─── Responsive ─────────────────────────────────────────── */
@media(max-width: 900px) {
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .pos-grid { grid-template-columns: 1fr; }
}

/* Mid-screen: grid-2 still 2 columns, compact card content */
@media(max-width:1100px) {
  .barbero-card { gap: 10px; padding: 14px; }
  .barbero-avatar { width: 36px; height: 36px; font-size: 16px; }
}

@media(max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .main-content { margin-left: 0; max-width: 100%; }
  .btn-menu { display: flex; align-items: center; }
  .page { padding: 20px 16px; }
  .page-title { font-size: 22px; }
  .page-title small { display: block; margin-left: 0; margin-top: 4px; }
  .checkin-banner { padding: 24px 16px; }
  .checkin-banner h2 { font-size: 20px; }
  .pos-grid .service-btn { padding: 10px 12px; font-size: 13px; }
  .total-display { font-size: 28px; }
  .modal { padding: 20px; margin: 12px; max-width: 100%; }
  .modal-backdrop { align-items: center; } /* centered even on mobile */
  .report-tabs { width: 100%; }
  .report-tab { flex: 1; text-align: center; font-size: 12px; padding: 8px 10px; }
  .stat-value { font-size: 26px; }
  .stat-card { padding: 16px 18px; }
  .grid-2 { grid-template-columns: 1fr; }
  .chart-wrap { height: 180px; }
  .login-card { margin: 16px; padding: 28px 24px; }
  .form-control { font-size: 16px; } /* previene zoom en iOS */
  select.form-control { font-size: 16px; }
}

@media(max-width: 480px) {
  table { font-size: 12px; }
  th, td { padding: 6px 6px; }
  th { font-size: 10px; letter-spacing: 0.5px; }
  .stat-value { font-size: 22px; }
  .stat-card { padding: 12px 14px; gap: 10px; }
  .stat-icon { width: 32px; height: 32px; font-size: 14px; }
  .barbero-stats { flex-wrap: wrap; gap: 6px; }
  .pos-grid { grid-template-columns: 1fr; }
  .service-btn { min-width: 0; padding: 10px 12px; font-size: 13px; }
  .btn-lg { padding: 10px 18px; font-size: 14px; }
  .card { padding: 14px; }
  .page-title { font-size: 20px; }
  .total-display { font-size: 24px; }
  .service-chip { padding: 9px 10px; font-size: 13px; }
  .service-chip-name { font-size: 13px; }
  .service-chip-price { font-size: 13px; }
  .modal-title { font-size: 18px; }
  .modal { padding: 16px; margin: 8px; }
  .modal-footer { flex-direction: column; }
  .modal-footer .btn { width: 100%; justify-content: center; }
  .checkin-banner { padding: 20px 12px; }
  .checkin-banner h2 { font-size: 18px; }
  .checkin-banner p { font-size: 13px; }
  .report-header { flex-direction: column; align-items: stretch; }
  .report-tabs { width: 100%; }
  .report-tab { flex: 1; text-align: center; font-size: 11px; padding: 8px 6px; }
  .chart-wrap { height: 160px; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .barbero-avatar { width: 36px; height: 36px; font-size: 16px; }
  .barbero-stat-val { font-size: 18px; }
  .btn-sm { padding: 5px 10px; font-size: 12px; }
  .service-btn, .extra-btn { padding: 10px 12px; font-size: 13px; }
  td .btn { padding: 4px 8px; font-size: 11px; }
  /* Hide less important table columns on mobile */
  .hide-mobile, .table-col-pago { display: none; }
  .table-col-tipo { display: none; }
}

/* ─── Animations ─────────────────────────────────────────── */
@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp  { from { transform: translateY(18px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes pulse    { 0%,100% { opacity: 1; } 50% { opacity: .5; } }
.pulse { animation: pulse 2s infinite; }

/* ─── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* foto upload preview */
.foto-preview { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); display: none; }
