:root {
    --transition-speed: 0.3s;
}

[data-bs-theme="light"] {
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    --card-hover-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    --table-header-bg: #e9ecef;
}

[data-bs-theme="dark"] {
    --bg-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --card-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
    --card-hover-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    --table-header-bg: #2b3035;
}

html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin-bottom: 60px;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

.navbar {
    background: var(--bg-gradient) !important;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.15);
    transition: background var(--transition-speed);
    min-height: 56px;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: -0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

@media (min-width: 576px) {
    .navbar-brand {
        font-size: 1.3rem;
        max-width: none;
    }
}

.navbar .nav-link {
    position: relative;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.navbar .nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.navbar .nav-link i {
    margin-right: 6px;
    font-size: 1.05em;
}

@media (max-width: 767.98px) {
    .navbar-nav .nav-link {
        padding: 0.6rem 0.75rem;
        border-radius: 8px;
        margin: 2px 0;
    }

    .navbar-nav .nav-link i {
        width: 1.4em;
        text-align: center;
    }

    .navbar-collapse {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
}

.card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: all var(--transition-speed);
    background: var(--bs-body-bg);
}

.card:hover {
    box-shadow: var(--card-hover-shadow);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--bs-border-color);
    padding: 1rem 1.25rem;
}

.card-body {
    padding: 1.25rem;
}

@media (min-width: 768px) {
    .card-header {
        padding: 1.25rem 1.5rem;
    }

    .card-body {
        padding: 1.5rem;
    }
}

.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--bg-gradient);
    border: none;
}

.btn-primary:hover {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-outline-primary {
    border-color: #667eea;
    color: #667eea;
}

.btn-outline-primary:hover {
    background: var(--bg-gradient);
    border-color: transparent;
}

@media (max-width: 575.98px) {
    .btn {
        padding: 0.45rem 1rem;
        font-size: 0.9rem;
    }

    .btn-sm {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
}

.form-control, .form-select {
    border: 2px solid var(--bs-border-color);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    transition: all 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0;
}

@media (max-width: 575.98px) {
    .page-title {
        font-size: 1.25rem;
    }
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 0.75rem;
    flex-wrap: wrap;
}

@media (max-width: 575.98px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .page-header .btn {
        width: 100%;
    }
}

.table {
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0;
}

.table thead th {
    background: var(--table-header-bg);
    border-bottom: 2px solid var(--bs-border-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 0.75rem 0.5rem;
    white-space: nowrap;
}

.table tbody td {
    padding: 0.6rem 0.5rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

@media (max-width: 575.98px) {
    .table thead th {
        font-size: 0.65rem;
        padding: 0.5rem 0.3rem;
    }

    .table tbody td {
        padding: 0.4rem 0.3rem;
        font-size: 0.85rem;
    }
}

.badge {
    font-weight: 500;
    padding: 0.35em 0.6em;
    border-radius: 6px;
    font-size: 0.8em;
}

.alert {
    border: none;
    border-radius: 10px;
}

.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    line-height: 1.5;
    padding: 1rem 0;
    background: var(--bs-body-bg);
    transition: background var(--transition-speed);
    font-size: 0.85rem;
}

@media (min-width: 768px) {
    .footer {
        white-space: nowrap;
        line-height: 60px;
        padding: 0;
    }
}

#themeToggle {
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s;
    flex-shrink: 0;
}

#themeToggle:hover {
    transform: scale(1.1);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

@media (max-width: 575.98px) {
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .table-responsive {
        margin: 0 -12px;
        border: 0;
    }

    .table-responsive .table {
        margin-bottom: 0;
    }
}

.action-btns {
    display: flex;
    gap: 0.25rem;
    flex-wrap: nowrap;
}

.action-btns .btn {
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .action-btns .btn-sm {
        padding: 0.25rem 0.45rem;
        font-size: 0.75rem;
    }

    .action-btns .btn-sm i {
        font-size: 0.85rem;
    }
}

.tab-content .card {
    margin-bottom: 1rem;
}

@media (max-width: 575.98px) {
    .tab-content .card-body {
        padding: 0.75rem;
    }

    .tab-content .row.g-3 > [class*="col-"] {
        padding-bottom: 0.5rem;
    }
}

.form-check-label {
    cursor: pointer;
    font-size: 0.9rem;
}

@media (max-width: 575.98px) {
    .form-check-label {
        font-size: 0.85rem;
    }
}

.photo-preview {
    width: 150px;
    height: 150px;
    border: 3px dashed var(--bs-border-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    overflow: hidden;
    background: var(--bs-tertiary-bg);
}

.photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 9px;
}

.photo-img-lg {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--bs-border-color);
    flex-shrink: 0;
}

.photo-img-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--bs-border-color);
}

.photo-placeholder {
    font-size: 3.5rem;
    color: var(--bs-secondary-color);
    opacity: 0.5;
}

.photo-placeholder-sm {
    font-size: 1.8rem;
    color: var(--bs-secondary-color);
    opacity: 0.5;
}

.auth-body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: var(--bg-gradient);
    transition: background var(--transition-speed);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem 2.25rem;
    border-radius: 16px;
    box-shadow: var(--card-hover-shadow);
    background: var(--bs-body-bg);
    transition: background var(--transition-speed);
    animation: authFadeIn 0.4s ease;
}

@keyframes authFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-brand {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.8rem;
    color: #fff;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.auth-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.auth-subtitle {
    text-align: center;
    color: var(--bs-secondary-color);
    margin-bottom: 1.75rem;
    font-size: 0.9rem;
}

.auth-card .form-floating {
    position: relative;
}

.auth-card .form-floating .form-control {
    padding-right: 3rem;
}

.auth-card .auth-eye {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 3rem;
    border: none;
    background: transparent;
    color: var(--bs-secondary-color);
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 8px 8px 0;
}

.auth-card .auth-eye:hover {
    color: #667eea;
}

.auth-card .auth-eye:focus {
    outline: none;
    color: #667eea;
}

.auth-card .form-floating .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.auth-card .auth-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1.5rem;
    font-size: 0.88rem;
}

.auth-card .auth-links a {
    color: #667eea;
    text-decoration: none;
}

.auth-card .auth-links a:hover {
    text-decoration: underline;
}

.auth-card .btn-primary {
    padding: 0.7rem 1rem;
    font-size: 1rem;
}

@media (max-width: 575.98px) {
    .auth-card {
        padding: 1.75rem 1.25rem;
    }
}
