/* ============================================================================
   DashKit — biblioteca de UI para dashboards administrativos (OnVisus)
   ----------------------------------------------------------------------------
   Padrão visual originado da tela "Extrato ASAAS": cards com sombra suave,
   painéis arredondados e tabelas Semantic UI estilizadas.

   Namespace de classes: .dk-*  (evita colisão com Semantic UI e o app)
   Uso: veja resources/views/components/dashkit/README.md
   ============================================================================ */

/* ===== Container da página ================================================= */
.dk-page { padding: 20px; background: #f4f6fb; }

/* ===== Bloco de filtros ==================================================== */
.dk-filters {
    background: #fff;
    padding: 18px 20px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(16,24,40,.06);
    margin-bottom: 22px;
}
.dk-filters .field label { color: #475467; font-size: 12px; font-weight: 600; }

/* ===== Grid de cards de estatística ======================================== */
.dk-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}
.dk-stats--3 { grid-template-columns: repeat(3, 1fr); }
.dk-stats--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 991px) {
    .dk-stats, .dk-stats--3, .dk-stats--2 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575px) {
    .dk-stats, .dk-stats--3, .dk-stats--2 { grid-template-columns: 1fr; }
}

/* ===== Card de estatística ================================================= */
.dk-card {
    background: #fff;
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: 0 1px 3px rgba(16,24,40,.06);
    position: relative;
    min-height: 92px;
}
.dk-card__label {
    font-size: 11px;
    letter-spacing: .4px;
    font-weight: 700;
    text-transform: uppercase;
    color: #667085;
    margin-bottom: 10px;
}
.dk-card__value {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.1;
    color: #101828;
}
.dk-card__sub { font-size: 12px; color: #98a2b3; margin-top: 6px; }
.dk-card__icon {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}
/* Variante clicável (quando o card recebe href) */
.dk-card--link { display: block; color: inherit; transition: box-shadow .15s ease, transform .15s ease; }
.dk-card--link:hover { box-shadow: 0 4px 12px rgba(16,24,40,.12); transform: translateY(-1px); color: inherit; }

/* ===== Cores de texto (helpers) =========================================== */
.dk-green  { color: #12b76a !important; }
.dk-red    { color: #f04438 !important; }
.dk-blue   { color: #2e6bff !important; }
.dk-purple { color: #7a5af8 !important; }
.dk-orange { color: #f79009 !important; }
.dk-muted  { color: #98a2b3 !important; }

/* ===== Fundos de ícone ==================================================== */
.dk-ic-green  { background: #e6f7ef; color: #12b76a; }
.dk-ic-red    { background: #feecea; color: #f04438; }
.dk-ic-blue   { background: #eaf1ff; color: #2e6bff; }
.dk-ic-purple { background: #f0ecff; color: #7a5af8; }
.dk-ic-orange { background: #fef0e6; color: #f79009; }
.dk-ic-grey   { background: #eef2f7; color: #667085; }

/* ===== Painel ============================================================= */
.dk-panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(16,24,40,.06);
    margin-bottom: 22px;
    overflow: hidden;
}
.dk-panel__head { padding: 16px 20px 6px 20px; }
.dk-panel__title { font-size: 15px; font-weight: 700; color: #101828; margin: 0; }
.dk-panel__desc { font-size: 12px; color: #98a2b3; margin-top: 2px; }

/* Tabelas Semantic UI dentro de um painel */
.dk-panel table.ui.table { border: none; box-shadow: none; margin: 0; }
.dk-panel table.ui.table thead th {
    background: #fafbfc;
    color: #667085;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.dk-panel table.ui.table td { vertical-align: middle; padding: 12px 20px; }
.dk-panel table.ui.table tfoot th { background: #fafbfc; }

/* ===== Utilitários ======================================================== */
.dk-right { text-align: right !important; }
.dk-center { text-align: center !important; }
.dk-empty { padding: 30px; text-align: center; color: #98a2b3; }
.dk-empty i { font-size: 28px; }

/* ===== Badges e pills ===================================================== */
.dk-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    background: #eef2f7;
    color: #475467;
}
.dk-badge i.icon { margin: 0; line-height: 1; display: inline-flex; align-items: center; }
.dk-badge--blue   { background: #eaf1ff; color: #2e6bff; }
.dk-badge--green  { background: #e6f7ef; color: #12b76a; }
.dk-badge--red    { background: #feecea; color: #f04438; }
.dk-badge--orange { background: #fef0e6; color: #f79009; }
.dk-badge--purple { background: #f0ecff; color: #7a5af8; }

.dk-pill {
    display: inline-block;
    min-width: 26px;
    padding: 2px 8px;
    border-radius: 20px;
    background: #eef2f7;
    color: #475467;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

/* Cores extras (cobrem os "cor" retornados pelos controllers) */
.dk-yellow { color: #f79009 !important; }
.dk-grey   { color: #667085 !important; }
.dk-badge--yellow { background: #fef0e6; color: #b54708; }
.dk-badge--grey   { background: #eef2f7; color: #667085; }
.dk-ic-yellow { background: #fef0e6; color: #f79009; }

/* ===== Cabeçalho de página / seção ======================================== */
.dk-page-head {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(16,24,40,.06);
    padding: 18px 22px;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.dk-page-head__main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.dk-page-head__icon {
    width: 46px; height: 46px; border-radius: 12px; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center; font-size: 20px;
    background: #eaf1ff; color: #2e6bff;
}
.dk-page-head__title { font-size: 19px; font-weight: 800; color: #101828; margin: 0; line-height: 1.2; }
.dk-page-head__sub { font-size: 13px; color: #98a2b3; margin-top: 2px; }
.dk-page-head__aside { text-align: right; flex: 0 0 auto; }

/* ===== Definition list (chave / valor) ==================================== */
.dk-deflist { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.dk-deflist > div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.dk-deflist__k { color: #667085; font-weight: 600; }
.dk-deflist__v { color: #101828; font-weight: 700; text-align: right; }

/* ===== Feed / Timeline ==================================================== */
.dk-feed { display: flex; flex-direction: column; }
.dk-feed__item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f0f2f5; }
.dk-feed__item:last-child { border-bottom: none; }
.dk-feed__icon {
    width: 34px; height: 34px; border-radius: 9px; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center; font-size: 14px;
    background: #eef2f7; color: #667085;
}
.dk-feed__body { flex: 1 1 auto; min-width: 0; }
.dk-feed__title { font-size: 14px; font-weight: 700; color: #101828; }
.dk-feed__date { font-size: 12px; color: #98a2b3; margin-top: 1px; }
.dk-feed__text { font-size: 13px; color: #475467; margin-top: 3px; }

/* ===== Lista dividida ===================================================== */
.dk-list { display: flex; flex-direction: column; }
.dk-list__item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f0f2f5; align-items: flex-start; }
.dk-list__item:last-child { border-bottom: none; }

/* ===== Alertas inline ==================================================== */
.dk-alert {
    border-radius: 10px; padding: 12px 14px; font-size: 13px; margin-bottom: 14px;
    display: flex; gap: 10px; align-items: flex-start;
    background: #eef2f7; color: #475467; border: 1px solid #e4e7ec;
}
.dk-alert__icon { font-size: 16px; line-height: 1.4; }
.dk-alert__body { flex: 1 1 auto; min-width: 0; }
.dk-alert__title { font-weight: 700; margin-bottom: 2px; }
.dk-alert__body .ui.button {
    display: block; width: 100%; margin: 8px 0 0; border-radius: 8px;
    text-align: center; box-sizing: border-box;
}
.dk-alert__body .ui.button:first-of-type { margin-top: 12px; }
.dk-alert--info    { background: #eaf1ff; border-color: #d6e2ff; color: #1a4fd0; }
.dk-alert--success { background: #e6f7ef; border-color: #c9edda; color: #087443; }
.dk-alert--warning { background: #fef0e6; border-color: #fcdcc0; color: #b54708; }
.dk-alert--danger  { background: #feecea; border-color: #fcd9d5; color: #b42318; }

/* ===== Score ring ======================================================== */
.dk-ring {
    width: 140px; height: 140px; border-radius: 50%; margin: 0 auto;
    display: flex; align-items: center; justify-content: center; text-align: center;
    color: #fff; box-shadow: 0 6px 16px rgba(16,24,40,.15);
}
.dk-ring--sm { width: 84px; height: 84px; box-shadow: 0 4px 10px rgba(16,24,40,.15); }
.dk-ring__score { font-size: 42px; font-weight: 800; line-height: 1; }
.dk-ring--sm .dk-ring__score { font-size: 26px; }
.dk-ring__max { font-size: 12px; opacity: .85; }
.dk-ring--green  { background: linear-gradient(135deg, #12b76a, #0e9e5c); }
.dk-ring--blue   { background: linear-gradient(135deg, #2e6bff, #1d54d8); }
.dk-ring--yellow { background: linear-gradient(135deg, #f79009, #dd7b00); }
.dk-ring--orange { background: linear-gradient(135deg, #f79009, #dd7b00); }
.dk-ring--red    { background: linear-gradient(135deg, #f04438, #d3372c); }
.dk-ring--grey   { background: linear-gradient(135deg, #98a2b3, #7a8598); }

/* ===== Barra de progresso ================================================ */
.dk-progress { background: #eef2f7; border-radius: 20px; height: 10px; overflow: hidden; }
.dk-progress__bar { height: 100%; border-radius: 20px; background: #12b76a; transition: width .3s ease; }
.dk-progress__bar--blue  { background: #2e6bff; }
.dk-progress__bar--green { background: #12b76a; }
.dk-progress__bar--red   { background: #f04438; }
.dk-progress__label { font-size: 12px; color: #667085; margin-top: 6px; }

/* ===== DataTables (tema Semantic UI) no padrão DashKit ==================== */
/* Aplique a classe .dk-datatable na <table> e envolva em .dk-datatable-panel. */
.dk-datatable-panel .dataTables_wrapper { padding: 0 0 6px; }
.dk-datatable-panel .dataTables_wrapper > .ui.grid { margin: 0; padding: 14px 16px; }
.dk-datatable-panel .dataTables_wrapper > .ui.grid + table { margin-top: 0; }

/* Controles do topo: busca e "mostrar N" */
.dk-datatable-panel .dataTables_length label,
.dk-datatable-panel .dataTables_filter label {
    font-size: 12px; font-weight: 600; color: #475467;
    display: inline-flex; align-items: center; gap: 8px; margin: 0;
}
.dk-datatable-panel .dataTables_filter input[type="search"],
.dk-datatable-panel .dataTables_filter input {
    border: 1px solid #e4e7ec !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
    min-width: 220px;
    outline: none;
    box-shadow: none !important;
}
.dk-datatable-panel .dataTables_filter input:focus {
    border-color: #2e6bff !important;
    box-shadow: 0 0 0 3px rgba(46,107,255,.12) !important;
}
.dk-datatable-panel .dataTables_length select {
    border: 1px solid #e4e7ec !important;
    border-radius: 8px !important;
    padding: 6px 10px !important;
    font-size: 13px !important;
}

/* Rodapé: info + paginação */
.dk-datatable-panel .dataTables_info { font-size: 12px; color: #98a2b3; padding-top: 6px; }
.dk-datatable-panel .dataTables_paginate { padding-top: 4px; }

/* Paginação — variação DataTables padrão (.paginate_button) */
.dk-datatable-panel .dataTables_paginate .paginate_button {
    display: inline-block; min-width: 32px; text-align: center;
    padding: 6px 10px !important; margin: 0 2px;
    border-radius: 8px !important;
    border: 1px solid #e4e7ec !important;
    background: #fff !important; color: #475467 !important;
    font-size: 13px; font-weight: 600; cursor: pointer;
}
.dk-datatable-panel .dataTables_paginate .paginate_button:hover {
    background: #f4f6fb !important; border-color: #d0d5dd !important;
}
.dk-datatable-panel .dataTables_paginate .paginate_button.current,
.dk-datatable-panel .dataTables_paginate .paginate_button.current:hover {
    background: #2e6bff !important; border-color: #2e6bff !important; color: #fff !important;
}
.dk-datatable-panel .dataTables_paginate .paginate_button.disabled { opacity: .45; cursor: default; }

/* Paginação — variação tema Semantic (.ui.pagination.menu) */
.dk-datatable-panel .dataTables_paginate .ui.pagination.menu {
    box-shadow: none; border: 1px solid #e4e7ec; border-radius: 8px; overflow: hidden;
}
.dk-datatable-panel .dataTables_paginate .ui.pagination.menu .item { min-width: 34px; justify-content: center; font-size: 13px; }
.dk-datatable-panel .dataTables_paginate .ui.pagination.menu .active.item { background: #2e6bff; color: #fff; }

/* Cabeçalho ordenável */
.dk-datatable-panel table.dk-datatable thead th { cursor: pointer; }

/* ===== Páginas públicas de autenticação (login/cadastro) ================== */
.dk-auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    background: #00214a;
}
.dk-auth-card {
    width: 100%;
    max-width: 480px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(16,24,40,.10);
    padding: 36px 34px;
}
.dk-auth-card__logo { display: block; margin: 0 auto 26px; max-height: 64px; }
.dk-auth-card__badge { display: flex; justify-content: center; margin-bottom: 14px; }
.dk-auth-card__title { font-size: 21px; font-weight: 800; color: #101828; text-align: center; margin: 0 0 6px; }
.dk-auth-card__subtitle { font-size: 13px; color: #667085; text-align: center; margin: 0 0 26px; line-height: 1.5; }
.dk-auth-card__footer { text-align: center; font-size: 13px; color: #667085; margin-top: 24px; }
.dk-auth-card__footer a { color: #2e6bff; font-weight: 700; text-decoration: none; }
.dk-auth-card__footer a:hover { text-decoration: underline; }

.dk-auth-form .field { margin-bottom: 18px; }
.dk-auth-form .fields { display: flex; gap: 14px; margin: 0 0 18px !important; }
.dk-auth-form .fields .field {
    flex: 1 1 0 !important; width: 0 !important; margin-bottom: 0;
    padding-left: 0 !important; padding-right: 0 !important;
}
.dk-auth-form label {
    display: block; font-size: 11px; font-weight: 700; color: #475467;
    text-transform: uppercase; letter-spacing: .3px; margin-bottom: 6px;
}
.dk-auth-form input[type="text"],
.dk-auth-form input[type="email"],
.dk-auth-form input[type="password"],
.dk-auth-form input[type="tel"] {
    width: 100%; border: 1px solid #e4e7ec !important; border-radius: 10px;
    padding: 12px 14px; font-size: 14px; color: #101828; background: #fff;
    outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.dk-auth-form input:focus {
    border-color: #2e6bff !important;
    box-shadow: 0 0 0 3px rgba(46,107,255,.12);
}
.dk-auth-form .field.error input { border-color: #f04438 !important; }
.dk-auth-form .ui.error.message { border-radius: 10px; }
.dk-auth-form button.ui.button {
    width: 100%; background: #2e6bff; border: none; border-radius: 10px;
    padding: 13px; font-size: 14px; font-weight: 700; box-shadow: none;
    transition: background .15s ease;
}
.dk-auth-form button.ui.button:hover { background: #1d54d8; }
@media (max-width: 480px) {
    .dk-auth-card { padding: 28px 22px; }
    .dk-auth-form .fields { flex-direction: column !important; gap: 0; }
    .dk-auth-form .fields .field { width: 100% !important; flex: 1 1 auto !important; }
}
