/* Zoltan Platform — base styles */

/* === Reset & base === */

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

html {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #1a1a1a;
    background: #f5f5f5;
}

body {
    min-height: 100vh;
}

a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* === Layout === */

.page {
    max-width: 960px;
    margin: 0 auto;
    padding: 1rem;
}

.page-narrow {
    max-width: 400px;
    margin: 0 auto;
    padding: 1rem;
}

/* === Typography === */

h1 { font-size: 1.5rem; font-weight: 600; margin-bottom: 1rem; }
h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.75rem; }
h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; }

/* === Forms === */

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

textarea { resize: vertical; min-height: 4rem; }

/* === Buttons === */

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    line-height: 1.4;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
}
.btn-primary:hover:not(:disabled) { background: #1d4ed8; }

.btn-secondary {
    background: #e5e7eb;
    color: #1a1a1a;
}
.btn-secondary:hover:not(:disabled) { background: #d1d5db; }

.btn-danger {
    background: #dc2626;
    color: #fff;
}
.btn-danger:hover:not(:disabled) { background: #b91c1c; }

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* === Cards === */

.card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

/* === Task cards === */

.task-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
}

.task-card.blocked {
    border-left: 4px solid #f59e0b;
}

.task-card.cancelled {
    opacity: 0.6;
}

.task-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.task-meta {
    font-size: 0.85rem;
    color: #6b7280;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* === Badges === */

.badge {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-state {
    background: #e5e7eb;
    color: #374151;
}

.badge-priority-high {
    background: #fee2e2;
    color: #991b1b;
}

.badge-priority-medium {
    background: #fef3c7;
    color: #92400e;
}

.badge-priority-low {
    background: #dbeafe;
    color: #1e40af;
}

.badge-unread {
    background: #dc2626;
    color: #fff;
    min-width: 1.25rem;
    text-align: center;
}

/* === Tables === */

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

th {
    font-weight: 600;
    font-size: 0.85rem;
    color: #6b7280;
    background: #f9fafb;
}

/* === Utility === */

.hidden { display: none !important; }

.error-text {
    color: #dc2626;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.muted { color: #6b7280; font-size: 0.9rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

.text-center { text-align: center; }

/* === Login page === */

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

.login-box {
    width: 100%;
    max-width: 360px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 1.5rem;
}

/* === Top bar === */

.topbar {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* === Filter tabs === */

.filter-tabs {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: #e5e7eb;
    color: #374151;
}

.filter-btn.active {
    background: #2563eb;
    color: #fff;
}

/* === Blocked banner === */

.blocked-banner {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    color: #92400e;
}

/* === Messages === */

.message {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.message-mine {
    background: #f0f7ff;
    border-radius: 4px;
    padding: 0.5rem;
}

.message-meta {
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

/* === Responsive === */

@media (max-width: 640px) {
    .page { padding: 0.75rem; }

    .task-meta {
        flex-direction: column;
        gap: 0.25rem;
    }

    table { font-size: 0.9rem; }
    th, td { padding: 0.4rem 0.5rem; }
}
