/* Admin CSS */
:root {
    --primary: #2c5282;
    --primary-dark: #1a365d;
    --primary-light: #4299e1;
    --success: #48bb78;
    --warning: #ed8936;
    --danger: #e53e3e;
    --gray-50: #f7fafc;
    --gray-100: #edf2f7;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e0;
    --gray-400: #a0aec0;
    --gray-500: #718096;
    --gray-600: #4a5568;
    --gray-700: #2d3748;
    --gray-800: #1a202c;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-100);
    color: var(--gray-700);
    line-height: 1.5;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    color: var(--primary-dark);
    font-size: 28px;
    margin-bottom: 4px;
}

.login-header p {
    color: var(--gray-500);
    font-size: 14px;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 16px;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

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

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

.btn-block {
    width: 100%;
}

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

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.alert-error {
    background: #fed7d7;
    color: #c53030;
}

.alert-success {
    background: #c6f6d5;
    color: #276749;
}

/* Admin Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: var(--gray-800);
    color: white;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--gray-700);
}

.sidebar-header h1 {
    font-size: 20px;
    margin-bottom: 4px;
}

.sidebar-header .center-name {
    font-size: 12px;
    color: var(--gray-400);
}

.nav-menu {
    list-style: none;
    padding: 16px 0;
    flex: 1;
}

.nav-menu li a {
    display: block;
    padding: 12px 20px;
    color: var(--gray-300);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.nav-menu li a:hover,
.nav-menu li a.active {
    background: var(--gray-700);
    color: white;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-700);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.sidebar-footer .logout {
    color: var(--gray-400);
    text-decoration: none;
}

.sidebar-footer .logout:hover {
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

/* Dashboard */
.dashboard h1 {
    font-size: 28px;
    margin-bottom: 4px;
}

.date-display {
    color: var(--gray-500);
    margin-bottom: 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 14px;
    color: var(--gray-500);
    margin-top: 4px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

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

.card-header h2 {
    font-size: 16px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

.card-body.scrollable {
    max-height: 400px;
    overflow-y: auto;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

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

.table th {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--gray-500);
}

.table tbody tr:hover {
    background: var(--gray-50);
}

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

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h1 {
    margin: 0;
    font-size: 28px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 4px;
}

.badge-success {
    background: #c6f6d5;
    color: #276749;
}

.badge-gray {
    background: var(--gray-200);
    color: var(--gray-600);
}

.badge-warning {
    background: #feebc8;
    color: #c05621;
}

/* Inactive rows */
tr.inactive {
    opacity: 0.5;
}

/* Form rows */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input {
    width: auto;
}

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

.modal {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-500);
}

.modal-close:hover {
    color: var(--gray-700);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--gray-200);
}

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

.btn-danger:hover {
    background: #c53030;
}

/* Week Navigation */
.week-nav {
    display: flex;
    gap: 8px;
}

.week-range {
    color: var(--gray-500);
    font-size: 14px;
}

.shift-info {
    color: var(--gray-600);
    font-weight: 500;
    margin-bottom: 16px;
}

/* Shifts Grid */
.shifts-grid-container {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.shifts-grid {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.shifts-grid th,
.shifts-grid td {
    border: 1px solid var(--gray-200);
    padding: 8px;
    vertical-align: top;
}

.shifts-grid th {
    background: var(--gray-50);
    font-weight: 600;
    text-align: center;
}

.shifts-grid .instructor-col {
    width: 150px;
    min-width: 150px;
}

.shifts-grid .day-col {
    width: calc((100% - 150px) / 7);
    min-width: 100px;
    min-height: 80px;
    position: relative;
}

.shifts-grid .day-col.today {
    background: #fffbeb;
}

.shifts-grid th.today {
    background: #fef3c7;
}

.day-name {
    display: block;
    font-size: 12px;
    color: var(--gray-500);
}

.day-num {
    display: block;
    font-size: 16px;
}

.instructor-name {
    font-weight: 500;
}

/* Shift blocks */
.shift-block {
    padding: 6px 8px;
    margin-bottom: 4px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.shift-block.published {
    background: #d4edda;
    border-left: 3px solid var(--success);
}

.shift-block.draft {
    background: repeating-linear-gradient(
        45deg,
        var(--gray-100),
        var(--gray-100) 5px,
        var(--gray-200) 5px,
        var(--gray-200) 10px
    );
    border-left: 3px solid var(--gray-400);
}

.shift-block:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.shift-time {
    font-weight: 500;
}

/* Add shift button */
.add-shift-btn {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px dashed var(--gray-300);
    background: white;
    color: var(--gray-400);
    font-size: 16px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
}

.day-col:hover .add-shift-btn {
    opacity: 1;
}

.add-shift-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--gray-50);
}

/* Date picker */
.date-picker {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
}

/* Small stats grid */
.stats-grid-small {
    grid-template-columns: repeat(4, 1fr);
    margin-bottom: 24px;
}

.stats-grid-small .stat-card {
    padding: 16px;
}

.stats-grid-small .stat-number {
    font-size: 24px;
}

/* Text utilities */
.text-muted {
    color: var(--gray-500);
}

/* Responsive */
@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}
