:root {
    --cc-green: #1e6d42;
    --cc-green-light: #2d945b;
    --cc-orange: #fb6b25;
    --bg-color: #f1f5f9;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
}

/* TOP BAR */
.top-bar {
    background-color: var(--cc-green);
    color: white;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
}
.top-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.top-bar-logo {
    height: 35px;
    border-radius: 5px;
}
.top-bar-title {
    font-weight: 700;
    font-size: 18px;
}
.top-bar-right button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
}

/* VIEWS */
.view {
    display: none;
    padding: 80px 15px 20px 15px; /* offset for top bar */
    min-height: 100vh;
    animation: fadeIn 0.3s ease;
}
.view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* LOGIN */
.login-container {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px 20px;
    margin-top: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}
.login-logo-wrapper {
    text-align: center;
    margin-bottom: 30px;
}
.login-logo {
    height: 80px;
    margin-bottom: 10px;
}
.login-logo-wrapper h1 {
    font-size: 24px;
    color: var(--cc-green);
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}
.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}
.input-group input {
    width: 100%;
    padding: 16px 16px 16px 45px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    background: #f8fafc;
    transition: 0.2s;
}
.input-group input:focus {
    border-color: var(--cc-orange);
    outline: none;
    background: #fff;
}

.btn-primary {
    background: var(--cc-orange);
    color: white;
    border: none;
    width: 100%;
    padding: 18px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(251, 107, 37, 0.3);
}
.btn-primary:active {
    transform: scale(0.98);
}
.btn-primary:disabled {
    background: #cbd5e1;
    box-shadow: none;
}

/* GENERAL VIEWS HEADERS */
.view-header {
    margin-bottom: 20px;
}
.view-header h2 {
    font-size: 22px;
    color: var(--text-main);
}
.view-header .subtitle {
    color: var(--cc-orange);
    font-weight: 600;
    font-size: 14px;
}
.with-back {
    display: flex;
    align-items: center;
    gap: 15px;
}
.btn-back {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 18px;
    color: var(--text-main);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* CANCHAS GRID */
.canchas-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}
.cancha-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 2px solid transparent;
    transition: 0.2s;
}
.cancha-card:active {
    transform: scale(0.98);
    border-color: var(--cc-green);
}
.cancha-info h3 {
    font-size: 20px;
    color: var(--cc-green);
    margin-bottom: 5px;
}
.cancha-info p {
    color: var(--text-muted);
    font-size: 14px;
}
.cancha-icon {
    font-size: 30px;
    color: var(--border-color);
}

/* PARTIDOS LIST */
.partidos-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.partido-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.partido-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}
.partido-teams {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.team {
    text-align: center;
    width: 40%;
}
.team img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 8px;
    background: #f1f5f9;
}
.team-name {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.vs {
    font-size: 16px;
    font-weight: 800;
    color: var(--border-color);
}
.partido-action {
    margin-top: 15px;
}
.btn-anotar {
    background: var(--cc-green);
    color: white;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
}
.btn-anotar:active { background: var(--cc-green-light); }

/* TOAST */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #334155;
    color: white;
    padding: 12px 20px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
    z-index: 1000;
}
.toast.show {
    transform: translateX(-50%) translateY(0);
}
.toast.error { background: #ef4444; }
.toast.success { background: #22c55e; }
