* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f9fafb;
    color: #374151;
    line-height: 1.6;
}

.container {
    min-height: 100vh;
    padding: 24px;
}

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    padding: 24px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.header h1 {
    font-size: 1.875rem;
    font-weight: bold;
    color: #1f2937;
}

.button-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:disabled {
    background-color: #9ca3af !important;
    cursor: not-allowed;
}

.btn-blue {
    background-color: #2563eb;
    color: white;
}

.btn-blue:hover:not(:disabled) {
    background-color: #1d4ed8;
}

.btn-green {
    background-color: #16a34a;
    color: white;
    font-weight: 600;
}

.btn-green:hover:not(:disabled) {
    background-color: #15803d;
}

.btn-gray {
    background-color: #6b7280;
    color: white;
}

.btn-gray:hover {
    background-color: #4b5563;
}

.btn-red {
    background-color: #dc2626;
    color: white;
}

.btn-red:hover {
    background-color: #b91c1c;
}

.btn-small {
    padding: 4px;
}

.status-message {
    margin-bottom: 16px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid;
}

.status-success {
    background-color: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.status-error {
    background-color: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.status-info {
    background-color: #dbeafe;
    color: #1e40af;
    border-color: #bfdbfe;
}

.form-container {
    background-color: #f9fafb;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid #e5e7eb;
}

.form-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1f2937;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

@media (min-width: 768px) {
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .form-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 4px;
}

.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.2s;
    min-height: 42px; /* improve tap target on mobile */
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input.error {
    border-color: #ef4444;
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 4px;
}

.form-actions {
    display: flex;
    gap: 8px;
    padding-top: 16px;
}

.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #d1d5db;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    border: 1px solid #d1d5db;
    padding: 12px 16px;
    text-align: left;
}

th {
    background-color: #f3f4f6;
    font-weight: 600;
    color: #374151;
}

tr:hover {
    background-color: #f9fafb;
}

.actions-cell {
    text-align: center;
}

.actions-buttons {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.footer-info {
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-text {
    font-size: 0.875rem;
    color: #6b7280;
}

.footer-hint {
    font-size: 0.75rem;
    color: #9ca3af;
}

.hidden {
    display: none !important;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* --------- Mobile enhancements --------- */
@media (max-width: 640px) {
    .container { padding: 12px; }
    .main-content { padding: 16px; }

    .header { gap: 8px; margin-bottom: 16px; }
    .header h1 { font-size: 1.25rem; }

    .button-group { width: 100%; }
    .button-group .btn { flex: 1 1 auto; justify-content: center; padding: 10px 12px; }

    .form-grid { grid-template-columns: 1fr !important; gap: 12px; }
    .form-title { font-size: 1.125rem; margin-bottom: 12px; }
    .form-input { font-size: 16px; } /* prevent iOS zoom on focus */

    .form-actions { flex-direction: column; }
    .form-actions .btn { width: 100%; }

    .table-container { border-radius: 6px; }
    table { font-size: 0.95rem; }
    th, td { padding: 10px 12px; }
    td.actions-cell { padding: 8px; }
    .actions-buttons { gap: 6px; }
}

/* Very small screens */
@media (max-width: 380px) {
    .header h1 { font-size: 1.1rem; }
    .btn { padding: 8px 12px; }
}


