/* ================================================
   TaskManager - Pampa Software
   Custom CSS
   ================================================ */

:root {
    --accent:       #4c0e90;
    --accent-light: #7b2fbe;
    --green:        #62ab79;
    --green-dark:   #3f7959;
    --ink:          #132238;
    --muted:        #637488;
    --border:       rgba(19, 34, 56, 0.1);
    --sidebar-bg:   linear-gradient(160deg, #4a114b 0%, #160e90 100%);
    --sidebar-w:    256px;
    --nav-h:        60px;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; }

body {
    background: #f4f6fb;
    color: var(--ink);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ================================================
   NAVBAR
   ================================================ */
.navbar-pampa {
    display: flex;
    align-items: stretch;
    height: var(--nav-h);
    z-index: 1050;
    padding: 0;
}

.navbar-brand-wrapper {
    width: var(--sidebar-w);
    background: #48154f;
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    gap: .75rem;
    border-right: 1px solid rgba(255,255,255,.1);
    flex-shrink: 0;
}

.navbar-brand {
    text-decoration: none;
    color: #fff;
    font-size: 1.15rem;
    letter-spacing: -.02em;
    white-space: nowrap;
    overflow: hidden;
}

.brand-text strong { font-weight: 800; }

.sidebar-toggle {
    background: rgba(255,255,255,.1);
    border: none;
    color: #fff;
    border-radius: 10px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s;
    flex-shrink: 0;
}

.sidebar-toggle:hover { background: rgba(255,255,255,.2); }

.navbar-menu-wrapper {
    flex: 1;
    background: rgba(255,255,255,.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,.7);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    box-shadow: 0 2px 16px rgba(19,34,56,.06);
}

.sidebar-desktop-toggle {
    border-color: transparent;
    background: rgba(19,34,56,.05);
    color: var(--ink);
    border-radius: 10px;
    margin-right: .75rem;
}

.sidebar-desktop-toggle:hover { background: rgba(76,14,144,.08); color: var(--accent); }

/* ================================================
   LAYOUT
   ================================================ */
.wrapper {
    display: flex;
    min-height: calc(100vh - var(--nav-h));
    margin-top: var(--nav-h);
}

/* ================================================
   SIDEBAR
   ================================================ */
.sidebar {
    width: var(--sidebar-w);
    min-height: calc(100vh - var(--nav-h));
    background: var(--sidebar-bg);
    position: fixed;
    top: var(--nav-h);
    left: 0;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform .25s ease;
    border-right: 1px solid rgba(255,255,255,.08);
}

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

.sidebar-nav {
    list-style: none;
    padding: 1rem .75rem;
    margin: 0;
}

.sidebar-item { margin-bottom: .25rem; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem .9rem;
    border-radius: 14px;
    color: rgba(255,248,239,.75);
    text-decoration: none;
    font-size: .9rem;
    transition: background .15s, color .15s;
}

.sidebar-link:hover,
.sidebar-item.active .sidebar-link {
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    color: #fff;
    box-shadow: 0 8px 20px rgba(63,121,89,.25);
}

.sidebar-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255,255,255,.12);
    flex-shrink: 0;
    font-size: .85rem;
}

.sidebar-item.active .sidebar-icon,
.sidebar-link:hover .sidebar-icon {
    background: rgba(255,255,255,.2);
}

/* ================================================
   MAIN CONTENT
   ================================================ */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.content-wrapper {
    flex: 1;
    padding: 1.75rem;
}

/* ================================================
   PAGE HEADER
   ================================================ */
.page-header { }

.page-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -.02em;
}

/* ================================================
   STAT CARDS
   ================================================ */
.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 12px rgba(19,34,56,.06);
    transition: box-shadow .2s, transform .2s;
}

.stat-card:hover {
    box-shadow: 0 8px 24px rgba(19,34,56,.1);
    transform: translateY(-2px);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--ink);
    line-height: 1.1;
}

.stat-value small {
    font-size: .9rem;
    font-weight: 500;
    color: var(--muted);
}

.stat-label {
    font-size: .78rem;
    color: var(--muted);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 600;
}

/* ================================================
   CARDS
   ================================================ */
.card {
    border-radius: 16px;
}

.card-header {
    border-radius: 16px 16px 0 0 !important;
}

/* ================================================
   TABLES
   ================================================ */
.table thead th {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    padding-top: .85rem;
    padding-bottom: .85rem;
    border-bottom-width: 1px;
}

.table tbody tr { transition: background .1s; }

.table-hover > tbody > tr:hover > td { background: rgba(76,14,144,.04); }

/* ================================================
   BUTTONS
   ================================================ */
.btn-primary {
    background: linear-gradient(135deg, var(--accent), #6a1fce);
    border: none;
}

.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(135deg, #6a1fce, var(--accent));
    border: none;
}

.btn-success { background-color: var(--green); border-color: var(--green); }
.btn-success:hover { background-color: var(--green-dark); border-color: var(--green-dark); }

/* ================================================
   AVATAR circle for user list
   ================================================ */
.avatar-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ================================================
   FOOTER
   ================================================ */
.footer { padding: 1rem 1.75rem 1.25rem; }

.shell-footer-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .9rem 1.25rem;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.8);
    background: rgba(255,255,255,.7);
    color: var(--muted);
    font-size: .82rem;
    box-shadow: 0 4px 14px rgba(19,34,56,.05);
}

.shell-footer-card strong { color: var(--ink); }

/* ================================================
   DATATABLES OVERRIDES
   ================================================ */
div.dataTables_wrapper div.dataTables_filter input {
    border-radius: 999px;
    border: 1px solid #dee2e6;
    padding: .35rem .85rem;
    font-size: .85rem;
}

div.dataTables_wrapper div.dataTables_length select {
    border-radius: 8px;
    font-size: .85rem;
    padding: .3rem .6rem;
}

div.dataTables_info, div.dataTables_length, div.dataTables_filter {
    font-size: .8rem;
    color: var(--muted);
    padding: .75rem 1rem;
}

.dataTables_wrapper .dataTables_paginate {
    padding: .5rem 1rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 8px !important;
    font-size: .82rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(calc(-1 * var(--sidebar-w)));
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 6px 0 24px rgba(0,0,0,.25);
    }

    .main-content { margin-left: 0; }

    .navbar-brand-wrapper {
        width: auto;
        min-width: 60px;
    }
}

@media (max-width: 575.98px) {
    .content-wrapper { padding: 1rem; }
    .stat-value { font-size: 1.3rem; }
}
