@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #1A365D; /* Royal corporate blue */
    --primary-hover: #2B6CB0;
    --primary-light: #EBF8FF;
    --primary-gradient: linear-gradient(135deg, #1A365D, #2B6CB0);
    --bg: #F7FAFC;
    --card-bg: #FFFFFF;
    --sidebar-bg: #FFFFFF;
    --text: #2D3748;
    --text-muted: #718096;
    --border: #E2E8F0;
    --success: #2F855A; /* Green from logo */
    --success-light: #C6F6D5;
    --warning: #C05621; /* Orange from logo */
    --warning-light: #FEEBC8;
    --danger: #9B2C2C; /* Red from logo */
    --danger-light: #FED7D7;
    --info: #2B6CB0; /* Blue from logo */
    --info-light: #EBF8FF;
    --radius: 12px;
    --radius-lg: 20px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.03);
    --sidebar-width: 260px;
    --header-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    background-color: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
    height: auto;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--border);
    gap: 0.5rem;
}

.sidebar-brand img {
    height: 100px !important;
    width: auto;
    object-fit: contain;
    border-radius: 8px;
}

.sidebar-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    letter-spacing: -0.025em;
}

.sidebar-title span {
    color: var(--primary);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1rem;
}

.nav-group-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin: 1.5rem 0.5rem 0.5rem;
}

.nav-group-title:first-child {
    margin-top: 0;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.nav-link svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--primary);
    background-color: var(--primary-light);
}

.nav-link.active {
    color: white;
    background: var(--primary-gradient);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.nav-link.active svg {
    color: white;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.95rem;
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
}

.user-info {
    flex: 1;
    overflow: hidden;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-btn {
    color: var(--text-muted);
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.logout-btn:hover {
    color: var(--primary);
    background-color: var(--primary-light);
}

/* Main Content Wrapper */
.main-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
}

/* Header */
.header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 90;
}

.header-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    width: 320px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.header-search:focus-within {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.header-search input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 0.875rem;
    color: var(--text);
}

.header-search svg {
    color: var(--text-muted);
    width: 18px;
    height: 18px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

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

.icon-btn-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
}

/* Page Content */
.content {
    flex: 1;
    padding: 2rem;
}

/* Breadcrumbs */
.breadcrumb-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.025em;
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    list-style: none;
}

.breadcrumb-item {
    color: var(--text-muted);
}

.breadcrumb-item a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-item a:hover {
    color: var(--primary);
}

.breadcrumb-separator {
    color: var(--text-muted);
}

/* UI Elements */

/* Responsive Grid Helpers */
.grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.grid-details {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.grid-filters {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto;
    gap: 0.75rem;
    align-items: end;
}

@media (max-width: 1024px) {
    .grid-filters {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .grid-2col, .grid-details {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .grid-filters {
        grid-template-columns: 1fr;
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    border: 1px solid rgba(26, 54, 93, 0.1);
}

.btn-primary:hover {
    box-shadow: 0 4px 14px rgba(43, 108, 176, 0.35);
    filter: brightness(1.05);
}

.btn-secondary {
    background: white;
    border-color: var(--border);
    color: var(--text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background: var(--bg);
    border-color: #D1D5DB;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
    color: var(--primary);
}

.btn-danger {
    background: linear-gradient(135deg, #F87171 0%, #EF4444 100%);
    color: white;
}

.btn-danger:hover {
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
    filter: brightness(1.05);
}

.btn-success {
    background: linear-gradient(135deg, #34D399 0%, #059669 100%);
    color: white;
}

.btn-success:hover {
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.3);
    filter: brightness(1.05);
}

/* Card */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(229, 231, 235, 0.5);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(229, 231, 235, 0.5);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.primary {
    background: var(--primary-light);
    color: var(--primary);
}

.stat-icon.success {
    background: var(--success-light);
    color: var(--success);
}

.stat-icon.warning {
    background: var(--warning-light);
    color: var(--warning);
}

.stat-icon.info {
    background: var(--info-light);
    color: var(--info);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Dashboard Columns */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* List/Activity styles */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.activity-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
}

.activity-details {
    flex: 1;
}

.activity-text {
    font-size: 0.875rem;
    color: var(--text);
}

.activity-text strong {
    font-weight: 600;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Meeting List */
.meeting-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.meeting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
}

.meeting-info {
    flex: 1;
}

.meeting-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

.meeting-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.meeting-platform {
    font-size: 0.75rem;
    font-weight: 600;
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
}

.badge-success {
    background-color: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background-color: var(--warning-light);
    color: var(--warning);
}

.badge-danger {
    background-color: var(--danger-light);
    color: var(--danger);
}

.badge-info {
    background-color: var(--info-light);
    color: var(--info);
}

/* Login Page specific styles */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 10% 20%, rgba(220, 38, 38, 0.05) 0%, rgba(255, 255, 255, 1) 90%);
    padding: 1.5rem;
}

.auth-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 440px;
    padding: 2.5rem;
    transition: all 0.3s;
}

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

.auth-logo {
    display: inline-flex;
    width: 48px;
    height: 48px;
    background: var(--primary-gradient);
    border-radius: 12px;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--text);
}

.auth-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    outline: none;
    background: white;
    transition: all 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    cursor: pointer;
}

.checkbox-label input {
    border-radius: 4px;
    border-color: var(--border);
    accent-color: var(--primary);
}

.auth-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Alert styles */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-danger {
    background-color: var(--danger-light);
    color: var(--danger);
    border-color: rgba(220, 38, 38, 0.1);
}

.alert-success {
    background-color: var(--success-light);
    color: var(--success);
    border-color: rgba(5, 150, 105, 0.1);
}

.alert-warning {
    background-color: var(--warning-light);
    color: var(--warning);
    border-color: rgba(217, 119, 6, 0.1);
}

/* Responsive Layout utilities */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: var(--radius);
}

.table-responsive table {
    min-width: 650px; /* Force scrollbar on small screens */
}

/* Sidebar Backdrop Overlay on Mobile */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    z-index: 99;
}

.sidebar-backdrop.active {
    display: block;
}

/* Mobile burger button styling */
.header-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 0.5rem;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.header-toggle:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

/* Tab responsive wrapping */
.profile-tab-wrapper {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
    gap: 1.5rem;
    scrollbar-width: none; /* Hide scrollbars */
}

.profile-tab-wrapper::-webkit-scrollbar {
    display: none;
}

.profile-tab {
    white-space: nowrap;
}

/* Mobile responsiveness media overrides */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.15);
    }
    
    .main-wrapper {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .header {
        padding: 0 1.25rem;
    }
    
    .header-search {
        display: none; /* Hide search bar from header on mobile */
    }
    
    .header-toggle {
        display: flex;
        margin-right: 0.5rem;
    }
    
    .content {
        padding: 1.25rem 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .breadcrumb-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }
    
    .breadcrumb-container .btn {
        width: 100%;
        justify-content: center;
    }
    
    .breadcrumbs {
        display: none; /* Hide breadcrumbs on mobile to save vertical space */
    }
    
    .card {
        padding: 1.25rem 1rem;
        margin-bottom: 1rem;
    }
    
    .dashboard-grid {
        gap: 1rem;
    }
    
    .page-title {
        font-size: 1.35rem;
    }
}

.attendance-grid {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.breadcrumb-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.table-responsive th, 
.table-responsive td {
    white-space: nowrap;
}

@media (max-width: 1024px) {
    .attendance-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .attendance-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .stat-card {
        padding: 1rem;
        gap: 1rem;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }

    .breadcrumb-actions {
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
    }

    .breadcrumb-actions .btn {
        width: 100%;
        justify-content: center;
    }
}
