:root {
    --bg: #f5f7fa;
    --card-bg: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --accent: #2563eb;
    --accent-light: #dbeafe;
    --border: #d1d5db;
    --radius: 0.5rem;
    --vacation: #86efac;
    --vacation-text: #14532d;
    --holiday: #fca5a5;
    --holiday-text: #7f1d1d;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100vh;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
}

.hidden {
    display: none !important;
}

.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.login-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.login-card h1 {
    margin: 0 0 0.75rem;
    font-size: 1.5rem;
}

.login-card p {
    color: var(--muted);
    margin: 0 0 1.5rem;
    line-height: 1.5;
}

.google-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #fff;
    color: #444;
    border: 1px solid #dadce0;
    border-radius: 0.4rem;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.google-button:hover {
    background: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.admin-header h1 {
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
}

.subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.secondary-button,
.logout-button {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    text-decoration: none;
    cursor: pointer;
}

.secondary-button {
    background: var(--card-bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.secondary-button:hover {
    background: var(--bg);
}

.logout-button {
    background: var(--accent-light);
    color: var(--accent);
    border: 1px solid var(--accent-light);
}

.logout-button:hover {
    background: var(--accent);
    color: #fff;
}

.admin-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }
}

.admin-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 0.25rem;
}

.sidebar-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
}

.sidebar-section h2 {
    margin: 0 0 0.6rem;
    font-size: 0.95rem;
}

.users-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.user-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.25rem;
    border-radius: 0.3rem;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.15s ease;
}

.user-item:hover {
    background: var(--bg);
}

.user-item input {
    cursor: pointer;
    flex-shrink: 0;
}

.user-color-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.user-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.requests-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.requests-list.compact .user-card {
    font-size: 0.8rem;
}

.requests-list.compact .user-card-header {
    padding: 0.45rem 0.6rem;
    font-size: 0.8rem;
}

.requests-list.compact .request-item {
    padding: 0.45rem 0.6rem;
    font-size: 0.75rem;
}

.empty {
    color: var(--muted);
    font-size: 0.85rem;
    margin: 0;
}

.user-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.user-card-header {
    background: var(--bg);
    padding: 0.6rem 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.request-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.request-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
}

.request-item:first-child {
    border-top: none;
}

.request-actions {
    display: flex;
    gap: 0.35rem;
}

.btn {
    border: none;
    border-radius: 9999px;
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.btn:hover {
    opacity: 0.85;
}

.btn-approve {
    background: var(--vacation);
    color: var(--vacation-text);
}

.btn-reject {
    background: var(--holiday);
    color: var(--holiday-text);
}

.admin-calendar-area {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    min-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.calendar-header h2 {
    margin: 0;
    font-size: 1.4rem;
    min-width: 220px;
    text-align: center;
}

.nav-button {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease;
}

.nav-button:hover {
    background: var(--bg);
}

.admin-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: auto repeat(6, 1fr);
    gap: 0.5rem;
    flex: 1;
    min-height: 0;
}

.admin-day-name {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    padding: 0.5rem 0;
}

.admin-day {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--card-bg);
    min-height: 100px;
    overflow: hidden;
    position: relative;
    transition: box-shadow 0.15s ease;
}

.admin-day:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.admin-day.empty {
    background: transparent;
    border-color: transparent;
}

.admin-day.weekend {
    background: #f3f4f6;
}

.admin-day.next-year {
    border-color: var(--accent);
    background: var(--accent-light);
}

.admin-day.next-year .day-number {
    color: var(--accent);
}

.day-number {
    position: absolute;
    top: 0.4rem;
    left: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    z-index: 2;
}

.day-users {
    display: flex;
    flex-direction: column;
    flex: 1;
    margin-top: 1.6rem;
    gap: 2px;
}

.day-user-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.2rem 0.4rem;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-radius: 0.2rem;
    position: relative;
}

.day-user-segment.pending::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.25),
        rgba(255, 255, 255, 0.25) 6px,
        transparent 6px,
        transparent 12px
    );
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
    justify-content: center;
    font-size: 0.85rem;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.legend-dot {
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

@media (max-width: 1200px) {
    .admin-day {
        min-height: 80px;
    }

    .day-user-segment {
        font-size: 0.65rem;
    }
}
