:root {
    --ink: #1b1c1e;
    --muted: #5b6270;
    --accent: #e76f51;
    --accent-dark: #c95c42;
    --surface: #ffffff;
    --surface-alt: #f5f1ea;
    --border: #e2dfd8;
    --shadow: rgba(27, 28, 30, 0.12);
    --ok: #2a9d8f;
    --warn: #f4a261;
    --bg-start: #fdf6e3;
    --bg-end: #f4ebe1;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
    color: var(--ink);
    background: radial-gradient(circle at top left, var(--bg-start), var(--bg-end));
    min-height: 100vh;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: row;
}

.app-shell header {
    padding: 16px clamp(16px, 4vw, 32px);
    display: none;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    border-bottom: 1px solid var(--border);
}

#app-sidebar {
    width: 240px;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-right: 1px solid var(--border);
    background: var(--surface);
    position: sticky;
    top: 0;
    height: 100vh;
}

#app-sidebar.collapsed {
    width: 76px;
}

#app-sidebar.collapsed .brand span,
#app-sidebar.collapsed nav button {
    display: none;
}

#app-sidebar.collapsed .brand h1 {
    font-size: 1.2rem;
}

.brand {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.brand h1 {
    margin: 0;
    font-family: "Fraunces", "Times New Roman", serif;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.brand span {
    color: var(--muted);
    font-size: 0.9rem;
}

nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

nav button {
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

nav button.active {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
}

main {
    padding: 24px clamp(16px, 4vw, 48px) 48px;
    flex: 1;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 12px 30px var(--shadow);
}

.panel + .panel {
    margin-top: 24px;
}

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

h2 {
    margin: 0 0 12px 0;
}

h3 {
    margin: 0 0 10px 0;
}

label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 6px;
    color: var(--muted);
}

label.inline-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--muted);
}

label.inline-toggle input {
    width: auto;
}

input, select, textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    font: inherit;
    background: #fff;
}

textarea {
    min-height: 90px;
    resize: vertical;
}

button.primary {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
}

button.secondary {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--border);
    padding: 10px 16px;
    border-radius: 12px;
    cursor: pointer;
}

button.link-button {
    margin-top: 12px;
    background: none;
    border: none;
    color: var(--accent-dark);
    cursor: pointer;
    padding: 0;
    text-align: left;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--surface-alt);
    font-size: 0.85rem;
}

.list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-item {
    padding: 14px;
    border-radius: 14px;
    background: var(--surface-alt);
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.list-item strong {
    font-size: 1rem;
}

.notice {
    margin: 16px 0;
    padding: 12px 16px;
    border-radius: 12px;
    background: #fff7e9;
    border: 1px solid #f4d8b2;
    color: #7a4f2a;
}

.filters-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.filters-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.filter-button {
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    cursor: pointer;
}

.filter-button.active {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
}

.project-members {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.project-members span {
    padding: 4px 8px;
    border-radius: 999px;
    background: #efe9df;
    font-size: 0.75rem;
}

.hidden {
    display: none;
}

.login-wrap {
    max-width: 420px;
    margin: 80px auto 0;
}

.tabs {
    display: inline-flex;
    gap: 8px;
    margin-bottom: 16px;
}

.tab-button {
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.9rem;
    cursor: pointer;
}

.tab-button.active {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
}

.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: 80px repeat(7, minmax(140px, 1fr));
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.calendar-scroll {
    overflow-x: auto;
}

.calendar-time {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--muted);
    background: var(--surface-alt);
}

.calendar-time-column {
    border-right: 1px solid var(--border);
    background: var(--surface-alt);
}

.calendar-day-header {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-alt);
    font-weight: 600;
    font-size: 0.85rem;
}

.calendar-day {
    position: relative;
    height: 576px;
    border-left: 1px solid var(--border);
    background-image: repeating-linear-gradient(
        to bottom,
        rgba(91, 98, 112, 0.15) 0,
        rgba(91, 98, 112, 0.15) 1px,
        transparent 1px,
        transparent 48px
    );
}

.calendar-entry {
    position: absolute;
    left: 8px;
    right: 8px;
    border-radius: 10px;
    padding: 6px 8px;
    background: #1f3d4d;
    color: #fff;
    font-size: 0.75rem;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.calendar-entry strong {
    display: block;
    font-weight: 600;
    font-size: 0.78rem;
}

.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(12, 16, 22, 0.5);
    padding: 16px;
    z-index: 10;
}

.modal.hidden {
    display: none;
}

.modal-card {
    width: min(720px, 100%);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

footer {
    padding: 16px clamp(16px, 4vw, 48px) 32px;
    color: var(--muted);
    font-size: 0.85rem;
}

@keyframes liftIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.panel {
    animation: liftIn 0.4s ease;
}

@media (max-width: 720px) {
    .app-shell {
        flex-direction: column;
    }

    #app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        z-index: 20;
    }

    #app-sidebar.open {
        transform: translateX(0);
    }

    .app-shell header {
        display: flex;
    }

    .calendar-grid {
        grid-template-columns: 60px repeat(7, 160px);
    }
}
