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

:root {
  --navy: #1a2b5c;
  --blue: #3b5bdb;
  --blue-light: #e8edff;
  --green: #40c057;
  --yellow: #fab005;
  --red: #fa5252;
  --gray: #f8f9fa;
  --border: #e9ecef;
  --text: #212529;
  --muted: #868e96;
  --white: #ffffff;
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: var(--text); background: #f0f2f5; }

/* AUTH */
.auth-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #f0f2f5; }
.auth-box { background: var(--white); border-radius: 16px; padding: 40px; width: 400px; box-shadow: 0 4px 24px rgba(0,0,0,.08); }
.auth-logo { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 28px; font-size: 20px; font-weight: 700; color: var(--navy); }
.logo-circle { width: 48px; height: 48px; background: var(--navy); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: 20px; }
.logo-circle.small { width: 36px; height: 36px; font-size: 15px; }
.auth-tabs { display: flex; gap: 0; margin-bottom: 24px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.tab-btn { flex: 1; padding: 10px; border: none; background: var(--gray); cursor: pointer; font-size: 14px; font-weight: 500; color: var(--muted); transition: all .2s; }
.tab-btn.active { background: var(--blue); color: white; }

/* LAYOUT */
.layout { display: flex; height: 100vh; }
.sidebar { width: 240px; background: var(--navy); display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-logo { display: flex; align-items: center; gap: 10px; padding: 20px 16px; color: white; font-weight: 700; font-size: 16px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.sidebar-bottom { padding: 12px 0; border-top: 1px solid rgba(255,255,255,.1); }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 11px 16px; color: rgba(255,255,255,.7); cursor: pointer; text-decoration: none; font-size: 14px; border-radius: 0; transition: all .2s; }
.nav-item:hover { background: rgba(255,255,255,.08); color: white; }
.nav-item.active { background: var(--blue); color: white; border-radius: 0; }
.nav-icon { font-size: 16px; width: 20px; text-align: center; }
.content { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; background: white; border-bottom: 1px solid var(--border); }
.topbar-user { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 500; }
.bell { cursor: pointer; font-size: 18px; }
#page-content { padding: 24px; flex: 1; }

/* INPUTS */
.input { width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; transition: border .2s; margin-bottom: 12px; background: white; }
.input:focus { border-color: var(--blue); }
select.input { cursor: pointer; }

/* BUTTONS */
.btn-primary { background: var(--blue); color: white; border: none; padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; transition: opacity .2s; }
.btn-primary:hover { opacity: .88; }
.btn-primary.full { width: 100%; }
.btn-secondary { background: white; color: var(--blue); border: 1.5px solid var(--blue); padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; transition: all .2s; }
.btn-secondary:hover { background: var(--blue-light); }
.btn-danger { background: white; color: var(--red); border: 1.5px solid var(--red); padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { background: none; border: 1.5px solid var(--border); border-radius: 50%; width: 32px; height: 32px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px; transition: all .2s; }
.btn-icon:hover { border-color: var(--blue); }
.btn-icon.del:hover { border-color: var(--red); }

/* CARDS */
.card { background: white; border-radius: 12px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-title { font-size: 22px; font-weight: 700; }
.back-btn { background: none; border: none; cursor: pointer; font-size: 20px; color: var(--muted); margin-right: 8px; }

/* TABLE */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 10px 12px; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; border-bottom: 1.5px solid var(--border); cursor: pointer; user-select: none; }
th:hover { color: var(--text); }
td { padding: 12px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray); }
.td-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* FILTERS */
.filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.search-input { position: relative; }
.search-input input { padding-left: 32px; }
.search-input::before { content: '🔍'; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 13px; pointer-events: none; }
.filter-select { padding: 9px 14px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 14px; cursor: pointer; background: white; }

/* BADGES */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-green { background: #d3f9d8; color: #2f9e44; }
.badge-yellow { background: #fff3bf; color: #e67700; }
.badge-blue { background: #dbe4ff; color: #3b5bdb; }
.badge-gray { background: #f1f3f5; color: #868e96; }
.badge-red { background: #ffe3e3; color: #c92a2a; }

/* STATS GRID */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.stat-card { background: white; border-radius: 12px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.stat-card .label { font-size: 13px; color: var(--muted); margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; }
.stat-card .value { font-size: 32px; font-weight: 700; color: var(--blue); }

/* COMPETITION CARDS */
.comp-card { background: white; border-radius: 12px; padding: 16px 20px; margin-bottom: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.06); display: flex; align-items: center; justify-content: space-between; }
.comp-card-info { flex: 1; }
.comp-card-title { font-size: 16px; font-weight: 600; margin: 6px 0 4px; }
.comp-card-meta { font-size: 13px; color: var(--muted); display: flex; gap: 16px; }
.comp-card-actions { display: flex; gap: 8px; align-items: center; }

/* FORM */
.form-section { margin-bottom: 20px; }
.form-section-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; color: var(--text); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row.three { grid-template-columns: 1fr 1fr 1fr; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 12px; color: var(--muted); font-weight: 500; }
.form-group .input { margin-bottom: 0; }
.toggle-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 14px; }
toggle-row input[type=checkbox] { width: 18px; height: 18px; cursor: pointer; }

/* PAGINATION */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 20px; }
.page-btn { width: 32px; height: 32px; border: 1.5px solid var(--border); border-radius: 8px; background: white; cursor: pointer; font-size: 13px; display: flex; align-items: center; justify-content: center; transition: all .2s; }
.page-btn.active { background: var(--blue); color: white; border-color: var(--blue); }
.page-btn:hover:not(.active) { border-color: var(--blue); color: var(--blue); }

/* MODAL */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-box { background: white; border-radius: 16px; padding: 28px; min-width: 360px; max-width: 500px; width: 90%; }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-type-btn { width: 100%; padding: 14px; border: 1.5px solid var(--border); border-radius: 10px; background: white; font-size: 15px; font-weight: 500; cursor: pointer; margin-bottom: 10px; transition: all .2s; color: var(--blue); }
.modal-type-btn:hover { border-color: var(--blue); background: var(--blue-light); }

/* TABS */
.tabs { display: flex; gap: 0; border-radius: 10px; overflow: hidden; border: 1.5px solid var(--border); margin-bottom: 20px; width: fit-content; }
.tab { padding: 8px 20px; border: none; background: white; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--muted); transition: all .2s; }
.tab.active { background: var(--blue-light); color: var(--blue); }

/* PROFILE CARD */
.profile-card { background: white; border-radius: 12px; padding: 20px; display: flex; align-items: center; gap: 20px; margin-bottom: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--navy); color: white; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; flex-shrink: 0; }
.profile-info { flex: 1; }
.profile-name { font-size: 18px; font-weight: 700; }
.profile-role { font-size: 13px; color: var(--muted); margin-top: 2px; }

.error-msg { color: var(--red); font-size: 13px; margin-top: 8px; min-height: 18px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); font-size: 15px; }

/* SWITCH */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background: #ccc; border-radius: 24px; transition: .3s; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: .3s; }
input:checked + .slider { background: var(--blue); }
input:checked + .slider:before { transform: translateX(20px); }
