/**
 * Caminho: /assets/css/app.css
 * Descrição: Estilos principais do Painel Administrativo AgendaRede.
 */

:root {
    --app-bg: #f4f6fb;
    --card-bg: #ffffff;
    --text-main: #182230;
    --text-muted: #667085;
    --line-color: #e4e7ec;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #12b76a;
    --warning: #f79009;
    --danger: #f04438;
    --info: #06b6d4;
    --sidebar-bg: #08152f;
    --sidebar-bg-light: #0d1f43;
    --sidebar-text: #d7e2ff;
    --sidebar-active: rgba(255,255,255,0.10);
    --shadow-sm: 0 2px 8px rgba(16, 24, 40, 0.04);
    --shadow-md: 0 10px 30px rgba(16, 24, 40, 0.08);
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
}

* {
    box-sizing: border-box;
}

body {
    background: var(--app-bg);
    color: var(--text-main);
    font-family: Inter, Arial, Helvetica, sans-serif;
}

/* LOGIN */
.login-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.06), transparent 35%),
        radial-gradient(circle at top right, rgba(6, 182, 212, 0.05), transparent 30%),
        var(--app-bg);
}

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 450px;
    background: #fff;
    border: 1px solid var(--line-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 28px;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.login-logo {
    width: 42px;
    height: 42px;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
}

.login-brand h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.login-brand p {
    margin: 0;
    color: var(--text-muted);
}

/* LAYOUT */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-light) 100%);
    color: var(--sidebar-text);
    padding: 18px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.app-brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 6px;
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 20px;
}

.app-brand-title {
    font-size: 15px;
    line-height: 1.2;
    font-weight: 700;
    color: #fff;
}

.app-brand-subtitle {
    font-size: 13px;
    color: #c5d2f3;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-nav a {
    color: var(--sidebar-text);
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.2s ease;
    font-size: 15px;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--sidebar-active);
    color: #fff;
}

.app-main {
    flex: 1;
    min-width: 0;
}

.app-topbar {
    background: rgba(10, 15, 28, 0.88);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    color: #fff;
    padding: 14px 24px;
}

.app-content {
    padding: 22px;
}

.page-header {
    margin-bottom: 20px;
}

.page-title {
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 2px;
}

.page-subtitle {
    color: var(--text-muted);
    margin-bottom: 0;
}

/* CARDS */
.app-card,
.card {
    border: 1px solid var(--line-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.app-card .card-header,
.card-header {
    border-bottom: 1px solid var(--line-color);
    border-top-left-radius: var(--radius-lg) !important;
    border-top-right-radius: var(--radius-lg) !important;
}

.metric-card {
    background: linear-gradient(180deg, #ffffff 0%, #fafcff 100%);
    border: 1px solid var(--line-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 18px;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.metric-card::after {
    content: "";
    position: absolute;
    right: -18px;
    top: -18px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.06);
}

.metric-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.metric-label {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

.metric-value {
    font-size: 34px;
    line-height: 1;
    font-weight: 800;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.metric-foot {
    font-size: 13px;
    color: var(--text-muted);
    position: relative;
    z-index: 1;
}

.metric-icon {
    width: 42px;
    height: 42px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.icon-primary { background: rgba(37, 99, 235, 0.10); color: var(--primary); }
.icon-success { background: rgba(18, 183, 106, 0.10); color: var(--success); }
.icon-warning { background: rgba(247, 144, 9, 0.10); color: var(--warning); }
.icon-danger  { background: rgba(240, 68, 56, 0.10); color: var(--danger); }
.icon-info    { background: rgba(6, 182, 212, 0.10); color: var(--info); }

.chart-card {
    background: #fff;
    border: 1px solid var(--line-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 18px;
    height: 100%;
}

.chart-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.chart-subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 14px;
}

.chart-wrap {
    position: relative;
    width: 100%;
    min-height: 280px;
    height: 280px;
}

.chart-wrap-sm {
    position: relative;
    width: 100%;
    min-height: 240px;
    height: 240px;
}

.section-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--text-main);
}

.mini-card {
    background: #f8fafc;
    border: 1px solid var(--line-color);
    border-radius: var(--radius-md);
    padding: 16px;
    height: 100%;
}

.empty-state {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-muted);
}

/* TABLES */
.table {
    margin-bottom: 0;
}

.table thead th {
    background: #f8fafc;
    color: #344054;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border-bottom-width: 1px;
}

.table tbody td {
    vertical-align: middle;
}

.table-modern tbody tr:hover {
    background: #f8fbff;
}

.client-name-strong {
    font-weight: 700;
    font-size: 15px;
}

.client-name-sub {
    display: block;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 2px;
}

.url-box {
    display: inline-block;
    max-width: 260px;
    font-size: 13px;
    background: #f8fafc;
    border: 1px solid var(--line-color);
    padding: 6px 8px;
    border-radius: 4px;
    word-break: break-word;
}

.badge-soft {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge-soft-success { background: rgba(18,183,106,0.12); color: #067647; }
.badge-soft-danger  { background: rgba(240,68,56,0.12); color: #b42318; }
.badge-soft-warning { background: rgba(247,144,9,0.15); color: #b54708; }
.badge-soft-info    { background: rgba(37,99,235,0.12); color: #1d4ed8; }
.badge-soft-gray    { background: rgba(102,112,133,0.12); color: #475467; }

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.success { background: var(--success); }
.status-dot.danger  { background: var(--danger); }
.status-dot.warning { background: var(--warning); }
.status-dot.info    { background: var(--primary); }
.status-dot.gray    { background: #98a2b3; }

.list-compact {
    list-style: none;
    margin: 0;
    padding: 0;
}

.list-compact li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #eef2f6;
}

.list-compact li:last-child {
    border-bottom: none;
}

.item-title {
    font-weight: 600;
    color: var(--text-main);
}

.item-subtitle {
    color: var(--text-muted);
    font-size: 13px;
}

.kpi-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.kpi-pill {
    border: 1px solid var(--line-color);
    border-radius: 999px;
    padding: 8px 12px;
    background: #fff;
    font-size: 13px;
    color: var(--text-muted);
}

.kpi-pill strong {
    color: var(--text-main);
}

/* CONFIGURAÇÕES */
.config-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 18px;
}

.config-card {
    grid-column: span 4;
    background: #fff;
    border: 1px solid var(--line-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 18px;
    height: 100%;
}

.config-card.full {
    grid-column: span 12;
}

.config-card.half {
    grid-column: span 6;
}

.config-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.config-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.config-desc {
    color: var(--text-muted);
    font-size: 13px;
}

.config-list {
    padding-left: 18px;
    margin-bottom: 0;
    color: #344054;
}

.config-list li + li {
    margin-top: 8px;
}

.info-bar {
    background: linear-gradient(90deg, rgba(37,99,235,0.08), rgba(6,182,212,0.08));
    border: 1px solid rgba(37,99,235,0.12);
    border-radius: 6px;
    padding: 14px 16px;
    color: #1d4ed8;
    font-weight: 600;
}

/* FINANCEIRO */
.finance-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 18px;
}

.finance-box {
    flex: 1 1 220px;
    min-width: 220px;
    padding: 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line-color);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.finance-box .label {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

.finance-box .value {
    font-size: 28px;
    font-weight: 800;
}

.progress-thin {
    height: 8px;
    background: #eef2f7;
    border-radius: 999px;
    overflow: hidden;
}

.progress-thin .bar {
    height: 100%;
    border-radius: 999px;
}

/* FORMS */
.form-control,
.form-select,
.btn {
    border-radius: 6px;
}

.form-control,
.form-select {
    border-color: #d0d5dd;
}

.form-control:focus,
.form-select:focus {
    border-color: #84adff;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.12);
}

/* RESPONSIVO */
@media (max-width: 1200px) {
    .config-card {
        grid-column: span 6;
    }
}

@media (max-width: 991px) {
    .app-sidebar {
        width: 88px;
        padding: 14px 10px;
    }

    .app-brand {
        justify-content: center;
    }

    .app-brand-text,
    .sidebar-nav a span {
        display: none;
    }

    .sidebar-nav a {
        justify-content: center;
    }

    .config-card,
    .config-card.half {
        grid-column: span 12;
    }
}

@media (max-width: 768px) {
    .app-content {
        padding: 14px;
    }

    .page-title {
        font-size: 24px;
    }

    .metric-value {
        font-size: 28px;
    }

    .chart-wrap,
    .chart-wrap-sm {
        min-height: 220px;
        height: 220px;
    }

    .url-box {
        max-width: 100%;
    }
}