/* OurTeamGrid - Modern Dark Theme */
:root {
    --bg-dark: #0f0f1a;
    --bg-card: #1a1a2e;
    --bg-input: #252540;
    --accent: #22d3ee;
    --accent-hover: #06b6d4;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --sidebar-width: 240px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    display: flex;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    border-right: 1px solid var(--border);
    z-index: 100;
    transition: transform 0.3s ease;
}

.brand {
    padding: 0 20px 20px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-accent {
    color: var(--text);
}

.nav-section-title {
    padding: 20px 20px 10px;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background: rgba(34, 211, 238, 0.1);
    color: var(--text);
}

.menu-item.active {
    background: rgba(34, 211, 238, 0.15);
    color: var(--accent);
    border-left-color: var(--accent);
}

.menu-item i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding-top: 10px;
}

/* Main Content */
.main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.topbar {
    background: var(--bg-card);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    text-align: right;
}

.user-name {
    display: block;
    font-weight: 600;
}

.user-role {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.content {
    padding: 30px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-dark);
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-clock {
    padding: 8px 16px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 15px;
}

.stat-icon.blue { background: rgba(34, 211, 238, 0.2); color: var(--accent); }
.stat-icon.green { background: rgba(34, 197, 94, 0.2); color: var(--success); }
.stat-icon.yellow { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.stat-icon.red { background: rgba(239, 68, 68, 0.2); color: var(--danger); }

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
}

select.form-control {
    cursor: pointer;
}

/* Grid */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success { background: rgba(34, 197, 94, 0.2); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.badge-danger { background: rgba(239, 68, 68, 0.2); color: var(--danger); }
.badge-info { background: rgba(34, 211, 238, 0.2); color: var(--accent); }

/* Shifts Calendar */
.shifts-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.shifts-nav-buttons {
    display: flex;
    gap: 10px;
}

.shifts-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.shift-day {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 15px;
    min-height: 150px;
    border: 1px solid var(--border);
}

.shift-day.today {
    border-color: var(--accent);
}

.shift-day-header {
    text-align: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.shift-day-name {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.shift-day-num {
    font-size: 1.25rem;
    font-weight: 600;
}

.shift-item {
    background: var(--bg-input);
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.shift-item:hover {
    transform: translateX(3px);
}

.shift-item-name {
    font-weight: 500;
    margin-bottom: 3px;
}

.shift-item-time {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Auth Page */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.auth-box {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 40px;
    border: 1px solid var(--border);
}

.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo i {
    font-size: 2.5rem;
    color: var(--accent);
}

.auth-logo h1 {
    font-size: 1.5rem;
    margin-top: 10px;
}

.auth-error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 30px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Member Card */
.member-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s;
}

.member-card:hover {
    transform: translateY(-2px);
}

.member-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--accent);
}

.member-info {
    flex: 1;
}

.member-name {
    font-weight: 600;
    margin-bottom: 3px;
}

.member-role {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Mobile Responsive */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 150;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    color: var(--text);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
}

@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .main {
        margin-left: 0;
    }
    
    .topbar {
        padding: 15px;
        padding-left: 60px;
    }
    
    .content {
        padding: 15px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .shifts-grid {
        grid-template-columns: 1fr;
    }
    
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
    
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Mobile page header */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .page-header h1 {
        font-size: 1.25rem;
    }
    
    /* Mobile cards */
    .card {
        border-radius: 8px;
    }
    
    .card-header {
        padding: 12px 15px;
    }
    
    /* Mobile tables */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        min-width: 600px;
    }
    
    /* Mobile buttons */
    .btn {
        padding: 10px 16px;
    }
    
    .btn-sm {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    /* Mobile form inputs */
    .form-control {
        padding: 12px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Mobile modal */
    .modal-content {
        margin: 10px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    /* Mobile stat cards */
    .stat-card {
        padding: 15px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    /* Hide less important columns on mobile */
    .hide-mobile {
        display: none !important;
    }
    
    /* Mobile clock buttons */
    .clock-buttons {
        flex-direction: column;
        gap: 5px;
    }
    
    .btn-clock {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    /* Touch-friendly spacing */
    .menu-item {
        padding: 15px 20px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .stats-grid, .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .topbar-right {
        flex-direction: column;
        gap: 8px;
    }
    
    .page-header .btn {
        width: 100%;
    }
}

/* Avatar colors */
.avatar-1 { background: rgba(34, 211, 238, 0.2); color: #22d3ee; }
.avatar-2 { background: rgba(168, 85, 247, 0.2); color: #a855f7; }
.avatar-3 { background: rgba(34, 197, 94, 0.2); color: #22c55e; }
.avatar-4 { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.avatar-5 { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

/* Leave status colors */
.status-pending { color: var(--warning); }
.status-approved { color: var(--success); }
.status-rejected { color: var(--danger); }

/* Print Styles */
@media print {
    /* Hide non-essential elements */
    .sidebar, .topbar, .no-print, .btn, .modal, 
    #memberHoursPanel, .mobile-menu-btn, .card-header button {
        display: none !important;
    }
    
    /* Reset layout */
    body {
        background: white !important;
        color: black !important;
        font-size: 11pt;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
    
    .card {
        background: white !important;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
    
    .card-header {
        background: #f5f5f5 !important;
        color: black !important;
        padding: 10px 15px !important;
        border-bottom: 1px solid #ddd !important;
    }
    
    .card-header h3, .card-title {
        color: black !important;
        font-size: 14pt !important;
    }
    
    /* Shifts grid */
    .shifts-week {
        display: grid !important;
        grid-template-columns: repeat(7, 1fr) !important;
        gap: 3px !important;
    }
    
    .shift-day {
        border: 1px solid #ccc !important;
        background: white !important;
        page-break-inside: avoid;
    }
    
    .shift-day-header {
        background: #f0f0f0 !important;
        color: black !important;
        padding: 5px !important;
        border-bottom: 1px solid #ccc !important;
    }
    
    .shift-day-name, .shift-day-num {
        color: black !important;
        font-size: 10pt !important;
    }
    
    .day-note {
        font-size: 8pt !important;
        padding: 2px 4px !important;
    }
    
    .shift-item {
        background: #f9f9f9 !important;
        border: 1px solid #ddd !important;
        color: black !important;
        font-size: 9pt !important;
        padding: 4px 6px !important;
        margin: 3px !important;
    }
    
    .shift-time, .shift-name {
        color: black !important;
    }
    
    /* Stats at top */
    .shifts-nav-buttons span {
        color: black !important;
    }
    
    /* Add print header */
    .card-header .shifts-nav::before {
        content: "Weekly Rota - ";
        font-weight: bold;
    }
    
    /* Page setup */
    @page {
        size: landscape;
        margin: 1cm;
    }
}
