/* Público — tema claro creme/branco (partilha :root com CRM quando ambos carregados) */
:root {
    --bg-primary: #f5f3ef;
    --bg-secondary: #ffffff;
    --bg-tertiary: #faf9f7;
    --bg-card: #ffffff;

    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-muted: #8b8b8b;

    --accent-gold: #d4a843;
    --accent-gold-hover: #c49a3a;
    --accent-orange: #e67e22;

    --border-color: #e5e2dc;
    --border-hover: #d0cdc7;

    --color-success: #059669;
    --color-danger: #dc2626;
    --color-warning: #f59e0b;
    --color-info: #2563eb;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);

    --mv-sand: var(--bg-primary);
    --mv-ink: var(--text-primary);
    --mv-amber: var(--accent-gold);
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: "DM Sans", "Sora", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.navbar-dark.bg-dark {
    background-color: var(--bg-secondary) !important;
    border-bottom: 1px solid var(--border-color);
}

.navbar-dark .navbar-brand,
.navbar-dark .nav-link {
    color: var(--text-secondary) !important;
}

.navbar-dark .nav-link:hover,
.navbar-dark .navbar-brand:hover {
    color: var(--text-primary) !important;
}

.navbar-dark .navbar-toggler {
    border-color: var(--border-color);
}

.navbar-dark .navbar-toggler-icon {
    filter: invert(0.35);
}

.btn-primary {
    background-color: var(--accent-gold);
    border-color: var(--accent-gold);
    color: #ffffff;
    font-weight: 600;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--accent-gold-hover);
    border-color: var(--accent-gold-hover);
    color: #ffffff;
}

main {
    flex: 1;
}

/* Custom form styling */
.form-control:focus {
    border-color: var(--accent-gold, var(--mv-amber));
    box-shadow: 0 0 0 0.2rem rgba(212, 168, 67, 0.2);
}

/* Modal enhancements */
.modal-content {
    border-radius: 0.5rem;
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
}

/* Responsive tables */
.table-responsive {
    overflow-x: auto;
}

/* Custom card styling */
.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: 1px solid rgba(0, 0, 0, 0.125);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

/* Button enhancements */
.btn {
    border-radius: 0.375rem;
}

/* Alert styling */
.alert {
    border-radius: 0.375rem;
}

/* Footer styling */
footer {
    margin-top: auto;
}

/* Loading indicators */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Username availability indicator */
#usernameStatus {
    font-size: 0.875rem;
}

/* Password strength indicator */
#passwordStrength {
    font-size: 0.875rem;
}

#passwordStrength small {
    display: block;
    margin-bottom: 0.25rem;
}

/* Responsive design adjustments */
@media (max-width: 768px) {
    .table {
        font-size: 0.875rem;
    }
    
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
}


/* Agencia module - institutional look */
.agencia-page { padding-bottom: 2rem; }
.agencia-title { font-weight: 600; color: #2c3e50; }
.agencia-filters-card { border-left: 4px solid #0d6efd; }
.agencia-kpi-card { border: 1px solid #dee2e6; border-radius: 0.5rem; transition: box-shadow 0.2s; }
.agencia-kpi-card:hover { box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.1); }
.agencia-kpi-value { font-size: 1.75rem; font-weight: 700; color: #0d6efd; }
.agencia-chart-card { border-radius: 0.5rem; overflow: hidden; }
.agencia-table-card { border-radius: 0.5rem; }
.agencia-table thead { background: #f8f9fa; }
.agencia-table th { font-weight: 600; color: #495057; }

/* Licenses page - Links Uteis */
.licenses-page { padding-bottom: 2rem; }
.licenses-title { font-weight: 600; color: #2c3e50; }
.licenses-chart-card { border-radius: 0.5rem; overflow: hidden; }
.licenses-table-card { border-radius: 0.5rem; }
.licenses-table thead { background: #f8f9fa; }
.licenses-table th { font-weight: 600; color: #495057; }
.links-uteis-section { margin-top: 32px; }
.links-uteis-title { font-weight: 600; color: #2c3e50; }
.link-card { border: 1px solid #dee2e6; border-radius: 0.5rem; box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075); transition: box-shadow 0.2s, border-color 0.2s; }
.link-card:hover { box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1); border-color: #0d6efd; }
.link-card .link-icon { color: #0d6efd; }
.link-card .link-title { font-weight: 600; font-size: 0.95rem; }
.link-card .link-subtitle { font-size: 0.8rem; }
.link-actions .btn-icon { padding: 0.25rem 0.5rem; }
.link-drag-handle { cursor: grab; user-select: none; }
.link-drag-handle:active { cursor: grabbing; }
.sortable-ghost { opacity: 0.4; }
@media (max-width: 767px) { .links-cards-row .col-md-6 { flex: 0 0 100%; max-width: 100%; } }

/* Manager PROP */
.managerprop-page { padding-bottom: 2rem; }
.managerprop-title { font-weight: 600; color: #2c3e50; }
.managerprop-nav .nav-link { color: #495057; margin-bottom: 0.25rem; }
.managerprop-nav .nav-link:hover { color: #0d6efd; }
.managerprop-section { margin-bottom: 2.5rem; padding-top: 1rem; }
.managerprop-section .section-title { font-weight: 600; color: #2c3e50; margin-bottom: 1rem; border-bottom: 2px solid #0d6efd; padding-bottom: 0.5rem; }
