:root {
    --background: #0d0f0e;
    --surface: #181b1a;
    --surface-hover: #222726;
    --primary: #1e88e5;
    --primary-bright: #427585;
    --text: #f0f2f1;
    --muted: #707876;
    --border: #2a302e;
    --conflict: #e57343;
    --shadow: 0 8px 20px rgba(0,0,0,0.35);
    --radius: 10px;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    background-color: var(--background);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.site-header {
    background-color: rgba(13,15,14,0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1440px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: -0.02em;
}
.logo-mark {
    color: var(--primary-bright);
}
.logo-text {
    color: var(--text);
}
.logo-accent {
    color: var(--primary-bright);
}
.header-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}
.header-semester {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 500;
}
.header-actions {
    display: flex;
    gap: 8px;
}
.main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
}
.sidebar {
    width: 320px;
    min-width: 280px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.sidebar-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    font-weight: 600;
}
.period-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.subject-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.subject-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font: inherit;
    position: relative;
    outline: none;
}
.subject-card:hover,
.subject-card:focus-visible {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}
.subject-card[aria-pressed="true"] {
    box-shadow: none;
}
.subject-name {
    flex: 1;
    font-weight: 500;
    font-size: 0.95rem;
}
.subject-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--muted);
    transition: background 0.2s;
}
.subject-card.selected .subject-indicator {
    background: var(--text);
}
.feedback-message {
    background: rgba(66, 165, 245, 0.15);
    border: 1px solid var(--primary-bright);
    color: var(--primary-bright);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
}
.selected-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.selected-chip {
    background: var(--surface-hover);
    border: 1px solid var(--primary);
    color: var(--text);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}
.sidebar-empty {
    color: var(--muted);
    font-size: 0.85rem;
    font-style: italic;
    padding: 8px 0;
}
.conflict-card {
    display: flex;
    gap: 10px;
    background: rgba(229, 115, 67, 0.1);
    border: 1px solid rgba(229, 115, 67, 0.3);
    border-radius: var(--radius);
    padding: 10px 14px;
    align-items: flex-start;
}
.conflict-icon {
    color: var(--conflict);
    flex-shrink: 0;
    margin-top: 2px;
}
.conflict-info strong {
    display: block;
    font-size: 0.85rem;
    color: var(--text);
}
.conflict-info span {
    font-size: 0.8rem;
    color: var(--muted);
}
    .agenda-section {
        padding: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .agenda-header,
    .agenda-grid {
        min-width: 480px;
        grid-template-columns: 50px repeat(6, minmax(72px, 1fr));
    }
    .agenda-grid {
        grid-template-rows: repeat(16, 48px);
    }
    .agenda-header {
    display: grid;
    grid-template-columns: 80px repeat(6, 1fr);
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
    overflow: hidden;
}
.agenda-corner {
    background: var(--surface);
    border-right: 1px solid var(--border);
}
.agenda-day {
    padding: 14px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    color: var(--muted);
    border-right: 1px solid var(--border);
    background: var(--surface);
}
.agenda-day:last-child {
    border-right: none;
}
.agenda-grid {
    display: grid;
    grid-template-columns: 80px repeat(6, 1fr);
    grid-template-rows: repeat(16, 60px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    overflow-y: auto;
    position: relative;
    min-width: 900px;
}
.time-label {
    font-size: 0.75rem;
    color: var(--muted);
    text-align: right;
    padding: 8px 10px 0 0;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    grid-column: 1;
    user-select: none;
}
.time-label-end {
    border-bottom: none;
}
.class-card {
    position: relative;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary-bright);
    border-radius: 8px;
    padding: 8px 10px;
    margin: 3px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 2;
    color: var(--text);
    text-align: left;
    font: inherit;
}
.class-card:hover,
.class-card:focus {
    border-color: var(--primary-bright);
    background: #1f2a28;
    transform: translateY(-1px);
    z-index: 5;
    outline: none;
}
.class-card-green {
    border-left-color: var(--primary-bright);
}
.class-card-time {
    font-size: 0.7rem;
    color: var(--muted);
    font-weight: 500;
}
.class-card-name {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.2;
}
.class-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--muted);
    gap: 4px;
}
.class-card-prof,
.class-card-room {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.class-card-accent {
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-bright);
    opacity: 0.6;
}
.conflict-wrapper {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 3px;
    z-index: 3;
}
.class-card-conflict {
    border-left-color: var(--conflict);
    background: rgba(229, 115, 67, 0.1);
    border-color: rgba(229, 115, 67, 0.3);
}
.class-card-conflict .class-card-accent {
    background: var(--conflict);
}
.conflict-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--conflict);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    letter-spacing: 0.04em;
}
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--background);
    padding: 16px 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 0.8rem;
}
.footer-dot {
    color: var(--primary-bright);
}
.home-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 64px - 60px);
    padding: 24px;
}
.search-hero {
    width: 100%;
    max-width: 640px;
    text-align: center;
}
.search-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text);
}
.search-input {
    width: 100%;
    padding: 14px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input:focus {
    border-color: var(--primary-bright);
    box-shadow: 0 0 0 3px rgba(66, 165, 245, 0.15);
}
.search-results {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
}
.course-workspace {
    width: 100%;
    max-width: 1400px;
    margin: 24px auto;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.workspace-header {
    display: flex;
    justify-content: center;
}
.workspace-body {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.curriculum-sidebar {
    width: 300px;
    flex-shrink: 0;
}
.agenda-container {
    flex: 1;
}
.details-panel {
    width: 300px;
    flex-shrink: 0;
}
.right-sidebar {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.curriculum-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.curriculum-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}
.period-group .subject-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.subject-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.class-list-inline {
    margin-left: 12px;
    border-left: 2px solid var(--border);
    padding-left: 8px;
}
.class-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.class-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.class-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.class-item-schedule {
    font-size: 0.8rem;
    color: var(--muted);
}
.class-item-vagas {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 2px;
}
.class-conflict-message {
    background: rgba(229, 115, 67, 0.12);
    border: 1px solid rgba(229, 115, 67, 0.35);
    color: var(--conflict);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 8px;
}
.details-desc {
    color: var(--muted);
    font-size: 0.9rem;
}
.details-list {
    list-style: none;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.period-selector-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.period-select-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    font-weight: 600;
}
.period-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: var(--surface);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23707876' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 180px;
    padding: 10px 40px 10px 18px;
    text-align: left;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.period-select:hover {
    border-color: var(--primary-bright);
    background-color: var(--surface-hover);
}
.period-select:focus {
    border-color: var(--primary-bright);
    box-shadow: 0 0 0 3px rgba(66, 165, 245, 0.15);
}
.period-select option {
    background: var(--surface);
    color: var(--text);
}
/* Botões estilo pill, mesma paleta do cabeçalho (branco sobre azul) */
.subject-card,
.icon-btn,
.period-heading,
.class-select-btn,
.details-btn,
.class-details-btn {
    background: var(--primary-bright);
    color: var(--text);
    border: none;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 16px;
}
.subject-card:hover,
.icon-btn:hover,
.period-heading:hover,
.class-select-btn:hover,
.details-btn:hover,
.class-details-btn:hover {
    background: #365f6b;
    color: var(--text);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}
.subject-card.selected,
.class-select-btn[aria-pressed="true"] {
    background: #365f6b;
    color: var(--text);
    box-shadow: none;
}
.subject-code {
    background: rgba(0,0,0,0.2);
    color: var(--text);
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 55px;
    padding: 2px 6px;
    border-radius: 4px;
    text-align: center;
}
.subject-name,
.class-item-header strong,
.class-item-prof {
    color: var(--text);
}
.clear-all-btn {
    margin-top: 10px;
    background: var(--primary-bright);
    border: none;
    color: var(--text);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.clear-all-btn:hover {
    background: #365f6b;
}
@media (max-width: 1024px) {
    .main-layout {
        flex-direction: column;
        overflow-y: auto;
    }
    .sidebar {
        width: 100%;
        min-width: unset;
        border-right: none;
        border-bottom: 1px solid var(--border);
        max-height: 320px;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 16px;
        gap: 16px;
    }
    .sidebar-section {
        min-width: 200px;
        flex: 1;
    }
    .agenda-section {
        padding: 16px;
    }
    .agenda-grid {
        min-width: 700px;
    }
    .workspace-body {
        flex-direction: column;
    }
    .curriculum-sidebar,
    .details-panel,
    .right-sidebar {
        width: 100%;
    }
}
@media (max-width: 600px) {
    .site-header {
        padding: 0 12px;
        height: 56px;
    }
    .header-semester {
        display: none;
    }
    .logo-text {
        font-size: 1.2rem;
    }
    .main-layout {
        flex-direction: column;
    }
    .sidebar {
        max-height: 280px;
        padding: 12px;
    }
    .agenda-section {
        padding: 8px;
    }
    .agenda-grid {
        min-width: 500px;
        grid-template-columns: 60px repeat(6, minmax(80px, 1fr));
        grid-template-rows: repeat(16, 48px);
    }
    .agenda-header {
        grid-template-columns: 60px repeat(6, minmax(80px, 1fr));
    }
    .time-label {
        font-size: 0.65rem;
        padding-top: 4px;
    }
    .class-card {
        padding: 4px 6px;
        margin: 1px;
    }
    .class-card-name {
        font-size: 0.75rem;
    }
    .class-card-meta {
        flex-direction: column;
        gap: 0;
    }
}
