/* ==========================================================================
   Coopanest Contabil - Admin template
   ========================================================================== */

:root {
    --sidebar-width: 250px;
    --sidebar-bg: #1f2a3a;
    --sidebar-bg-hover: #2a3a52;
    --sidebar-color: #c3ccd9;
    --sidebar-active: #ffffff;
    --sidebar-active-bg: #16a085;
    --topbar-bg: #ffffff;
    --accent: #16a085;
    --accent-dark: #12745f;
    --border-color: #dee2e6;
    --content-bg: #f4f6f9;
}

html, body {
    height: 100%;
    margin: 0;
}

body {
    font-family: "Segoe UI", "Open Sans", Arial, sans-serif;
    background-color: var(--content-bg);
}

/* ======================= Wrapper ======================= */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* ======================= Sidebar ======================= */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-color);
    display: flex;
    flex-direction: column;
    z-index: 1030;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 18px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo {
    height: 40px;
    width: auto;
}

.sidebar-title {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.sidebar-nav {
    list-style: none;
    margin: 0;
    padding: 10px 0;
    flex: 1;
}

.nav-section {
    padding: 14px 18px 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #7487a3;
    font-weight: 600;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 18px;
    color: var(--sidebar-color);
    text-decoration: none;
    font-size: 14px;
    border-left: 3px solid transparent;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-nav .nav-link:hover {
    background: var(--sidebar-bg-hover);
    color: #ffffff;
}

.sidebar-nav .nav-link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active);
    border-left-color: #0e5f50;
}

.sidebar-nav .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 15px;
}

/* ======================= Content wrapper ======================= */
.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
}

/* ======================= Topbar ======================= */
.topbar {
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.topbar-toggle {
    border: 0;
    background: transparent;
    font-size: 20px;
    color: #495057;
    cursor: pointer;
    padding: 4px 8px;
}

.topbar-title {
    font-size: 17px;
    font-weight: 700;
    color: #212529;
    margin: 0;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-name {
    font-size: 13px;
    color: #495057;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ======================= Main content ======================= */
.main-content {
    flex: 1;
    padding: 24px;
    background: var(--content-bg);
}

.main-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    background: #ffffff;
    font-size: 12px;
    color: #6c757d;
    text-align: center;
}

/* ======================= Tables (Agenda) ======================= */
#table_cabecalho {
    border: 1px solid rgb(132, 20, 20);
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

#sem_esq {
    border-left: 0;
    border-right: 0 solid black;
    border-bottom: 0 solid black;
    border-top: 0 solid rgb(231, 221, 221);
}

.table > :not(caption) > * > * {
    padding: 0.5rem 0.6rem;
}

.td-empty {
    background-color: #fbfbfb;
}

/* ======================= Cards ======================= */
.card-coopanest {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 20px;
    margin-bottom: 20px;
}

.dashboard-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 22px;
    text-align: center;
    color: #fff;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.15s ease;
}

.dashboard-card:hover {
    transform: translateY(-3px);
    color: #fff;
    text-decoration: none;
}

.dashboard-card i {
    font-size: 30px;
    margin-bottom: 8px;
}

.dashboard-card .dc-title {
    font-size: 15px;
    font-weight: 600;
}

.dashboard-card .dc-count {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.1;
}

.dashboard-card .dc-value {
    font-size: 13px;
    opacity: 0.95;
}

.card-green { background: #16a085; }
.card-blue  { background: #2b6cb0; }
.card-teal  { background: #00897b; }
.card-red   { background: #b02a37; }
.card-yellow { background: #e6a400; }

/* ======================= Login ======================= */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1f2a3a 0%, #2a3a52 100%);
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    padding: 36px 32px;
}

.login-logo {
    text-align: center;
    margin-bottom: 20px;
}

.login-logo img {
    max-width: 220px;
}

.login-box h4 {
    margin-bottom: 18px;
    font-weight: 600;
}

.login-box .form-control {
    border-radius: 4px;
}

.login-box .btn-primary {
    background: var(--accent);
    border-color: var(--accent);
}

.login-box .btn-primary:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}

/* ======================= Responsive ======================= */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .content-wrapper {
        margin-left: 0;
    }

    .wrapper.sidebar-open .sidebar {
        transform: translateX(0);
    }
}

/* Spinner used while loading partials */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

#page-loader.active {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Validation */
.field-validation-error {
    color: #dc3545;
    font-size: 12px;
}

.input-validation-error {
    border-color: #dc3545 !important;
}
