/* Canal de Denuncias - Custom Theme */
/* Teal/Emerald identity - Trust & Compliance */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap');

:root {
    --kt-primary: #0d9488;
    --kt-primary-active: #0a7c72;
    --kt-primary-light: #f0fdfa;
    --kt-primary-rgb: 13, 148, 136;
    --kt-success: #22c55e;
    --kt-success-light: #f0fdf4;
    --kt-warning: #f59e0b;
    --kt-warning-light: #fffbeb;
    --kt-danger: #ef4444;
    --kt-danger-light: #fef2f2;
    --kt-info: #8b5cf6;
    --kt-info-light: #f5f3ff;
    --kt-dark: #0f172a;
    --kt-gray-100: #f8fafc;
    --kt-gray-200: #f1f5f9;
    --kt-gray-300: #e2e8f0;
    --kt-gray-400: #94a3b8;
    --kt-gray-500: #64748b;
    --kt-gray-600: #475569;
    --kt-gray-700: #334155;
    --kt-gray-800: #1e293b;
    --kt-gray-900: #0f172a;
    --kt-sidebar-bg: #0f172a;
    --kt-sidebar-width: 260px;
    --kt-sidebar-mini: 75px;
    --kt-header-height: 64px;
    --kt-radius: 0.5rem;
    --kt-radius-lg: 0.75rem;
}

/* ---- Base ---- */
body {
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    background: var(--kt-gray-100);
    color: var(--kt-gray-700);
    font-size: 0.9rem;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--kt-gray-900);
    letter-spacing: -0.02em;
}

a {
    color: var(--kt-primary);
    text-decoration: none;
}
a:hover {
    color: var(--kt-primary-active);
}

/* ---- App Layout ---- */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.app-sidebar {
    width: var(--kt-sidebar-width);
    background: var(--kt-sidebar-bg);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    overflow: hidden;
}

.sidebar-brand {
    height: var(--kt-header-height);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-brand a {
    color: white;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.sidebar-brand a:hover { color: white; }
.sidebar-brand .brand-sub {
    font-size: 0.65rem;
    color: var(--kt-primary);
    font-weight: 600;
    display: block;
    margin-top: 1px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0;
}

.sidebar-menu::-webkit-scrollbar { width: 3px; }
.sidebar-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }

.menu-section {
    padding: 1rem 1.25rem 0.4rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--kt-gray-500);
}

.menu-item {
    padding: 0 0.625rem;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.875rem;
    border-radius: var(--kt-radius);
    color: rgba(255,255,255,0.5);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.15s;
    gap: 0.7rem;
}

.menu-link:hover {
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.8);
}

.menu-link.active {
    background: rgba(13, 148, 136, 0.15);
    color: var(--kt-primary);
}

.menu-link .menu-icon {
    width: 20px;
    height: 20px;
    opacity: 0.5;
    flex-shrink: 0;
}

.menu-link.active .menu-icon {
    opacity: 1;
}

.menu-link .menu-badge {
    margin-left: auto;
}

.sidebar-footer {
    padding: 0.875rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--kt-radius);
    background: var(--kt-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.sidebar-user-info { overflow: hidden; }

.sidebar-user-name {
    color: rgba(255,255,255,0.8);
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    color: var(--kt-gray-500);
    font-size: 0.7rem;
}

/* ---- Main Content ---- */
.app-main {
    flex: 1;
    margin-left: var(--kt-sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ---- Top Header ---- */
.app-header {
    height: var(--kt-header-height);
    background: white;
    border-bottom: 1px solid var(--kt-gray-200);
    display: flex;
    align-items: center;
    padding: 0 1.75rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.header-left { display: flex; align-items: center; gap: 1rem; }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 0.75rem; }

.btn-sidebar-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--kt-gray-600);
}
.btn-sidebar-toggle svg { width: 20px; height: 20px; }

.header-user-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    border-radius: var(--kt-radius);
    background: var(--kt-gray-100);
    color: var(--kt-gray-600);
    font-size: 0.82rem;
    font-weight: 500;
    border: 1px solid var(--kt-gray-200);
    cursor: pointer;
    transition: all 0.15s;
}
.header-user-btn:hover { background: var(--kt-gray-200); color: var(--kt-gray-800); border-color: var(--kt-gray-300); }

/* ---- Page Content ---- */
.app-content {
    flex: 1;
    padding: 1.75rem;
}

/* ---- Page Toolbar ---- */
.page-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-toolbar h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    color: var(--kt-dark);
}

.page-toolbar .breadcrumb { margin: 0; font-size: 0.78rem; }
.page-toolbar .breadcrumb-item a { color: var(--kt-gray-500); }
.page-toolbar .breadcrumb-item.active { color: var(--kt-gray-700); }

/* ---- Cards ---- */
.card {
    border: 1px solid var(--kt-gray-200);
    border-radius: var(--kt-radius-lg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    background: white;
}

.card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--kt-gray-200);
    padding: 1.15rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
}

.card .card-header .card-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: var(--kt-gray-900);
}

.card .card-body { padding: 1.5rem; }

.card .card-footer {
    background: var(--kt-gray-100);
    border-top: 1px solid var(--kt-gray-200);
    padding: 1rem 1.5rem;
}

/* ---- Stat Cards ---- */
.stat-card {
    border: 1px solid var(--kt-gray-200);
    border-radius: var(--kt-radius-lg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    background: white;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: border-color 0.15s;
}
.stat-card:hover { border-color: var(--kt-gray-300); }

.stat-card .stat-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--kt-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card .stat-icon svg { width: 22px; height: 22px; }

.stat-card .stat-icon.bg-primary-light { background: var(--kt-primary-light); color: var(--kt-primary); }
.stat-card .stat-icon.bg-success-light { background: var(--kt-success-light); color: var(--kt-success); }
.stat-card .stat-icon.bg-warning-light { background: var(--kt-warning-light); color: var(--kt-warning); }
.stat-card .stat-icon.bg-danger-light { background: var(--kt-danger-light); color: var(--kt-danger); }
.stat-card .stat-icon.bg-info-light { background: var(--kt-info-light); color: var(--kt-info); }

.stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--kt-dark);
    line-height: 1;
    font-family: 'JetBrains Mono', monospace;
}

.stat-card .stat-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--kt-gray-500);
    margin-top: 0.2rem;
}

/* ---- Tables ---- */
.table {
    color: var(--kt-gray-700);
    font-size: 0.85rem;
}

.table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    color: var(--kt-gray-500);
    border-bottom: 2px solid var(--kt-gray-200);
    padding: 0.75rem 1rem;
    background: transparent;
}

.table tbody td {
    padding: 0.8rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--kt-gray-100);
}

.table tbody tr:last-child td { border-bottom: 0; }
.table-hover tbody tr:hover { background: var(--kt-gray-100); }

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: transparent;
}

/* ---- Forms ---- */
.form-control, .form-select {
    border: 1px solid var(--kt-gray-300);
    border-radius: var(--kt-radius);
    padding: 0.6rem 0.875rem;
    font-size: 0.85rem;
    color: var(--kt-gray-800);
    background-color: white;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--kt-primary);
    background-color: white;
    box-shadow: 0 0 0 3px rgba(var(--kt-primary-rgb), 0.1);
}

.form-control::placeholder { color: var(--kt-gray-400); }

.form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--kt-gray-700);
    margin-bottom: 0.3rem;
}

.form-check-input:checked {
    background-color: var(--kt-primary);
    border-color: var(--kt-primary);
}

/* ---- Buttons ---- */
.btn {
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.55rem 1.15rem;
    border-radius: var(--kt-radius);
    transition: all 0.15s;
    letter-spacing: -0.01em;
}

.btn-primary {
    background: var(--kt-primary);
    border-color: var(--kt-primary);
}
.btn-primary:hover {
    background: var(--kt-primary-active);
    border-color: var(--kt-primary-active);
}

.btn-success { background: var(--kt-success); border-color: var(--kt-success); }
.btn-danger { background: var(--kt-danger); border-color: var(--kt-danger); }

.btn-light {
    background: white;
    border: 1px solid var(--kt-gray-300);
    color: var(--kt-gray-700);
}
.btn-light:hover {
    background: var(--kt-gray-100);
    border-color: var(--kt-gray-300);
    color: var(--kt-gray-800);
}

.btn-outline-secondary {
    border-color: var(--kt-gray-300);
    color: var(--kt-gray-600);
}
.btn-outline-secondary:hover {
    background: var(--kt-gray-100);
    border-color: var(--kt-gray-300);
    color: var(--kt-gray-800);
}

.btn-sm {
    font-size: 0.78rem;
    padding: 0.35rem 0.75rem;
}

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ---- Badges ---- */
.badge {
    font-weight: 600;
    font-size: 0.7rem;
    padding: 0.3em 0.6em;
    border-radius: 50px;
    letter-spacing: 0.02em;
}

.badge-light-primary { background: var(--kt-primary-light); color: var(--kt-primary); }
.badge-light-success { background: var(--kt-success-light); color: #15803d; }
.badge-light-warning { background: var(--kt-warning-light); color: #b45309; }
.badge-light-danger { background: var(--kt-danger-light); color: #dc2626; }
.badge-light-info { background: var(--kt-info-light); color: var(--kt-info); }

.badge-type {
    display: inline-block;
    padding: 0.3em 0.6em;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
}

/* ---- Alerts / Flash ---- */
.alert {
    border: 1px solid transparent;
    border-radius: var(--kt-radius);
    font-size: 0.85rem;
    font-weight: 500;
}

.alert-success { background: var(--kt-success-light); color: #15803d; border-color: #bbf7d0; }
.alert-danger { background: var(--kt-danger-light); color: #dc2626; border-color: #fecaca; }
.alert-warning { background: var(--kt-warning-light); color: #b45309; border-color: #fde68a; }

.flash {
    animation: fadeSlideIn 0.3s ease;
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Separator ---- */
.separator {
    border-bottom: 1px dashed var(--kt-gray-300);
    margin: 1rem 0;
}

/* ---- Auth Page ---- */
.auth-page {
    background: linear-gradient(135deg, #0f172a 0%, #134e4a 100%);
}

.auth-wrapper {
    width: 100%;
    max-width: 440px;
}

.auth-card {
    background: white;
    border-radius: var(--kt-radius-lg);
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    padding: 2.5rem;
}

.auth-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-brand h1 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--kt-dark);
}

.auth-brand p {
    color: var(--kt-gray-500);
    font-size: 0.85rem;
}

.auth-links {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-links a {
    display: block;
    margin: 0.5rem 0;
    font-size: 0.85rem;
    color: var(--kt-primary);
    font-weight: 500;
}

/* ---- Stats Grid ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stats-grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .stats-grid, .stats-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

.stat { text-align: center; padding: 1rem; }
.stat .stat-value { display: block; font-size: 1.6rem; font-weight: 700; color: var(--kt-dark); font-family: 'JetBrains Mono', monospace; }
.stat .stat-label { display: block; font-size: 0.72rem; font-weight: 500; color: var(--kt-gray-500); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 0.25rem; }

/* ---- Inactive row ---- */
.inactive-row { opacity: 0.4; }

/* ---- Pagination ---- */
.pagination .page-link {
    border: 0;
    border-radius: var(--kt-radius);
    color: var(--kt-gray-600);
    font-weight: 500;
    font-size: 0.82rem;
    margin: 0 0.1rem;
}
.pagination .page-item.active .page-link {
    background: var(--kt-primary);
    color: white;
}

/* ---- Fieldset ---- */
fieldset { border: 0; padding: 0; margin: 0; }
legend.form-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--kt-gray-900);
    padding-bottom: 0.65rem;
    margin-bottom: 1rem;
    border-bottom: 1px dashed var(--kt-gray-300);
}

/* ---- App Footer ---- */
.app-footer {
    padding: 1rem 1.75rem;
    background: white;
    border-top: 1px solid var(--kt-gray-200);
    color: var(--kt-gray-500);
    font-size: 0.78rem;
}

/* ---- Responsive ---- */
@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-100%); }
    .app-sidebar.show { transform: translateX(0); }
    .sidebar-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 1035; display: none; }
    .sidebar-backdrop.show { display: block; }
    .app-main { margin-left: 0; }
    .btn-sidebar-toggle { display: inline-flex; }
}

/* ---- Dropdown ---- */
.dropdown-menu {
    border: 1px solid var(--kt-gray-200);
    border-radius: var(--kt-radius);
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
    padding: 0.4rem;
    font-size: 0.85rem;
}

.dropdown-item {
    border-radius: var(--kt-radius);
    padding: 0.45rem 0.8rem;
    font-weight: 500;
    color: var(--kt-gray-700);
}
.dropdown-item:hover { background: var(--kt-gray-100); color: var(--kt-gray-900); }
.dropdown-divider { border-color: var(--kt-gray-200); margin: 0.25rem 0; }

/* ---- Print ---- */
@media print {
    .app-sidebar, .app-header, .app-footer, .btn, form { display: none !important; }
    .app-main { margin-left: 0; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}
