* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    display: flex;
}

/* Sidebar Styles */
.sidebar {
    width: 250px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    color: white;
}

.sidebar .logo {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar .logo h2 {
    font-size: 24px;
    font-weight: 600;
}

.nav-menu ul {
    list-style: none;
    padding: 20px 0;
}

.nav-menu li {
    margin-bottom: 5px;
}

.nav-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: rgba(255, 255, 255, 0.1);
    border-left: 3px solid white;
}

.nav-menu .icon {
    margin-right: 10px;
    font-size: 20px;
}

/* Main Content */
.main-content {
    margin-left: 250px;
    width: calc(100% - 250px);
    padding: 20px;
}

.header {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.header h1 {
    color: #333;
    font-size: 28px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #666;
}

.btn-logout {
    background: #dc3545;
    color: white;
    padding: 8px 16px;
    border-radius: 5px;
    text-decoration: none;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: #c82333;
}

/* Cards */
.card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.card-header h3 {
    color: #333;
    font-size: 18px;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: transform 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.btn-success {
    background: #28a745;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #dee2e6;
}

table td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
}

table tr:hover {
    background: #f8f9fa;
}

/* Badges */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.badge-primary {
    background: #007bff;
    color: white;
}

.badge-success {
    background: #28a745;
    color: white;
}

.badge-danger {
    background: #dc3545;
    color: white;
}

.badge-warning {
    background: #ffc107;
    color: #333;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 10px;
    width: 500px;
    max-width: 90%;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

/* Search Bar */
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-bar input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.search-bar button {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* Responsive - Tablet */
@media (max-width: 992px) {
    .sidebar {
        width: 200px;
    }
    
    .main-content {
        margin-left: 200px;
        width: calc(100% - 200px);
    }
    
    .header h1 {
        font-size: 22px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .management-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        min-height: auto;
        position: relative;
        display: block;
    }
    
    .sidebar .logo {
        padding: 15px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .sidebar .logo h2 {
        font-size: 20px;
    }
    
    .nav-menu ul {
        display: none;
        padding: 10px 0;
    }
    
    .nav-menu.active ul {
        display: block;
    }
    
    .nav-menu a {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 10px;
    }
    
    .header {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
        text-align: center;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .user-info {
        flex-wrap: wrap;
        justify-content: center;
        font-size: 14px;
    }
    
    /* Stats Cards */
    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }
    
    .stat-card {
        padding: 15px !important;
    }
    
    .stat-card h3 {
        font-size: 20px !important;
    }
    
    .stat-card p {
        font-size: 12px !important;
    }
    
    /* Tables - Scrollable */
    .table-container, .clients-table, .section, .management-section, .settings-card, .report-card {
        overflow-x: auto;
    }
    
    table {
        min-width: 600px;
        font-size: 12px;
    }
    
    table th, table td {
        padding: 8px 6px;
        white-space: nowrap;
    }
    
    /* Forms */
    .form-row {
        grid-template-columns: 1fr !important;
    }
    
    .form-group input, .form-group select, .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Buttons */
    .btn-primary, .btn-secondary, .btn-success, .btn-danger {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    /* Search Bar */
    .search-bar {
        flex-direction: column;
    }
    
    .search-bar input, .search-bar button {
        width: 100%;
    }
    
    /* Modal */
    .modal-content {
        margin: 10% auto;
        padding: 20px;
        width: 95%;
    }
    
    /* Cards */
    .card {
        padding: 15px;
    }
    
    /* Dashboard specific */
    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }
    
    .latest-sales, .quick-actions {
        padding: 15px !important;
    }
    
    /* Gym page */
    .gym-sections {
        grid-template-columns: 1fr !important;
    }
    
    .attendance-search {
        flex-direction: column !important;
    }
    
    .attendance-search input, .attendance-search button {
        width: 100% !important;
        min-width: auto !important;
    }
    
    /* POS page */
    .pos-container {
        grid-template-columns: 1fr !important;
    }
    
    /* Reports page */
    .report-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Settings page */
    .settings-sections {
        grid-template-columns: 1fr !important;
    }
    
    .color-options {
        flex-wrap: wrap !important;
    }
    
    .color-option {
        width: 40px !important;
        height: 40px !important;
    }
    
    /* Social media page */
    .social-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Very small phones */
@media (max-width: 400px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
    
    .header h1 {
        font-size: 16px;
    }
    
    table {
        font-size: 11px;
    }
    
    .btn-primary, .btn-secondary, .btn-success, .btn-danger {
        padding: 6px 10px;
        font-size: 11px;
    }
}

/* Mobile menu toggle button */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
}

/* Danger button */
.btn-danger {
    background: #dc3545;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.btn-danger:hover {
    background: #c82333;
}
