:root {
    --primary-color: #4e73df;
    --secondary-color: #858796;
    --success-color: #1cc88a;
    --info-color: #36b9cc;
    --warning-color: #f6c23e;
    --danger-color: #e74a3b;
    --dark-bg: #f8f9fc;
    --sidebar-bg: #4e73df;
    --sidebar-text: #fff;
    --card-shadow: 0 .15rem 1.75rem 0 rgba(58, 59, 69, .15);
}

body {
    font-family: 'Outfit', sans-serif;
    /* Modern font */
    background-color: var(--dark-bg);
    margin: 0;
    overflow-x: hidden;
}

/* Sidebar */
#wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    transition: all 0.3s;
}

#sidebar {
    min-width: 250px;
    max-width: 250px;
    background: linear-gradient(180deg, #4e73df 10%, #224abe 100%);
    color: #fff;
    transition: all 0.3s;
    min-height: 100vh;
}

#sidebar.active {
    margin-left: -250px;
}

#sidebar .sidebar-header {
    padding: 20px;
    background: rgba(0, 0, 0, 0.1);
    text-align: center;
    font-weight: bold;
    font-size: 1.2rem;
}

#sidebar ul.components {
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#sidebar ul p {
    color: #fff;
    padding: 10px;
}

#sidebar ul li a {
    padding: 15px 20px;
    font-size: 1.1em;
    display: block;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s;
}

#sidebar ul li a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    padding-left: 25px;
    /* Micro interaction */
}

#sidebar ul li.active>a {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

/* Content */
#content {
    width: 100%;
    padding: 20px;
    min-height: 100vh;
    transition: all 0.3s;
}

/* Navbar */
.navbar-custom {
    padding: 15px 10px;
    background: #fff;
    border: none;
    border-radius: 0;
    margin-bottom: 20px;
    box-shadow: 0 .15rem 1.75rem 0 rgba(58, 59, 69, .15);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-hamburger {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
}

/* Cards */
.card-modern {
    border: none;
    border-radius: 1rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s;
}

.card-modern:hover {
    transform: translateY(-5px);
}

.card-header-modern {
    background-color: #fff;
    border-bottom: 1px solid #e3e6f0;
    padding: 1rem 1.25rem;
    border-top-left-radius: 1rem !important;
    border-top-right-radius: 1rem !important;
    font-weight: bold;
    color: var(--primary-color);
}

/* Picture Box */
.picture-box-container {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    overflow: hidden;
    position: relative;
    margin: 0 auto;
    background-color: #eee;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.picture-box-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.picture-box-container input[type="file"] {
    display: none;
}

.picture-box-overlay {
    position: absolute;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    width: 100%;
    text-align: center;
    font-size: 0.8rem;
    padding: 5px 0;
    opacity: 0;
    transition: opacity 0.2s;
}

.picture-box-container:hover .picture-box-overlay {
    opacity: 1;
}

/* Password Strength */
.password-strength-meter {
    height: 5px;
    background-color: #eee;
    margin-top: 5px;
    border-radius: 3px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    width: 0;
    transition: width 0.3s, background-color 0.3s;
}

/* Login Page */
.login-bg {
    background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    border-radius: 1rem;
    border: none;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    overflow: hidden;
    max-width: 400px;
    width: 100%;
}

.login-body {
    padding: 3rem;
    background: white;
}

/* Responsive */
@media (max-width: 768px) {
    #sidebar {
        margin-left: -250px;
    }

    #sidebar.active {
        margin-left: 0;
    }

    .login-card {
        margin: 20px;
    }
}

/* Response Table to Cards */
@media (max-width: 768px) {

    .table-responsive table,
    .table-responsive thead,
    .table-responsive tbody,
    .table-responsive th,
    .table-responsive td,
    .table-responsive tr {
        display: block;
    }

    .table-responsive thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .table-responsive tr {
        border: 1px solid #ccc;
        margin-bottom: 1rem;
        border-radius: 0.5rem;
        background: #fff;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }

    .table-responsive td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50% !important;
        text-align: right;
        min-height: 40px;
        display: flex;
        justify-content: flex-end;
        align-items: center;
    }

    .table-responsive td:before {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        left: 15px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
        text-align: left;
        color: var(--primary-color);
        content: attr(data-label);
    }

    .table-responsive td:last-child {
        border-bottom: 0;
        justify-content: center;
        padding-left: 15px !important;
    }

    .table-responsive td:last-child:before {
        display: none;
    }

    /* Special handling for Photo in card view to center it or make it look nice */
    .table-responsive td[data-label="Foto"] {
        justify-content: center;
        padding-left: 15px !important;
        padding-top: 15px !important;
        padding-bottom: 15px !important;
        background-color: #f8f9fc;
        border-top-left-radius: 0.5rem;
        border-top-right-radius: 0.5rem;
    }

    .table-responsive td[data-label="Foto"]:before {
        display: none;
    }
}

/* iOS Toggle Switch Style */
.ios-switch-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    user-select: none;
}

.ios-switch {
    position: relative;
    display: inline-block;
    width: 54px;
    height: 30px;
    flex-shrink: 0;
}

.ios-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ios-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e9e9ea;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 30px;
    border: 1.5px solid #d1d1d6;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.ios-slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 2px;
    bottom: 1.5px;
    background-color: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ios-switch input:checked + .ios-slider {
    background-color: #34c759;
    border-color: #34c759;
}

.ios-switch input:checked + .ios-slider:before {
    transform: translateX(24px);
}

.ios-switch input:focus + .ios-slider {
    box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.25);
}

/* Universal iOS Switch Styling for Bootstrap form-switch */
.form-switch {
    padding-left: 0 !important;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.form-switch .form-check-input {
    width: 52px !important;
    height: 30px !important;
    margin-left: 0 !important;
    background-color: #e9e9ea !important;
    border: 1.5px solid #d1d1d6 !important;
    border-radius: 30px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer;
    background-image: none !important;
    position: relative;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    flex-shrink: 0;
}

.form-switch .form-check-input:before {
    content: "";
    position: absolute;
    top: 1.5px;
    left: 2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #ffffff;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-switch .form-check-input:checked {
    background-color: #34c759 !important;
    border-color: #34c759 !important;
}

.form-switch .form-check-input:checked:before {
    transform: translateX(22px);
}

.form-switch .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.25) !important;
    border-color: #34c759 !important;
}

.form-switch .form-check-label {
    cursor: pointer;
    user-select: none;
    font-weight: 500;
}
