@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@300;400;500;600;700&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Raleway", sans-serif;
}

body {
    min-height: 100vh;
    background: #0b1120;
    color: #0f172a;
}

.auth-body {
    height: 100vh;
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

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

.auth-card {
    width: 100%;
    display: flex;
    min-height: 100vh;
    height: 100vh;
    background: #f8fafc;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.25);
}

.auth-side {
    width: 40%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: #0f172a;
}

.auth-side-media {
    width: 100%;
    height: 100%;
}

.auth-side-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.auth-form {
    width: 60%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    background: #f8fafc;
}

.auth-form-content {
    width: min(420px, 100%);
}

.auth-form-content h2 {
    font-size: 32px;
    margin-bottom: 24px;
    color: #0f172a;
}

.form {
    display: grid;
    gap: 18px;
}

label.remember {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #475569;
}

label.remember input {
    width: 16px;
    height: 16px;
}

label span {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #1e293b;
}

input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #cbd5f5;
    background: #fff;
    font-size: 15px;
    color: #0f172a;
    outline: none;
}

input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

input:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

.password-field {
    position: relative;
    display: flex;
    align-items: center;
}

.password-field input {
    padding-right: 90px;
}

.toggle-btn {
    position: absolute;
    right: 12px;
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    color: #4f46e5;
    cursor: pointer;
}

.primary-button {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: none;
    background: #4f46e5;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(79, 70, 229, 0.3);
}

.primary-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.secondary-button {
    width: auto;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #cbd5f5;
    background: #ffffff;
    color: #334155;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.secondary-button:hover {
    background: #f1f5f9;
}

.secondary-button.small {
    padding: 8px 12px;
    font-size: 13px;
}

.danger-button {
    width: auto;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid #fecaca;
    background: #fee2e2;
    color: #991b1b;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.danger-button:hover {
    background: #fecaca;
}


.alert {
    background: #fee2e2;
    color: #991b1b;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 14px;
}

.switch {
    margin-top: 18px;
    font-size: 14px;
    color: #475569;
}

.switch a {
    color: #4f46e5;
    font-weight: 600;
}

.dashboard {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #0f172a;
}

.dashboard-card {
    background: #fff;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    width: min(420px, 90%);
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
}

.dashboard-card h1 {
    margin-bottom: 12px;
    color: #0f172a;
}

.dashboard-card p {
    margin-bottom: 24px;
    color: #475569;
}

.user-body {
    min-height: 100vh;
    background: #f8fafc;
    color: #0f172a;
}

.user-shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 28px 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.user-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: #ffffff;
    padding: 20px 22px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
}

.user-topbar h1 {
    font-size: 22px;
    margin-bottom: 4px;
}

.user-topbar p {
    color: #64748b;
    font-size: 13px;
}

.user-section {
    background: #ffffff;
    border-radius: 14px;
    padding: 20px;
    border: 1px solid #e2e8f0;
}

.user-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    color: #0f172a;
}

.user-section-header p {
    color: #64748b;
    font-size: 12px;
    margin-top: 4px;
}

.user-form {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr 1fr auto;
    align-items: end;
}

.admin-row.admin-row-sites {
    grid-template-columns: 1.2fr 1.2fr 1fr auto;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 40;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    width: min(980px, 100%);
    max-height: 90vh;
    overflow: auto;
}

.modal-header {
    padding: 18px 22px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-close {
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
}

.modal-form {
    padding: 20px 22px 24px;
}

.modal-grid {
    display: grid;
    gap: 14px;
}

.modal-group {
    border: 1px dashed #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    display: grid;
    gap: 10px;
}

.modal-group h4 {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}

.modal-row {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr 1.4fr 0.6fr;
}

.modal-row.full {
    grid-template-columns: repeat(3, 1fr);
}

.modal-row input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #cbd5f5;
}

.modal-row.full input {
    width: 100%;
}

.modal-form textarea {
    width: 100%;
    border-radius: 10px;
    border: 1px solid #cbd5f5;
    padding: 10px 12px;
    font-family: inherit;
}

.modal-actions {
    margin-top: 18px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-open {
    overflow: hidden;
}

.cnpj-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cnpj-status {
    font-size: 12px;
    color: #64748b;
}

.cnpj-status[data-type="loading"] {
    color: #1d4ed8;
}

.cnpj-status[data-type="success"] {
    color: #166534;
}

.cnpj-status[data-type="error"] {
    color: #991b1b;
}

.admin-body {
    min-height: 100vh;
    background: #f8fafc;
    color: #0f172a;
}

.admin-shell {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: #ffffff;
    padding: 28px 22px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    border-right: 1px solid #e2e8f0;
}

.admin-brand {
    display: grid;
    gap: 4px;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    justify-items: center;
    text-align: center;
}

.admin-brand img {
    height: 130px;
    width: auto;
    display: block;
}

.admin-brand small {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
}

.admin-nav {
    display: grid;
    gap: 10px;
}

.admin-link {
    padding: 10px 12px;
    border-radius: 10px;
    color: #334155;
    font-weight: 600;
    background: transparent;
    display: grid;
    gap: 2px;
    transition: background 0.2s ease, color 0.2s ease;
}

.admin-link small {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
}

.admin-link:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.admin-link.active {
    background: #e2e8f0;
    color: #0f172a;
}

.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.admin-topbar {
    padding: 20px 28px;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.admin-topbar-title h1 {
    font-size: 24px;
    color: #0f172a;
    margin-bottom: 4px;
}

.admin-topbar-title p {
    color: #64748b;
    font-size: 13px;
}

.admin-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 0;
}

.admin-actions .primary-button {
    width: auto;
    padding: 10px 18px;
    border-radius: 10px;
}

.admin-user {
    display: grid;
    gap: 2px;
    font-size: 13px;
    color: #0f172a;
}

.admin-user small {
    color: #64748b;
    font-size: 12px;
}

.admin-section {
    margin: 24px 28px;
    background: #ffffff;
    border-radius: 14px;
    padding: 20px;
    border: 1px solid #e2e8f0;
}

.admin-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    color: #0f172a;
}

.admin-section-header h2 {
    font-size: 18px;
}

.admin-section-header p {
    color: #64748b;
    font-size: 12px;
    margin-top: 4px;
}

.admin-section-header span {
    color: #64748b;
    font-size: 13px;
}

.admin-hint {
    font-size: 12px;
    color: #64748b;
    margin-top: -6px;
    margin-bottom: 10px;
}

.admin-alert {
    margin: 12px 0 16px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 13px;
}

.admin-alert.success {
    background: #dcfce7;
    color: #166534;
}

.admin-form {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr auto;
    align-items: end;
    margin-bottom: 16px;
}

.admin-form-actions {
    display: flex;
    gap: 10px;
    grid-column: 1 / -1;
}

.admin-inline-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.admin-inline-form {
    display: flex;
    justify-content: flex-end;
}

.admin-field span {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #1e293b;
}

.admin-field input {
    width: 100%;
}

.admin-field select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #cbd5f5;
    background: #fff;
    font-size: 15px;
    color: #0f172a;
    outline: none;
}

.admin-field.full {
    grid-column: 1 / -1;
}

.admin-static div {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #cbd5f5;
    background: #f8fafc;
    color: #64748b;
    font-size: 14px;
}

.admin-table {
    display: grid;
    gap: 8px;
}

.admin-row {
    display: grid;
    grid-template-columns: 80px 1.2fr 1.6fr 0.8fr 1fr;
    gap: 12px;
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #0f172a;
    font-size: 13px;
}

.admin-row span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-row.admin-row-domains {
    grid-template-columns: 1.2fr 1.2fr 1.4fr 1fr auto;
}

.admin-row-head {
    background: #f1f5f9;
    color: #64748b;
    font-weight: 600;
    border: 1px solid #e2e8f0;
}

.admin-empty {
    padding: 16px;
    text-align: center;
    color: #64748b;
    background: #f8fafc;
    border: 1px dashed #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
}

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

    .admin-sidebar {
        width: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .admin-nav {
        display: flex;
        gap: 10px;
    }
}

@media (max-width: 900px) {
    .admin-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-section {
        margin: 24px 20px;
    }

    .admin-form {
        grid-template-columns: 1fr;
    }

    .user-form {
        grid-template-columns: 1fr;
    }

    .admin-row {
        grid-template-columns: 1fr;
    }

    .admin-row-head {
        display: none;
    }
}

@media (max-width: 900px) {
    .auth-card {
        flex-direction: column;
    }

    .auth-side,
    .auth-form {
        width: 100%;
        padding: 40px 28px;
    }

    .auth-side {
        min-height: 280px;
    }
}
