/* ============================================================
   public/assets/css/admin.css
   Painel Kollob SaaS — Layout no padrão do tenant
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color:       #1E3A8A;
    --primary-hover-color: #1e40af;
    --bs-primary-rgb: 30, 58, 138;

    --sidebar-bg:    #11101d;
    --sidebar-hover: #1d1b31;
    --main-color:    #fff;
    --text-color:    #fff;
    --active-color:  var(--primary-color);

    --rosa:       var(--primary-color);
    --rosa-hover: var(--primary-hover-color);
    --rosa-soft:  rgba(var(--bs-primary-rgb), 0.08);
    --rosa-mid:   rgba(var(--bs-primary-rgb), 0.18);

    --cinza-bg:  #f8f9fc;
    --borda:     #e9ecef;
    --text-sec:  #6c757d;
    --radius:    10px;
    --radius-lg: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }

/* ==================== SIDEBAR ==================== */
.sidebar {
    position: fixed; top: 0; left: 0;
    height: 100%; width: 260px;
    background: var(--sidebar-bg);
    z-index: 100;
    transition: all 0.5s ease;
}
.sidebar.close { width: 78px; }

.sidebar .logo-details { height: 60px; width: 100%; display: flex; align-items: center; }
.sidebar .logo-details .logo_img_wrapper {
    height: 50px; min-width: 78px;
    display: flex; align-items: center; justify-content: center;
    line-height: 50px;
}
.sidebar .logo-details img {
    height: 40px; width: auto;
    object-fit: contain;
    border-radius: 5px;
    background: #fff;
    padding: 2px;
}
.sidebar .logo-details .logo_name {
    font-size: 18px; color: var(--main-color); font-weight: 600;
    transition: 0.3s ease; transition-delay: 0.1s;
    white-space: nowrap; overflow: hidden;
}
.sidebar.close .logo-details .logo_name {
    transition-delay: 0s; opacity: 0; pointer-events: none;
}

.sidebar .nav-links { height: 100%; padding: 30px 0 150px 0; overflow: auto; }
.sidebar.close .nav-links { overflow: visible; }
.sidebar .nav-links::-webkit-scrollbar { display: none; }
.sidebar .nav-links li { position: relative; list-style: none; transition: all 0.4s ease; }
.sidebar .nav-links li:hover { background: var(--sidebar-hover); }

.sidebar .nav-links li .iocn-link {
    display: flex; align-items: center; justify-content: space-between;
}
.sidebar.close .nav-links li .iocn-link { display: block; }

.sidebar .nav-links li i {
    height: 50px; min-width: 78px;
    text-align: center; line-height: 50px;
    color: var(--main-color); font-size: 20px;
    cursor: pointer; transition: all 0.3s ease;
}
.sidebar .nav-links li.showMenu i.arrow { transform: rotate(-180deg); }
.sidebar.close .nav-links i.arrow { display: none; }

.sidebar .nav-links li a { display: flex; align-items: center; text-decoration: none; }
.sidebar .nav-links li a .link_name {
    font-size: 16px; font-weight: 400; color: var(--text-color);
    transition: all 0.4s ease;
}
.sidebar.close .nav-links li a .link_name { opacity: 0; pointer-events: none; }
.sidebar .nav-links li a.active { background: var(--active-color); }
.sidebar .nav-links li a.active .link_name,
.sidebar .nav-links li a.active i { color: #fff; }

.sidebar .nav-links li .sub-menu {
    padding: 6px 6px 14px 80px;
    margin-top: -10px;
    background: var(--sidebar-hover);
    display: none;
}
.sidebar .nav-links li.showMenu .sub-menu { display: block; }
.sidebar .nav-links li .sub-menu a {
    color: var(--text-color); font-size: 15px;
    padding: 5px 0; white-space: nowrap;
    opacity: 0.6; transition: all 0.3s ease;
}
.sidebar .nav-links li .sub-menu a:hover,
.sidebar .nav-links li .sub-menu a.active { opacity: 1; }

.sidebar.close .nav-links li .sub-menu {
    position: absolute; left: 100%; top: -10px;
    margin-top: 0; padding: 10px 20px;
    border-radius: 0 6px 6px 0;
    opacity: 0; display: block; pointer-events: none;
    transition: 0s;
    background: var(--sidebar-hover);
}
.sidebar.close .nav-links li:hover .sub-menu {
    top: 0; opacity: 1; pointer-events: auto;
    transition: all 0.4s ease;
}
.sidebar .nav-links li .sub-menu .link_name { display: none; }
.sidebar.close .nav-links li .sub-menu .link_name {
    font-size: 18px; opacity: 1; display: block;
}
.sidebar .nav-links li .sub-menu.blank {
    opacity: 0; pointer-events: none;
    padding: 3px 20px 6px 16px;
}
.sidebar.close .nav-links li:hover .sub-menu.blank {
    top: 50%; transform: translateY(-50%);
    opacity: 1; pointer-events: auto;
}

.sidebar .profile-details {
    position: fixed; bottom: 0; width: 260px;
    display: flex; align-items: center; justify-content: space-between;
    background: var(--sidebar-hover);
    padding: 12px 0;
    transition: all 0.5s ease;
    white-space: nowrap;
}
.sidebar.close .profile-details { background: none; width: 78px; }
.sidebar .profile-details .profile-content { display: flex; align-items: center; }
.sidebar .profile-details img {
    height: 52px; width: 52px;
    object-fit: cover; border-radius: 16px;
    margin: 0 14px 0 12px;
    background: #FFF;
}
.sidebar.close .profile-details img { padding: 10px; }
.sidebar .profile-details .name-job {
    margin-left: 10px; overflow: hidden; max-width: 120px;
}
.sidebar .profile-details .profile_name,
.sidebar .profile-details .job {
    color: #fff; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar .profile-details .profile_name { font-size: 12px; }
.sidebar .profile-details .job { font-size: 11px; opacity: 0.8; }
.sidebar .profile-details a { margin-right: 15px; }
.sidebar .profile-details a i {
    font-size: 25px; color: #fff;
    min-width: 50px; text-align: center; line-height: 50px;
}
.sidebar.close .profile-details .profile_name,
.sidebar.close .profile-details .job,
.sidebar.close .profile-details a { display: none; }

/* ==================== HOME SECTION ==================== */
.home-section {
    position: relative;
    background: #E4E9F7;
    min-height: 100vh;
    left: 260px;
    width: calc(100% - 260px);
    transition: all 0.5s ease;
    padding: 20px;
}
.sidebar.close ~ .home-section {
    left: 78px;
    width: calc(100% - 78px);
}
.home-section .home-content {
    display: flex; align-items: center; flex-wrap: wrap;
    margin-bottom: 15px;
}
.home-section .home-content .bx-menu {
    color: #11101d; font-size: 35px; cursor: pointer;
    margin-right: 10px;
}
.home-section .home-content .text {
    font-size: 26px; font-weight: 600;
}
@media (max-width: 420px) {
    .sidebar.close .nav-links li .sub-menu { display: none; }
}

/* ==================== DESIGN SYSTEM ==================== */
.text-rosa { color: var(--rosa) !important; }
.bg-rosa   { background-color: var(--rosa) !important; }

.btn-rosa, .btn-primary-custom {
    background-color: var(--rosa); border-color: var(--rosa);
    color: #fff; font-weight: 600;
    transition: background .2s, transform .1s, box-shadow .2s;
}
.btn-rosa:hover, .btn-rosa:focus,
.btn-primary-custom:hover, .btn-primary-custom:focus {
    background-color: var(--rosa-hover); border-color: var(--rosa-hover);
    color: #fff; transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--bs-primary-rgb), .25);
}
.btn-outline-rosa {
    color: var(--rosa); border-color: var(--rosa);
    background: transparent; font-weight: 600;
}
.btn-outline-rosa:hover { background-color: var(--rosa); color: #fff; }

.page-header {
    background: linear-gradient(135deg, #fff 0%, rgba(var(--bs-primary-rgb), 0.06) 100%);
    border-left: 4px solid var(--rosa);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex; align-items: center; gap: 1rem;
    flex-wrap: wrap; justify-content: space-between;
}
.page-header-left { display: flex; align-items: center; gap: 1rem; }
.page-header h4 { font-weight: 700; color: #2d2d2d; margin: 0; }
.page-header small { color: var(--text-sec); display: block; margin-top: .15rem; }

.section-card {
    background: #fff;
    border: 1px solid var(--borda);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .05);
    margin-bottom: 1.25rem;
    overflow: hidden;
}
.section-card-header {
    padding: .9rem 1.4rem;
    background: var(--cinza-bg);
    border-bottom: 1px solid var(--borda);
    display: flex; align-items: center; gap: .6rem;
}
.section-card-body { padding: 1.4rem; }

.form-label {
    font-size: .78rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-sec); margin-bottom: .3rem;
}
.form-control, .form-select {
    border-radius: 8px; border: 1px solid #ced4da;
    font-size: .9rem; color: #2d2d2d;
    transition: border-color .2s, box-shadow .2s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--rosa);
    box-shadow: 0 0 0 .2rem var(--rosa-soft);
}
.form-text { font-size: .75rem; color: var(--text-sec); margin-top: .25rem; }

.status-badge {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .3rem .65rem; border-radius: 20px;
    font-size: .72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em;
}
.status-badge.ativo     { background: #e8f5e9; color: #2e7d32; }
.status-badge.bloqueado { background: #ffebee; color: #c62828; }
.status-badge.inativo   { background: #f1f5f9; color: #475569; }

.card {
    border: 1px solid var(--borda);
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    border-radius: var(--radius-lg);
}
.card-header {
    background: var(--cinza-bg);
    border-bottom: 1px solid var(--borda);
    font-weight: 600; padding: .9rem 1.2rem; font-size: .9rem;
}
.table thead th {
    background: var(--cinza-bg);
    font-size: .72rem; text-transform: uppercase;
    color: var(--text-sec); letter-spacing: .04em; font-weight: 700;
    border-bottom: 1px solid var(--borda);
}
.table td { vertical-align: middle; font-size: .9rem; }

code {
    background: var(--rosa-soft);
    padding: 2px 6px; border-radius: 4px;
    color: var(--rosa); font-size: 85%;
    font-family: 'Courier New', monospace;
}

/* Stat cards */
.stat-card {
    background: #fff; border-radius: var(--radius-lg);
    padding: 1.25rem; border: 1px solid var(--borda);
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    height: 100%; display: flex; flex-direction: column;
    transition: transform .15s, box-shadow .15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.stat-card .stat-icon {
    width: 44px; height: 44px;
    background: var(--rosa-soft); color: var(--rosa);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; margin-bottom: .75rem;
}
.stat-card .stat-label {
    font-size: .7rem; text-transform: uppercase;
    color: var(--text-sec); letter-spacing: .05em; font-weight: 600;
}
.stat-card .stat-value {
    font-size: 1.75rem; font-weight: 700; color: #111827;
    margin: .25rem 0; line-height: 1.1;
}
.stat-card .stat-value-sm { font-size: 1.05rem; }
.stat-card .stat-link {
    font-size: .75rem; color: var(--rosa);
    text-decoration: none; margin-top: auto; font-weight: 600;
}
.stat-card .stat-link:hover { text-decoration: underline; }

.matriz-templates th:not(:first-child):not(:nth-child(2)) { text-align: center; }
.matriz-templates td { vertical-align: middle; }

/* ==================== AUTH (LOGIN) ==================== */
.auth-body {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, #0f172a 100%);
}
.auth-container { width: 100%; max-width: 420px; padding: 20px; }
.auth-card {
    background: white; border-radius: 16px;
    padding: 40px 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo img { max-height: 60px; margin-bottom: 12px; }
.auth-logo h1 { font-size: 20px; font-weight: 600; color: #2c2f3a; margin: 0; }
.auth-footer {
    text-align: center; margin-top: 20px;
    padding-top: 20px; border-top: 1px solid #eee;
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); width: 260px !important; }
    .sidebar.mobile-open { transform: translateX(0); }
    .home-section { left: 0 !important; width: 100% !important; }
}