* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f3f4f6;
    color: #1f2937;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 200;

    & h1 {
        margin: 0;
        font-size: 28px;
        color: #111827;
    }
}

nav {
    display: flex;
    gap: 6px;
    margin-top: 0;
    align-items: center;
    justify-content: space-between;
    position: relative;

    & .menu-container {
        display: flex;
        /* gap: 6px; */
        align-items: center;
        position: absolute;
        right: 0;
        height: 50px;

        & a {
            padding: 8px;

            &:not(:last-child) {
                border-bottom: 3px solid transparent;
                padding: 10px;
                text-transform: uppercase;
                font-weight: 500;
                transition: 0.2s;
            }

            &.active,
            &:hover {
                text-decoration: none;
                border-color: var(--primary-color);
            }
        }
    }

    & .menu-button {
        display: none;
        border-radius: 8px;
    }
}

.filter-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 48px;
    margin-bottom: 16px;
    gap: 10px;
    height: 100%;
    transition: all 0.3s;

    & * {
        padding-top: 8px;
        padding-bottom: 8px;
        font-size: 12px;
    }

}

ul {
    list-style-position: inside;
}

button {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.btn-secondary {
    background-color: #e5e7eb;
    color: #1f2937;
}

.btn-secondary:hover {
    background-color: #d1d5db;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-success {
    background-color: #10b981;
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

button:disabled {
    /* background-color: #f3f4f6;
    color: #9ca3af; */
    opacity: 0.6;
    cursor: not-allowed;
}

.color-primary {
    color: #3b82f6;
}

.color-secondary {
    color: #6b7280;
}

.color-muted {
    color: #d1d5db;
}

.color-success {
    color: #059669;
}

.color-warning {
    color: #d97706;
}

.color-danger {
    color: #dc2626;
}

.flex {
    display: flex;
}

.flex-justify-between {
    justify-content: space-between;
}

.phone-container {
    position: relative;
    gap: 10px;
}

.whatsapp-button {
    padding: 10px 16px;
    font-size: 12px;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background-color: #25D366;
    color: white;
}

.whatsapp-button:hover {
    background-color: #128C7E;
}

.tag {
    font-size: 11px;
    padding: 2px 8px 4px;
    width: min-content;
    border: 1px solid currentcolor;
    border-radius: 16px;
    white-space: nowrap;
}

/* Table Styles */
.table-container {
    width: 100vw;
    overflow-x: auto;
    margin: 0 -20px 0;
    padding: 0 20px;
    max-width: stretch;

    & table {
        min-width: 720px;
    }
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-size: 14px;
}

th {
    background-color: #f9fafb;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background-color: #f9fafb;
}

a {
    color: #3b82f6;
    text-decoration: none;
    cursor: pointer;
}

a:hover {
    text-decoration: underline;
}

/* Form Styles */
form {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    max-width: 700px;
    width: 100%;
    justify-self: center;
}

form h2 {
    margin-bottom: 20px;
    font-size: 20px;
}

.form-group {
    margin-bottom: 16px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #6b7280;
    font-size: 14px;
}

input,
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 16px;

}

.form-row-4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    column-gap: 16px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
}

.modal h2 {
    margin-bottom: 20px;
}

.modal-close {
    float: right;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
}

.modal-close:hover {
    color: #1f2937;
}

/* Alert Styles */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-info {
    background-color: #dbeafe;
    color: #0c2340;
    border: 1px solid #93c5fd;
}

/* Loading & Empty States */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    color: #6b7280;
    background-color: rgba(0, 0, 0, 0.3);
    position: fixed;
    z-index: 1000;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    transition: 0.4s;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #1f2937;
}

/* Details View */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.detail-header h2 {
    font-size: 24px;
}

.detail-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.detail-section.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 16px;
}

.detail-section h3 {
    font-size: 16px;
}

.detail-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
    align-items: center;
    align-content: flex-start;
}

.detail-label {
    font-weight: 500;
    color: #6b7280;
}

.detail-value {
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 12px;
}

.followups-list {
    margin-top: 20px;
}

.followup-item {
    padding: 8px 16px;
    background-color: #f9fafb;
    border-left: 4px solid #3b82f6;
    margin-bottom: 12px;
    border-radius: 4px;
}

.followup-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.followup-date {
    font-weight: 500;
    color: #3b82f6;
    width: 80px;
    font-size: 12px;
    padding-right: 8px;
    border-right: 1px solid #3b82f6;
    margin-right: 8px;
}

.followup-admin {
    width: 80px;
    font-size: 12px;
    color: #6b7280;
}

.followup-note {
    color: #1f2937;
    line-height: 1.5;
    white-space: pre-line;
}

/* Login Page Styles */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    margin-top: -30px;
}

.login-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.login-header h1 {
    font-size: 28px;
    margin-bottom: 8px;
    color: white;
}

.login-header p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

.login-form {
    padding: 30px;
    background: white;
    max-width: none;
    box-shadow: none;
    border-radius: 0;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-form input {
    padding: 12px 14px;
    font-size: 14px;
    border: 2px solid #e5e7eb;
    transition: border-color 0.3s;
}

.login-form input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.login-form input:disabled {
    background-color: #f9fafb;
    color: #d1d5db;
    cursor: not-allowed;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.btn-login:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.login-footer {
    padding: 20px 30px;
    text-align: center;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.forgot-password {
    font-size: 13px;
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s;
}

.forgot-password:hover {
    color: #764ba2;
    text-decoration: underline;
}

.md-grid-column-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    /* nav .menu-container {
        width: 120px;
        position: absolute;
        right:0;
        top: 0;
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }

    nav .menu-button {
        display: block;
    } */

    header {
        & .container {
            padding: 10px 20px
        }

        & h1 {
            font-size: 20px;
        }

        & .menu-container a {
            font-size: 12px;
            padding: 10px 6px;
        }
    }

    .grid-column-1 {
        display: grid;
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .sm-form-row-2 {
        grid-template-columns: 1fr 1fr;
    }

    .detail-section.grid {
        display: grid;
        grid-template-columns: 1fr;
    }

    .detail-row {
        grid-template-columns: 1fr;
    }

    .detail-row:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }

    table {
        font-size: 12px;
    }

    td,
    th {
        padding: 8px;
    }

    button {
        padding: 8px 12px;
        font-size: 12px;
    }

    .filter-container {
        grid-template-columns: auto auto 48px;
    }

    .filter-container input[name="parentName"] {
        grid-column: 2 / 4;
    }
}

.error-message {
    color: #dc2626;
    font-size: 12px;
    margin-top: 4px;
}

.success-message {
    color: #059669;
    font-size: 12px;
    margin-top: 4px;
}

/* Config section for API URL */
.config-banner {
    background-color: #fef3c7;
    color: #92400e;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.config-banner button {
    background-color: #f59e0b;
    color: white;
    padding: 6px 12px;
    font-size: 12px;
}

.config-banner button:hover {
    background-color: #d97706;
}