/* ========== VARIABLES ========== */
:root {
  --green-dark:  #1b4332;
  --green:       #2d6a4f;
  --green-light: #40916c;
  --green-pale:  #d8f3dc;
  --yellow:      #f4d03f;
  --yellow-dark: #d4ac0d;
  --bg:          #f0f4f1;
  --surface:     #ffffff;
  --surface2:    #f8faf8;
  --border:      #e0e8e3;
  --text:        #1a2e22;
  --text-2:      #4a6358;
  --text-3:      #8aab9a;
  --red:         #e74c3c;
  --orange:      #e67e22;
  --blue:        #2980b9;
  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 2px 12px rgba(0,0,0,.08);
  --shadow-md:   0 4px 24px rgba(0,0,0,.12);
  --sidebar-w:   240px;
  --header-h:    56px;
  --transition:  .2s ease;
}

/* ========== RESET ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
img { max-width: 100%; }
input, select, textarea { font-family: inherit; font-size: 1rem; }

/* ========== SIDEBAR ========== */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--green-dark);
  display: flex; flex-direction: column;
  z-index: 1000; transition: transform var(--transition);
}
.sidebar-logo {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-logo img { width: 60px; height: 60px; object-fit: contain; border-radius: 10px; }
.sidebar-logo span { font-size: 1rem; font-weight: 800; color: #fff; letter-spacing: -.4px; line-height: 1.2; }
.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  color: rgba(255,255,255,.75); font-size: .875rem; font-weight: 500;
  transition: background var(--transition), color var(--transition);
  margin-bottom: 2px;
}
.sidebar-nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.sidebar-nav a.active { background: var(--yellow); color: var(--green-dark); }
.sidebar-nav a svg { flex-shrink: 0; opacity: .85; }
.sidebar-nav a.active svg { opacity: 1; }
.nav-section { font-size: .7rem; font-weight: 600; color: rgba(255,255,255,.4);
  padding: 12px 12px 4px; text-transform: uppercase; letter-spacing: .8px; }
.nav-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--yellow); color: var(--green-dark);
  border-radius: 10px; font-size: .65rem; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.sidebar-nav a.active .nav-badge { background: var(--green-dark); color: var(--yellow); }
.sidebar-footer {
  padding: 12px; border-top: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; gap: 8px;
}
.user-chip { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.user-chip img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.2); flex-shrink: 0; }
.user-chip div { min-width: 0; }
.user-chip span { display: block; font-size: .82rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip small { color: var(--yellow); font-size: .7rem; font-weight: 500; }
.btn-logout { padding: 7px; border-radius: 8px; color: rgba(255,255,255,.6); transition: all var(--transition); flex-shrink: 0; }
.btn-logout:hover { background: rgba(255,255,255,.1); color: #fff; }

/* ========== MOBILE HEADER ========== */
.mobile-header {
  display: none; position: fixed; top: 0; left: 0; right: 0; height: 88px;
  background: var(--green-dark); align-items: center; justify-content: space-between;
  padding: 0 16px; z-index: 1001;
}
.menu-btn { padding: 8px; border-radius: 8px; color: #fff; }
.mobile-logo { height: 80px; object-fit: contain; }
.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 999; }
.overlay.show { display: block; }

/* ========== MAIN CONTENT ========== */
.main-content { margin-left: var(--sidebar-w); min-height: 100vh; }
.page-wrapper { padding: 28px 32px; max-width: 1200px; }

/* ========== TYPOGRAPHY ========== */
.page-title { font-size: 1.6rem; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.page-subtitle { color: var(--text-2); font-size: .9rem; margin-bottom: 24px; }

/* ========== CARDS ========== */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.card-title { font-size: 1rem; font-weight: 700; }

/* ========== STATS GRID ========== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px; }
.stat-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon.green  { background: var(--green-pale); color: var(--green); }
.stat-icon.yellow { background: #fef9e7; color: var(--yellow-dark); }
.stat-icon.blue   { background: #ebf5fb; color: var(--blue); }
.stat-icon.red    { background: #fdedec; color: var(--red); }
.stat-value { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: .78rem; color: var(--text-2); margin-top: 2px; }

/* ========== BUTTONS ========== */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: var(--radius-sm); font-size: .875rem; font-weight: 600; transition: all var(--transition); white-space: nowrap; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-light); }
.btn-accent  { background: var(--yellow); color: var(--green-dark); }
.btn-accent:hover  { background: var(--yellow-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--green); border: 2px solid var(--green); }
.btn-outline:hover { background: var(--green-pale); }
.btn-danger  { background: var(--red); color: #fff; }
.btn-danger:hover  { background: #c0392b; }
.btn-ghost   { background: transparent; color: var(--text-2); padding: 6px 10px; }
.btn-ghost:hover   { background: var(--surface2); }
.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ========== FORMS ========== */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1/-1; }
label { font-size: .82rem; font-weight: 600; color: var(--text-2); }
input, select, textarea {
  padding: 9px 12px; border: 2px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface2); color: var(--text); transition: border-color var(--transition);
  width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); background: #fff; }
textarea { resize: vertical; min-height: 80px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.input-err { font-size: .78rem; color: var(--red); }

/* ========== TABLES ========== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th { padding: 10px 14px; text-align: left; font-size: .75rem; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .5px; border-bottom: 2px solid var(--border); white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface2); }
.td-actions { display: flex; gap: 4px; }

/* ========== BADGES ========== */
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 20px; font-size: .72rem; font-weight: 700; letter-spacing: .2px; }
.badge-A { background: #fef9e7; color: #d4ac0d; }
.badge-B { background: #ebf5fb; color: #2980b9; }
.badge-C { background: var(--green-pale); color: var(--green); }
.badge-D { background: #f8f9fa; color: #6c757d; }
.badge-admin   { background: #f5b7b1; color: #922b21; }
.badge-player  { background: var(--green-pale); color: var(--green); }
.status-scheduled { background: #ebf5fb; color: var(--blue); }
.status-finished  { background: var(--green-pale); color: var(--green); }
.status-cancelled { background: #fdedec; color: var(--red); }
.status-ongoing   { background: #fef9e7; color: var(--yellow-dark); }
.status-draft     { background: #f8f9fa; color: #6c757d; }
.status-open      { background: var(--green-pale); color: var(--green); }

/* ========== PLAYER AVATAR ========== */
.avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); }
.avatar-sm { width: 28px; height: 28px; }
.avatar-lg { width: 64px; height: 64px; }
.avatar-xl { width: 90px; height: 90px; }
.player-cell { display: flex; align-items: center; gap: 10px; }
.player-cell strong { display: block; font-weight: 600; font-size: .875rem; }
.player-cell span { font-size: .75rem; color: var(--text-2); }

/* ========== RANKING CARD ========== */
.ranking-card { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: var(--surface); border-radius: var(--radius-sm); border: 1px solid var(--border); margin-bottom: 8px; transition: box-shadow var(--transition); }
.ranking-card:hover { box-shadow: var(--shadow); }
.rank-number { width: 30px; text-align: center; font-size: 1rem; font-weight: 800; color: var(--text-2); flex-shrink: 0; }
.rank-number.top-1 { color: #d4ac0d; }
.rank-number.top-2 { color: #7f8c8d; }
.rank-number.top-3 { color: #ca6f1e; }
.ranking-info { flex: 1; min-width: 0; }
.ranking-info strong { font-size: .9rem; font-weight: 600; display: block; }
.ranking-info span { font-size: .78rem; color: var(--text-2); }
.ranking-points { font-size: 1.1rem; font-weight: 800; color: var(--green); }

/* ========== MATCH CARD ========== */
.match-card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); padding: 16px; margin-bottom: 12px; }
.match-vs { display: flex; align-items: center; gap: 12px; }
.match-player { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; text-align: center; }
.match-player strong { font-size: .875rem; font-weight: 600; }
.match-player.winner strong { color: var(--green); }
.match-sep { font-size: 1.2rem; font-weight: 800; color: var(--text-3); flex-shrink: 0; }
.match-score { text-align: center; font-size: 1.1rem; font-weight: 800; color: var(--green-dark); margin: 8px 0 4px; }
.match-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: .75rem; color: var(--text-2); border-top: 1px solid var(--border); padding-top: 8px; margin-top: 8px; }
.match-meta span { display: flex; align-items: center; gap: 4px; }

/* ========== TABS ========== */
.tabs { display: flex; gap: 4px; background: var(--surface2); border-radius: 10px; padding: 4px; width: fit-content; margin-bottom: 20px; }
.tab { padding: 7px 18px; border-radius: 7px; font-size: .85rem; font-weight: 600; color: var(--text-2); cursor: pointer; transition: all var(--transition); }
.tab.active { background: var(--surface); color: var(--green); box-shadow: var(--shadow); }
.tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--yellow); color: var(--green-dark);
  border-radius: 8px; font-size: .62rem; font-weight: 800; margin-left: 5px;
}
.invite-section-title {
  display: flex; align-items: center; gap: 7px;
  font-size: .8rem; font-weight: 700; color: var(--text-2);
  text-transform: uppercase; letter-spacing: .6px;
  margin-bottom: 10px;
}

/* ========== MAP ========== */
#court-map { height: 400px; border-radius: var(--radius); overflow: hidden; border: 2px solid var(--border); }

/* ========== COURT CARD ========== */
.court-card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); padding: 16px; }
.court-card h4 { font-size: .95rem; font-weight: 700; margin-bottom: 4px; }
.court-card p { font-size: .8rem; color: var(--text-2); }

/* ========== TOURNAMENT ========== */
.tournament-card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); padding: 20px; cursor: pointer; transition: box-shadow var(--transition), transform var(--transition); }
.tournament-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.tournament-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.bracket-round { margin-bottom: 24px; }
.bracket-round h4 { font-size: .85rem; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px; }

/* ========== PROFILE ========== */
.profile-header { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.avatar-upload { position: relative; }
.avatar-upload-btn { position: absolute; bottom: 0; right: 0; background: var(--green); color: #fff; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; }

/* ========== LOGIN ========== */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 480px;
}
.login-hero {
  background: linear-gradient(155deg, #1b4332 0%, #2d6a4f 50%, #40916c 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px; position: relative; overflow: hidden;
}
.login-hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 60px, rgba(255,255,255,.03) 60px, rgba(255,255,255,.03) 62px),
    repeating-linear-gradient(90deg, transparent, transparent 60px, rgba(255,255,255,.03) 60px, rgba(255,255,255,.03) 62px);
}
.login-hero-logo {
  position: relative; text-align: center;
}
.login-hero-logo img {
  width: 220px; max-width: 60vw; height: auto;
  filter: drop-shadow(0 8px 32px rgba(0,0,0,.3));
  border-radius: 16px;
}
.login-hero h1 {
  color: #fff; font-size: 2rem; font-weight: 800;
  margin-top: 28px; letter-spacing: -.5px; line-height: 1.2;
}
.login-hero p {
  color: rgba(255,255,255,.7); font-size: 1rem; margin-top: 10px;
}
.login-hero-features {
  margin-top: 40px; display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 340px;
}
.login-hero-features div {
  display: flex; align-items: center; gap: 12px;
  color: rgba(255,255,255,.85); font-size: .9rem;
}
.login-hero-features span {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.login-form-panel {
  background: #fff; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 48px 44px;
}
.login-form-inner { width: 100%; max-width: 360px; }
.login-form-logo { display: none; text-align: center; margin-bottom: 32px; }
.login-form-logo img { width: 180px; height: auto; border-radius: 16px; }
.login-form-title { font-size: 1.6rem; font-weight: 800; color: var(--green-dark); margin-bottom: 6px; }
.login-form-sub { color: var(--text-2); font-size: .9rem; margin-bottom: 32px; }
.login-input-group {
  position: relative; margin-bottom: 18px;
}
.login-input-group label {
  font-size: .78rem; font-weight: 700; color: var(--text-2);
  display: block; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px;
}
.login-input-group input {
  width: 100%; padding: 13px 16px; border: 2px solid var(--border);
  border-radius: 10px; font-size: 1rem; transition: all var(--transition);
  background: var(--surface2); color: var(--text);
}
.login-input-group input:focus {
  border-color: var(--green); background: #fff; outline: none;
  box-shadow: 0 0 0 3px rgba(45,106,79,.12);
}
.btn-login-submit {
  width: 100%; padding: 14px; background: var(--green); color: #fff;
  border-radius: 10px; font-size: 1rem; font-weight: 700;
  transition: all var(--transition); cursor: pointer; border: none;
  margin-top: 8px; letter-spacing: .2px;
}
.btn-login-submit:hover { background: var(--green-light); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(45,106,79,.3); }
.btn-login-submit:disabled { opacity: .6; transform: none; cursor: not-allowed; }
.login-err {
  background: #fdedec; color: var(--red); border-radius: 8px;
  padding: 10px 14px; font-size: .85rem; margin-top: 14px; display: none;
}
@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .login-form-logo { display: block; }
  .login-form-panel { padding: 40px 24px; min-height: 100vh; }
}

/* ========== MODAL ========== */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: #fff; border-radius: 16px; padding: 28px; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-md); }
.modal h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 20px; }
.modal-close { float: right; margin-top: -4px; }

/* ========== TOAST ========== */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 3000; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--green-dark); color: #fff; padding: 12px 18px; border-radius: 10px; font-size: .875rem; font-weight: 500; box-shadow: var(--shadow-md); animation: slideIn .3s ease; display: flex; align-items: center; gap: 10px; max-width: 340px; }
.toast.error { background: var(--red); }
.toast.warning { background: var(--orange); }
.toast.success { background: var(--green-light); }
@keyframes slideIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }

/* ========== LOADING ========== */
.loading-screen { display: flex; align-items: center; justify-content: center; height: 60vh; }
.spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--green); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-inline { display: flex; align-items: center; justify-content: center; padding: 40px; }

/* ========== EMPTY STATE ========== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-2); }
.empty-state svg { opacity: .25; margin-bottom: 12px; }
.empty-state p { font-size: .9rem; }

/* ========== CLASSIFIEDS ========== */
.classifieds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 4px;
}
.classified-card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  display: flex; flex-direction: column;
  transition: box-shadow var(--transition);
}
.classified-card:hover { box-shadow: var(--shadow-md); }
.classified-cat-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 14px; background: var(--surface2); border-bottom: 1px solid var(--border);
}
.classified-cat-badge { font-size: .78rem; font-weight: 700; color: var(--green); }
.classified-body { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.classified-title { font-size: .95rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.classified-desc { font-size: .82rem; color: var(--text-2); line-height: 1.5; flex: 1; }
.classified-price { font-size: 1.1rem; font-weight: 800; color: var(--green-dark); margin-top: auto; padding-top: 6px; }
.classified-footer {
  padding: 10px 14px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}

/* ========== ACTIVITY LOG ========== */
.activity-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: var(--surface);
  border-radius: var(--radius-sm); margin-bottom: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  transition: box-shadow var(--transition);
}
.activity-row:hover { box-shadow: var(--shadow); }
.activity-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.activity-avatar { flex-shrink: 0; }
.activity-body { flex: 1; min-width: 0; }
.activity-text { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 3px; }
.activity-user { font-weight: 700; font-size: .875rem; }
.activity-badge {
  font-size: .68rem; font-weight: 700; padding: 2px 7px;
  border-radius: 20px; white-space: nowrap;
}
.activity-desc { font-size: .8rem; color: var(--text-2); line-height: 1.4; }
.activity-desc strong { color: var(--text); font-weight: 600; }
.activity-time {
  font-size: .75rem; color: var(--text-3); white-space: nowrap;
  flex-shrink: 0; cursor: default;
}

/* ========== CLASSIFIED PHOTOS ========== */
.classified-photos {
  display: flex; gap: 3px; height: 160px; overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
}
.classified-photos .classified-photo-thumb:first-child:last-child { flex: 1; border-radius: var(--radius) var(--radius) 0 0; }
.classified-photos .classified-photo-thumb:first-child:not(:last-child) { flex: 2; border-radius: var(--radius) 0 0 0; }
.classified-photos .classified-photo-thumb:not(:first-child) { flex: 1; }
.classified-photos .classified-photo-thumb:last-child:not(:first-child) { border-radius: 0 var(--radius) 0 0; }
.classified-photo-thumb {
  background-size: cover; background-position: center;
  cursor: pointer; transition: opacity .15s;
}
.classified-photo-thumb:hover { opacity: .88; }

/* ── Photo Upload Zone ── */
.photo-upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius-sm);
  min-height: 90px; padding: 10px; cursor: pointer;
  transition: border-color .15s;
  display: flex; align-items: center;
}
.photo-upload-zone:hover { border-color: var(--green); }
.photo-zone-inner { width: 100%; }
#photo-placeholder { text-align: center; padding: 12px 0; }
.photo-preview-grid {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 8px;
}
.photo-preview-item {
  position: relative; aspect-ratio: 1; border-radius: 6px;
  overflow: hidden; background: var(--surface2);
}
.photo-preview-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-remove-btn {
  position: absolute; top: 3px; right: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,.65); color: #fff;
  font-size: 14px; line-height: 1; display: flex;
  align-items: center; justify-content: center;
  cursor: pointer; border: none;
}
.photo-remove-btn:hover { background: var(--red); }
.photo-new-badge {
  position: absolute; bottom: 3px; left: 3px;
  background: var(--green); color: #fff;
  font-size: .6rem; font-weight: 700; padding: 1px 5px; border-radius: 4px;
}
.photo-add-slot {
  aspect-ratio: 1; border-radius: 6px;
  border: 2px dashed var(--border); display: flex;
  align-items: center; justify-content: center;
  font-size: 1.4rem; color: var(--text-3); cursor: pointer;
  transition: border-color .15s, color .15s;
}
.photo-add-slot:hover { border-color: var(--green); color: var(--green); }

/* ── Lightbox ── */
.lightbox-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.92);
  display: flex; align-items: center; justify-content: center;
  z-index: 4000;
}
.lightbox {
  position: relative; max-width: 92vw; max-height: 92vh;
  display: flex; align-items: center; justify-content: center;
}
.lightbox img {
  max-width: 90vw; max-height: 85vh; border-radius: 8px;
  object-fit: contain; display: block;
}
.lightbox-close {
  position: absolute; top: -40px; right: 0;
  color: #fff; font-size: 2rem; background: none; border: none;
  cursor: pointer; line-height: 1; opacity: .8;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.15); color: #fff; border: none;
  font-size: 2rem; width: 44px; height: 44px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.lightbox-arrow:hover { background: rgba(255,255,255,.3); }
.lightbox-prev { left: -54px; }
.lightbox-next { right: -54px; }
.lightbox-dots {
  position: absolute; bottom: -28px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px;
}
.lb-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,.4); cursor: pointer; transition: background .15s;
}
.lb-dot.active { background: #fff; }

/* ========== SEARCH / FILTER BAR ========== */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; align-items: center; }
.search-input { padding: 8px 12px; border: 2px solid var(--border); border-radius: var(--radius-sm); width: 240px; background: var(--surface); }
.search-input:focus { outline: none; border-color: var(--green); }

/* ========== GRID LAYOUTS ========== */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 16px; }

/* ========== SURFACE COLORS ========== */
.surface-clay     { color: #c0392b; font-weight: 600; }
.surface-grass    { color: var(--green); font-weight: 600; }
.surface-hard     { color: var(--blue); font-weight: 600; }
.surface-synthetic { color: var(--orange); font-weight: 600; }

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .mobile-header { display: flex; }
  .sidebar { transform: translateX(-100%); top: 0; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding-top: 88px; }
  .page-wrapper { padding: 20px 16px; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .form-grid { grid-template-columns: 1fr; }
  #court-map { height: 280px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .tabs { width: 100%; overflow-x: auto; }
}
