/* =============================================
   ComplianceOS - Professional Office Manager
   Site Stylesheet
   ============================================= */

/* ----- Base Typography & Reset ----- */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 15px;
    }
}

@media (min-width: 1200px) {
    html {
        font-size: 16px;
    }
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

a {
    color: #2c3e50;
    text-decoration: none;
}

a:hover {
    color: #3498db;
}

/* ----- Focus States ----- */
.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 #3498db;
}

/* ----- Sidebar ----- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100vh;
    background-color: #2c3e50;
    color: #ecf0f1;
    z-index: 1040;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    color: #ecf0f1;
    font-size: 1.25rem;
    font-weight: 700;
}

.sidebar-brand:hover {
    color: #fff;
}

.sidebar-brand .brand-text {
    white-space: nowrap;
}

.sidebar-nav {
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
}

.sidebar-nav-item {
    margin: 2px 0;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    padding: 0.65rem 1.25rem;
    color: rgba(236, 240, 241, 0.75);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav-link:hover,
.sidebar-nav-link.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.08);
    border-left-color: #3498db;
}

.sidebar-nav-link .nav-icon {
    margin-right: 0.75rem;
    flex-shrink: 0;
    opacity: 0.7;
}

.sidebar-nav-link:hover .nav-icon,
.sidebar-nav-link.active .nav-icon {
    opacity: 1;
}

.sidebar-nav-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 0.5rem 1rem;
}

/* ----- Sidebar Collapsible Groups ----- */
.sidebar-nav-group {
    margin: 2px 0;
}

.sidebar-group-toggle {
    display: flex;
    align-items: center;
    padding: 0.65rem 1.25rem;
    color: rgba(236, 240, 241, 0.75);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.sidebar-group-toggle:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-group-toggle .nav-icon {
    margin-right: 0.75rem;
    flex-shrink: 0;
    opacity: 0.7;
}

.sidebar-group-toggle:hover .nav-icon {
    opacity: 1;
}

.sidebar-chevron {
    font-size: 0.65rem;
    transition: transform 0.2s ease;
    opacity: 0.5;
}

.sidebar-group-toggle[aria-expanded="true"] .sidebar-chevron {
    transform: rotate(90deg);
}

.sidebar-subnav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-subnav .sidebar-nav-link {
    padding: 0.5rem 1.25rem 0.5rem 3rem;
    font-size: 0.85rem;
    font-weight: 400;
}

/* ----- Main Content ----- */
.main-content {
    margin-left: 250px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

.top-navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #e9ecef;
}

.content-area {
    flex: 1;
    padding: 1.5rem;
}

.content-footer {
    border-top: 1px solid #e9ecef;
    background-color: #fff;
}

/* ----- User Avatar ----- */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #3498db;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* ----- Sidebar Toggle & Overlay (Mobile) ----- */
.sidebar-toggle {
    border: none;
    padding: 0.25rem;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1035;
}

/* ----- Responsive Sidebar ----- */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }
}

/* ----- Login Page ----- */
.login-body {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #2c3e50 100%);
    min-height: 100vh;
}

.login-wrapper {
    min-height: 100vh;
}

.login-card {
    width: 100%;
    max-width: 440px;
    padding: 1rem;
}

.login-card .card {
    border-radius: 12px;
}

.login-card .form-control {
    padding: 0.625rem 0.75rem;
    border-radius: 6px;
}

.login-card .btn-primary {
    border-radius: 6px;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.login-card .input-group-text {
    border-radius: 6px 0 0 6px;
}

.login-card .input-group .form-control {
    border-radius: 0 6px 6px 0;
}

/* ----- Dashboard Cards ----- */
.dashboard-card {
    border-radius: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1) !important;
}

.card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

/* ----- Buttons ----- */
.btn-primary {
    background-color: #2c3e50;
    border-color: #2c3e50;
}

.btn-primary:hover {
    background-color: #34495e;
    border-color: #34495e;
}

.btn-primary:active,
.btn-primary:focus {
    background-color: #1a252f;
    border-color: #1a252f;
}

.btn-outline-primary {
    color: #2c3e50;
    border-color: #2c3e50;
}

.btn-outline-primary:hover {
    background-color: #2c3e50;
    border-color: #2c3e50;
    color: #fff;
}

/* ----- Badges ----- */
.badge.bg-primary {
    background-color: #3498db !important;
}

/* ----- Cards General ----- */
.card {
    border-radius: 10px;
}

.card-header {
    border-radius: 10px 10px 0 0;
}

/* ----- Scrollbar (for sidebar) ----- */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ----- Alert Enhancements ----- */
.alert {
    border-radius: 8px;
    border: none;
}

/* ----- Dropdown Enhancements ----- */
.dropdown-menu {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 0.5rem 0;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}
