/* ============================================================
   AlugaArena - Sistema de Gerenciamento de Quadras Esportivas
   Estilos principais
   ============================================================ */

:root {
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --primary-green: #198754;
    --dark-bg: #1a1d23;
    --sidebar-bg: #1e2329;
    --sidebar-text: #adb5bd;
    --sidebar-active: #198754;
    --topbar-height: 60px;
}

/* ============================================================
   Layout geral
   ============================================================ */
* { box-sizing: border-box; }

body.alugaarena-body {
    background: #f0f2f5;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    overflow-x: hidden;
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    padding: 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    min-height: 70px;
}

.sidebar-brand i {
    font-size: 1.6rem;
    flex-shrink: 0;
}

.brand-text {
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    margin-left: 10px;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.sidebar.collapsed .brand-text,
.sidebar.collapsed .user-info,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .sidebar-footer span {
    opacity: 0;
    pointer-events: none;
}

.sidebar-user {
    display: flex;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.user-avatar {
    font-size: 2rem;
    color: var(--primary-green);
    flex-shrink: 0;
}

.user-info {
    margin-left: 10px;
    overflow: hidden;
    transition: opacity 0.2s;
}

.user-name {
    display: block;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav {
    list-style: none;
    padding: 12px 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 11px 18px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 0;
    transition: all 0.2s;
    white-space: nowrap;
    gap: 12px;
}

.sidebar-nav .nav-link i {
    font-size: 1.15rem;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.sidebar-nav .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.07);
}

.sidebar-nav .nav-link.active {
    color: #fff;
    background: var(--primary-green);
    border-left: 3px solid #5cb85c;
}

.sidebar-footer {
    padding: 12px 0;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-footer .nav-link {
    display: flex;
    align-items: center;
    padding: 11px 18px;
    text-decoration: none;
    gap: 12px;
    white-space: nowrap;
    transition: all 0.2s;
}

.sidebar-footer .nav-link:hover {
    background: rgba(220,53,69,0.15);
}

/* ============================================================
   Main content
   ============================================================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.main-content.expanded {
    margin-left: var(--sidebar-collapsed);
}

.top-navbar {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    height: var(--topbar-height);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.page-content {
    padding: 24px;
}

/* ============================================================
   Stat cards
   ============================================================ */
.stat-card {
    border-radius: 12px;
    padding: 20px;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
}

.stat-icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
    opacity: 0.9;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.85;
    font-weight: 500;
}

.stat-card-green  { background: linear-gradient(135deg, #198754, #20c997); }
.stat-card-blue   { background: linear-gradient(135deg, #0d6efd, #0dcaf0); }
.stat-card-purple { background: linear-gradient(135deg, #6f42c1, #d63384); }
.stat-card-orange { background: linear-gradient(135deg, #fd7e14, #ffc107); }
.stat-card-teal   { background: linear-gradient(135deg, #20c997, #0d6efd); }
.stat-card-pink   { background: linear-gradient(135deg, #d63384, #fd7e14); }

/* ============================================================
   Calendário de reservas
   ============================================================ */
.calendar-table {
    font-size: 0.82rem;
}

.hora-col {
    width: 70px;
    background: #f8f9fa;
}

.today-col {
    background: #ffc107 !important;
    color: #333 !important;
    font-weight: 700 !important;
}

.today-col div {
    color: #333 !important;
}

.today-cell {
    background: rgba(255, 193, 7, 0.12) !important;
    border-left: 2px solid #ffc107 !important;
    border-right: 2px solid #ffc107 !important;
}

/* Última linha da coluna hoje */
tr:last-child .today-cell {
    border-bottom: 2px solid #ffc107 !important;
}

.calendar-cell {
    height: 44px;
    cursor: pointer;
}

.slot-disponivel {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    border-radius: 6px;
    background: rgba(25, 135, 84, 0.1);
    color: #198754;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 1rem;
}

.slot-disponivel:hover {
    background: rgba(25, 135, 84, 0.25);
    transform: scale(1.05);
}

.slot-reservado {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 34px;
    border-radius: 6px;
    background: rgba(220, 53, 69, 0.12);
    color: #dc3545;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.7rem;
    padding: 2px;
}

.slot-reservado:hover {
    background: rgba(220, 53, 69, 0.25);
}

.slot-nome {
    font-size: 0.65rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* Slot passado / indisponível */
.slot-passado {
    background: #f0f0f0 !important;
}

.slot-indisponivel {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    border-radius: 6px;
    background: rgba(108, 117, 125, 0.1);
    color: #adb5bd;
    cursor: not-allowed;
    font-size: 0.8rem;
}

.slot-indisponivel:hover {
    background: rgba(108, 117, 125, 0.15);
}

.slot-disponivel-mini {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    background: rgba(25, 135, 84, 0.2);
    border: 1px solid #198754;
}

.slot-reservado-mini {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid #dc3545;
}

/* ============================================================
   Cards de quadra
   ============================================================ */
.quadra-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.quadra-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12) !important;
}

/* ============================================================
   Time badge (dashboard)
   ============================================================ */
.time-badge {
    background: var(--primary-green);
    color: white;
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 50px;
    text-align: center;
}

/* ============================================================
   Rank badge (clientes)
   ============================================================ */
.rank-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-green);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ============================================================
   Login
   ============================================================ */
body.login-body {
    background: linear-gradient(135deg, #1a1d23 0%, #198754 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-wrapper {
    width: 100%;
    max-width: 460px;
    padding: 16px;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 36px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-logo {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #198754, #20c997);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 2rem;
    color: white;
}

/* ============================================================
   Responsividade
   ============================================================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .page-content {
        padding: 16px;
    }
    .stat-value {
        font-size: 1.2rem;
    }
}

/* ============================================================
   Utilitários
   ============================================================ */
.card {
    border: none;
    border-radius: 10px;
}

.card-header {
    border-radius: 10px 10px 0 0 !important;
}

.table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.btn {
    border-radius: 7px;
}

.form-control, .form-select {
    border-radius: 7px;
}

.badge {
    border-radius: 5px;
}

/* Scrollbar personalizada */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }
