/* ===============================
   RESET & BASE
================================ */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", Arial, sans-serif;
}

body {
    display: flex;
    flex-direction: column;
}

.container-fluid {
    flex: 1;
}

/* ===============================
   LOGIN
================================ */
.login-container {
    background-color: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    margin: 50px auto;
}

.login-container h2 {
    text-align: center;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.btn-login {
    background-color: #1abc9c;
    color: white;
    border: none;
    padding: 12px;
    width: 100%;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

.btn-login:hover {
    background-color: #16a085;
}

.error {
    color: red;
    margin-bottom: 10px;
    text-align: center;
}

/* ===============================
   LAYOUT PRINCIPAL
================================ */
.main-container {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 64px); /* topbar height */
}

.sidebar {
    width: 240px;
    background-color: #f5f8f8ec;
    color: black;
    transition: all 0.3s;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 1000;
    padding-top: 64px; /* topbar */
}

.sidebar .logo {
    text-align: center;
    margin: 20px 0;
}

.sidebar a {
    color: black;
    text-decoration: none;
    display: block;
    padding: 10px 15px;
    transition: all 0.2s;
}

.sidebar a:hover {
    background-color: #495057;
    color: white;
}

.content-wrapper {
    flex-grow: 1;
    margin-left: 240px;
    padding: 20px;
    background: #f8f9fa;
    transition: all 0.3s;
}

/* ===============================
   TOPBAR
================================ */
.app-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    z-index: 1100;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: .75rem;
}

/* ===============================
   FOOTER
================================ */
footer {
    background: #f1f1f1;
    padding: 10px 20px;
    text-align: center;
}

/* ===============================
   TABLES
================================ */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

/* ===============================
   CARDS
================================ */
.card {
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    background: #fff;
    padding: 15px;
}

/* ===============================
   SIDEBAR DROPDOWN
================================ */
.sidebar-link {
    display: flex;
    width: 100%;
    padding: 0.5rem 0.75rem;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.sidebar-link:hover {
    background: rgba(0,0,0,0.04);
}

.sidebar-dropdown-menu {
    padding-left: 0.5rem;
    margin: 0;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.32s cubic-bezier(.2,.8,.2,1), opacity 0.28s ease;
    opacity: 0;
}

.sidebar-dropdown-menu.open {
    max-height: 1000px;
    opacity: 1;
}

.sidebar-dropdown-menu li {
    list-style: none;
}

.sidebar-dropdown-menu .nav-link {
    display: block;
    padding: 0.45rem 0.75rem;
    font-size: 0.95rem;
}

.sidebar-dropdown-menu .nav-link:hover {
    background: rgba(0,0,0,0.03);
}

.sidebar-dropdown-menu .nav-link.active {
    background: rgba(13,110,253,0.08);
    color: #0d6efd;
    font-weight: 600;
}

/* ===============================
   RESPONSIVE
================================ */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1050;
    }
    .sidebar.sidebar-open {
        transform: translateX(0);
    }
    .content-wrapper {
        margin-left: 0;
        padding: 80px 15px 20px 15px;
    }
}

@media (max-width: 576px) {
    h1,h2,h3,h4 {
        font-size: 16px;
    }
    .card {
        padding: 10px;
    }
    .btn, .btn-login {
        font-size: 14px;
        padding: 8px;
    }
    .login-container {
        padding: 25px;
        margin: 30px 10px;
    }
}