/* ============================================================
   stylemaria.css — Painel Maria · Design roxo moderno
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&display=swap');

/* ── Variáveis ─────────────────────────────────────────────── */
:root {
    --purple-950: #0f0520;
    --purple-900: #1a0a35;
    --purple-800: #2d1260;
    --purple-700: #4c1d95;
    --purple-600: #6d28d9;
    --purple-500: #8b5cf6;
    --purple-400: #a78bfa;
    --purple-300: #c4b5fd;
    --purple-200: #ddd6fe;
    --purple-100: #ede9fe;
    --purple-50:  #f5f3ff;

    --accent:     #e040fb;
    --accent-dim: rgba(224, 64, 251, 0.15);

    --surface-0:  #ffffff;
    --surface-1:  #faf9ff;
    --surface-2:  #f3f0ff;

    --text-primary:   #1a0a35;
    --text-secondary: #5b4a7a;
    --text-muted:     #9580b8;

    --border:     rgba(109, 40, 217, 0.15);
    --border-focus: var(--purple-500);

    --radius-sm:  6px;
    --radius-md:  12px;
    --radius-lg:  18px;
    --radius-xl:  24px;

    --shadow-card: 0 4px 24px rgba(109, 40, 217, 0.08), 0 1px 4px rgba(109, 40, 217, 0.06);
    --shadow-btn:  0 4px 16px rgba(109, 40, 217, 0.35);

    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    --font-display: 'Syne', sans-serif;
    --font-body:    'DM Sans', sans-serif;
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    background-color: var(--surface-1);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(109, 40, 217, 0.12) 0%, transparent 70%),
        radial-gradient(ellipse 40% 30% at 90% 80%, rgba(224, 64, 251, 0.07) 0%, transparent 60%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    padding-bottom: 60px;
}

/* ── Header ─────────────────────────────────────────────────── */
.page-header {
    background: linear-gradient(135deg, var(--purple-900) 0%, var(--purple-800) 60%, var(--purple-700) 100%);
    padding: 40px 32px 36px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(224, 64, 251, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 30%, rgba(139, 92, 246, 0.25) 0%, transparent 50%);
    pointer-events: none;
}

.page-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
    position: relative;
}

.page-subtitle {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.95rem;
    color: var(--purple-300);
    margin-top: 6px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    position: relative;
}

/* ── Main layout ────────────────────────────────────────────── */
.page-main {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 20px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ── Alertas ────────────────────────────────────────────────── */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

.alert-success {
    background: rgba(109, 40, 217, 0.08);
    border: 1px solid rgba(109, 40, 217, 0.25);
    color: var(--purple-700);
}

.alert-error {
    background: rgba(220, 38, 38, 0.06);
    border: 1px solid rgba(220, 38, 38, 0.2);
    color: #b91c1c;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Card ───────────────────────────────────────────────────── */
.card {
    background: var(--surface-0);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-card);
    transition: box-shadow var(--transition);
}

.card:hover {
    box-shadow: 0 8px 40px rgba(109, 40, 217, 0.12), 0 2px 8px rgba(109, 40, 217, 0.08);
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--purple-800);
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--purple-100);
    letter-spacing: -0.01em;
}

/* ── Formulário ─────────────────────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 120px;
}

form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.form-control {
    width: 100%;
    padding: 11px 15px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--surface-1);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    appearance: none;
    -webkit-appearance: none;
}

.form-control:hover {
    border-color: var(--purple-300);
}

.form-control:focus {
    border-color: var(--border-focus);
    background: var(--surface-0);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.form-control--short {
    text-align: center;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* Select custom arrow */
select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b5cf6' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}

/* Date input */
input[type="date"].form-control {
    cursor: pointer;
}

/* ── LED Preview ─────────────────────────────────────────────── */
.led-preview-group {
    min-width: 80px;
    max-width: 100px;
    align-items: center;
}

.led-preview {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #111;
    border: 2px solid var(--border);
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
    margin-top: 2px;
}

/* LED dots na tabela */
.led-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--led-color, #ccc);
    box-shadow: 0 0 5px 1px var(--led-color, transparent);
    vertical-align: middle;
    margin-right: 4px;
}

/* ── Botões ──────────────────────────────────────────────────── */
.form-actions {
    display: flex;
    gap: 12px;
    padding-top: 8px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--purple-600) 0%, var(--purple-500) 100%);
    color: #ffffff;
    box-shadow: var(--shadow-btn);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--purple-700) 0%, var(--purple-600) 100%);
    box-shadow: 0 6px 24px rgba(109, 40, 217, 0.5);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-btn);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
}

.btn-ghost:hover {
    background: var(--purple-50);
    border-color: var(--purple-300);
    color: var(--purple-700);
}

/* ── Tabela ──────────────────────────────────────────────────── */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table thead {
    background: linear-gradient(135deg, var(--purple-900) 0%, var(--purple-800) 100%);
}

.data-table thead th {
    padding: 13px 16px;
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--purple-300);
    text-align: left;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    border: none;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

.data-table tbody tr:last-child {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: var(--purple-50);
}

.data-table tbody td {
    padding: 12px 16px;
    color: var(--text-primary);
    vertical-align: middle;
    white-space: nowrap;
}

.data-table tbody tr:nth-child(even) {
    background: var(--surface-1);
}

.data-table tbody tr:nth-child(even):hover {
    background: var(--purple-50);
}

/* Badge de prioridade */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--accent-dim);
    color: var(--purple-700);
    border: 1px solid rgba(224, 64, 251, 0.2);
    letter-spacing: 0.02em;
}

.table-error {
    text-align: center;
    color: #b91c1c;
    padding: 20px;
    font-style: italic;
}

/* ── Responsivo ──────────────────────────────────────────────── */
@media (max-width: 640px) {
    .page-header {
        padding: 28px 20px 24px;
    }

    .card {
        padding: 22px 18px;
        border-radius: var(--radius-lg);
    }

    .form-row {
        flex-direction: column;
        gap: 20px;
    }

    .led-preview-group {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        max-width: 100%;
    }

    .btn {
        width: 100%;
    }
}