@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap");

:root {
    color-scheme: light;
    --bg: #f6f2ea;
    --surface: #ffffff;
    --surface-muted: #fbfaf8;
    --text: #1d1b16;
    --muted: #6b665f;
    --border: #e5ddd2;
    --brand: #d3642c;
    --brand-strong: #b64912;
    --accent: #1f6f8b;
    --success: #14804a;
    --danger: #c0392b;
    --shadow: 0 18px 40px rgba(22, 18, 12, 0.12);
    --shadow-soft: 0 6px 20px rgba(22, 18, 12, 0.08);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Manrope", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 15% 20%, #fff1dc 0, rgba(255, 241, 220, 0) 45%),
        radial-gradient(circle at 85% 10%, #e3f2f7 0, rgba(227, 242, 247, 0) 40%),
        linear-gradient(180deg, #f6f2ea 0%, #efe7db 100%);
    color: var(--text);
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
}

h1,
h2,
h3,
h4 {
    font-family: "Space Grotesk", "Manrope", sans-serif;
    letter-spacing: -0.01em;
}

.tw-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    box-sizing: border-box;
}

.tw-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 24px;
    padding: 14px 16px;
    background: var(--surface);
    border-radius: 14px;
    box-shadow: var(--shadow-soft);
}

.tw-nav a {
    text-decoration: none;
    color: var(--text);
    padding: 8px 14px;
    background: var(--surface-muted);
    border-radius: 999px;
    border: 1px solid var(--border);
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.tw-nav a:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(28, 22, 14, 0.12);
    border-color: rgba(211, 100, 44, 0.35);
}

.tw-nav .tw-spacer {
    flex: 1 1 auto;
}

.tw-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    margin: 10px;
    display: inline-block;
    width: 320px;
    vertical-align: top;
    box-shadow: var(--shadow-soft);
    background: var(--surface);
    animation: tw-rise 0.5s ease both;
}

.tw-card h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
}

.tw-meta {
    font-size: 13px;
    margin-bottom: 8px;
    color: var(--muted);
}

.tw-badges {
    margin-bottom: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tw-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    background: #f5efe7;
    color: #5f5245;
}

.tw-actions {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tw-actions button,
.tw-actions a {
    margin: 0;
}

.tw-remarks {
    margin-top: 8px;
}

.tw-remarks textarea {
    width: 100%;
    min-height: 60px;
}

.tw-done {
    color: var(--success);
    font-weight: bold;
}

.tw-btn,
.button,
button {
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand), #f39a4a);
    color: #fff;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1.2;
    font-weight: 600;
    box-shadow: 0 12px 20px rgba(211, 100, 44, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tw-btn:hover,
.button:hover,
button:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(211, 100, 44, 0.35);
}

.tw-btn.secondary {
    background: linear-gradient(135deg, #2a708c, #3f8ca8);
}

.tw-btn.danger {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
}

.tw-alert {
    background: #fff3dc;
    border: 1px solid #f1d3a1;
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 12px;
}

.tw-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    min-width: 640px;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.tw-table th,
.tw-table td {
    border: 1px solid var(--border);
    padding: 10px;
    text-align: left;
}

.tw-table th {
    background: #f7f1e8;
    font-weight: 600;
}

.tw-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tw-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.tw-auth-card {
    background: var(--surface);
    padding: 28px;
    border-radius: 18px;
    width: min(420px, 92vw);
    box-shadow: var(--shadow);
    animation: tw-fade 0.5s ease both;
}

.tw-auth-card form {
    display: grid;
    gap: 10px;
}

.tw-auth-card input,
select,
textarea {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    width: 100%;
    box-sizing: border-box;
    font-size: 16px;
    background: #fffdf9;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tw-auth-card input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(211, 100, 44, 0.5);
    box-shadow: 0 0 0 3px rgba(211, 100, 44, 0.15);
}

.tw-muted {
    color: var(--muted);
    font-size: 13px;
}

@media (max-width: 768px) {
    .tw-container {
        padding: 16px;
    }

    .tw-card {
        width: 100%;
        margin: 10px 0;
    }

    .tw-nav {
        gap: 8px;
        padding: 12px;
    }

    .tw-actions button,
    .tw-actions a {
        flex: 1 1 calc(50% - 6px);
    }
}

@media (max-width: 640px) {
    .tw-nav {
        align-items: stretch;
    }

    .tw-nav a {
        flex: 1 1 calc(50% - 6px);
        text-align: center;
    }

    .tw-nav span {
        width: 100%;
        text-align: center;
    }

    .tw-table {
        min-width: 520px;
    }
}

@media (max-width: 420px) {
    .tw-actions button,
    .tw-actions a {
        flex: 1 1 100%;
    }
}

@keyframes tw-rise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes tw-fade {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
