/* Enterprise SaaS Layout - SecureAI Audit */

/* ===== AUTH LAYOUT STYLES ===== */
.auth-body {
    height: 100vh;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
}

.auth-logo i {
    font-size: 2rem;
}

.auth-main {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    padding: 2rem;
    margin-bottom: 1rem;
}

.auth-content {
    min-height: 300px;
}

.auth-footer {
    text-align: center;
    margin-top: 1rem;
}

.auth-footer small {
    color: rgba(255, 255, 255, 0.8);
}

/* Login Form Specific Styles */
.login-form {
    width: 100%;
}

.login-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-header h4 {
    color: var(--text-primary);
    font-weight: 600;
    margin: 0;
}

.login-body {
    width: 100%;
}

.login-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.login-footer small {
    color: var(--text-secondary);
}

/* ===== ROOT VARIABLES ===== */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
    
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --top-nav-height: 64px;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --transition-base: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== BASE LAYOUT ===== */
* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
}

.app-container {
    height: 100vh;
    overflow: hidden;
}

.app-wrapper {
    display: flex;
    height: calc(100vh - var(--top-nav-height));
    margin-top: var(--top-nav-height);
}

/* ===== TOP NAVIGATION ===== */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--top-nav-height);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.top-nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition-base);
}

.sidebar-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
}

.brand-icon {
    font-size: 20px;
    color: var(--primary-color);
}

.brand-name {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.top-nav-center {
    flex: 1;
    max-width: 600px;
    margin: 0 32px;
}

.search-container {
    position: relative;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-tertiary);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    font-size: 14px;
    transition: var(--transition-base);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
    background: var(--bg-primary);
}

.search-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-tertiary);
    transition: var(--transition-base);
}

.search-clear:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.top-nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-item {
    position: relative;
}

.nav-btn {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition-base);
    position: relative;
}

.nav-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--danger-color);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 4px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition-base);
}

.user-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.user-name {
    font-weight: 500;
    color: var(--text-primary);
}

.user-dropdown-arrow {
    font-size: 12px;
    color: var(--text-tertiary);
    transition: var(--transition-base);
}

.user-btn:hover .user-dropdown-arrow {
    color: var(--primary-color);
}

/* ===== DROPDOWNS ===== */
.notifications-dropdown,
.user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    min-width: 320px;
    max-height: 480px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: var(--transition-base);
}

.notifications-dropdown.show,
.user-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notifications-header,
.user-menu-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notifications-header h6,
.user-menu-header .user-full-name {
    margin: 0;
    font-weight: 600;
    font-size: 14px;
}

.notifications-list {
    max-height: 300px;
    overflow-y: auto;
}

.notification-item {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    transition: var(--transition-base);
}

.notification-item:hover {
    background: var(--bg-secondary);
}

.notification-item.unread {
    background: var(--bg-secondary);
    border-left: 3px solid var(--primary-color);
}

.notification-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-link {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.notification-title {
    margin: 0 0 4px 0;
    font-weight: 500;
    font-size: 13px;
    color: var(--text-primary);
}

.notification-text {
    margin: 0 0 4px 0;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.notification-time {
    font-size: 11px;
    color: var(--text-tertiary);
}

.notifications-footer {
    padding: 12px;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-large {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.user-details {
    flex: 1;
}

.user-email {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.user-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

.user-menu-items {
    padding: 8px 0;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition-base);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 14px;
}

.user-menu-item:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

.user-menu-item.logout-btn:hover {
    background: #fef2f2;
    color: var(--danger-color);
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    position: fixed;
    left: 0;
    top: var(--top-nav-height);
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    transition: var(--transition-base);
    z-index: 999;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin-bottom: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-base);
    border-radius: 0;
    position: relative;
}

.nav-link:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--primary-color);
    color: white;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-light);
}

.nav-icon {
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.nav-text {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    transition: var(--transition-base);
}

.sidebar.collapsed .nav-text {
    opacity: 0;
    visibility: hidden;
}

.nav-group {
    margin-bottom: 24px;
}

.nav-group-header {
    padding: 8px 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
}

.sidebar.collapsed .nav-group-header {
    opacity: 0;
    visibility: hidden;
}

.nav-group-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.sidebar-version {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-version span:first-child {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.version-number {
    font-size: 10px;
    color: var(--text-tertiary);
}

.sidebar.collapsed .sidebar-footer {
    opacity: 0;
    visibility: hidden;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px;
    overflow-y: auto;
    transition: var(--transition-base);
}

.sidebar.collapsed + .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

.page-content {
    min-height: calc(100vh - var(--top-nav-height) - 120px);
}

/* ===== CARD STYLING ===== */
.card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition-base);
}

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

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.card-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 4px 0 0 0;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

/* ===== BUTTON STYLING ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-base);
    background: var(--bg-primary);
    color: var(--text-primary);
}

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

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

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

.btn-secondary {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

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

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .top-nav {
        padding: 0 16px;
    }
    
    .top-nav-center {
        display: none;
    }
    
    .sidebar {
        transform: translateX(-100%);
        z-index: 1001;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 16px;
    }
    
    .notifications-dropdown,
    .user-menu {
        right: -16px;
        left: 16px;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .top-nav {
        padding: 0 12px;
    }
    
    .main-content {
        padding: 12px;
    }
    
    .brand-name {
        display: none;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles */
.nav-link:focus,
.btn:focus,
.search-input:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --text-primary: #000000;
        --text-secondary: #000000;
        --bg-primary: #ffffff;
        --bg-secondary: #ffffff;
    }
}
