/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}

.page-header h1 {
    margin: 0;
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.page-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark-color: #1e293b;
    --light-color: #f1f5f9;
    --sidebar-width: 260px;
    --topbar-height: 60px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #334155;
    background-color: #f8fafc;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    color: #1d4ed8;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.login-header {
    background: var(--dark-color);
    color: white;
    padding: 30px;
    text-align: center;
}

.login-header .logo {
    margin: 0 auto 16px;
    text-align: center;
}

.login-header h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.login-header p {
    font-size: 14px;
    opacity: 0.8;
}

.login-form {
    padding: 30px;
}

.login-footer {
    background: #f8fafc;
    padding: 15px;
    text-align: center;
    font-size: 12px;
    color: #64748b;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-color);
}

.form-group label i {
    margin-right: 5px;
    color: var(--primary-color);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group .checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.form-group .checkbox input {
    width: auto;
    margin-right: 8px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    margin-bottom: 10px;
}

.btn i {
    margin-right: 5px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
    color: white;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Main Layout */
.wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--dark-color);
    color: white;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    font-size: 20px;
    font-weight: 600;
}

.sidebar-header .logo i {
    margin-right: 10px;
    font-size: 24px;
    color: var(--primary-color);
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
}

.sidebar-menu li {
    margin: 2px 0;
}

.sidebar-menu li.menu-header {
    padding: 15px 20px 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
    font-weight: 600;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #cbd5e1;
    transition: all 0.3s;
}

.sidebar-menu li a i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

.sidebar-menu li a:hover,
.sidebar-menu li.active a {
    background: rgba(37, 99, 235, 0.1);
    color: white;
    border-left: 3px solid var(--primary-color);
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
}

.user-info i {
    font-size: 40px;
    margin-right: 12px;
    color: var(--primary-color);
}

.user-info strong {
    display: block;
    font-size: 14px;
}

.user-info small {
    display: block;
    font-size: 12px;
    color: #94a3b8;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.top-bar {
    height: var(--topbar-height);
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 999;
}

.top-bar-left {
    display: flex;
    align-items: center;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    margin-right: 20px;
    color: var(--dark-color);
}

.top-bar h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--dark-color);
}

.user-menu {
    position: relative;
}

.user-menu-toggle {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.user-menu-toggle:hover {
    background: var(--light-color);
}

.user-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    display: none;
}

.user-menu:hover .user-menu-dropdown {
    display: block;
}

.user-menu-dropdown a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--dark-color);
    transition: background 0.3s;
}

.user-menu-dropdown a i {
    margin-right: 10px;
    width: 20px;
}

.user-menu-dropdown a:hover {
    background: var(--light-color);
}

.user-menu-dropdown .divider {
    height: 1px;
    background: #e2e8f0;
    margin: 5px 0;
}

.page-content {
    padding: 30px;
}

/* Flash Messages */
.flash-messages {
    padding: 20px 30px 0;
}

.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    position: relative;
}

.alert i {
    margin-right: 12px;
    font-size: 18px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success-color);
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid var(--info-color);
}

.alert-close {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.5;
}

.alert-close:hover {
    opacity: 1;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark-color);
}

.card-body {
    padding: 20px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    margin-right: 15px;
}

.stat-icon.bg-blue { background: var(--primary-color); }
.stat-icon.bg-green { background: var(--success-color); }
.stat-icon.bg-orange { background: var(--warning-color); }
.stat-icon.bg-red { background: var(--danger-color); }

.stat-info h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 5px;
}

.stat-info p {
    font-size: 14px;
    color: var(--secondary-color);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--dark-color);
    border-bottom: 2px solid #e2e8f0;
    background: #f8fafc;
}

.table tbody td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.table tbody tr:hover {
    background: #f8fafc;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-primary { background: #dbeafe; color: #1e40af; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-secondary { background: #f1f5f9; color: #475569; }
.badge-info { background: #dbeafe; color: #1e40af; }

/* Progress Bars */
.progress {
    height: 10px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin: 8px 0;
}

.progress-bar {
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s;
}

.progress-bar.bg-info { background: var(--info-color); }
.progress-bar.bg-warning { background: var(--warning-color); }
.progress-bar.bg-danger { background: var(--danger-color); }
.progress-bar.bg-success { background: var(--success-color); }

.stat-bar {
    margin-bottom: 25px;
}

.stat-bar-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.stat-bar small {
    color: var(--secondary-color);
    font-size: 12px;
}

/* Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.col-md-4 { flex: 0 0 33.333%; padding: 0 10px; }
.col-md-6 { flex: 0 0 50%; padding: 0 10px; }
.col-md-8 { flex: 0 0 66.666%; padding: 0 10px; }
.col-md-12 { flex: 0 0 100%; padding: 0 10px; }

/* Utilities */
.mt-4 { margin-top: 20px; }
.mb-2 { margin-bottom: 10px; }
.mb-4 { margin-bottom: 20px; }
.text-center { text-align: center; }
.text-muted { color: var(--secondary-color); }
.py-4 { padding-top: 20px; padding-bottom: 20px; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .col-md-4, .col-md-6, .col-md-8, .col-md-12 {
        flex: 0 0 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
/* Profile & Password Pages */
.info-item {
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}

.info-item:last-child {
    border-bottom: none;
}

.info-item label {
    display: block;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 4px;
    font-size: 12px;
    text-transform: uppercase;
}

.info-item span {
    display: block;
    color: #334155;
}

.password-strength {
    margin: 15px 0;
}

.password-strength-meter {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.password-strength-bar {
    height: 100%;
    width: 0;
    transition: all 0.3s ease;
    background: #10b981;
}

.password-strength small {
    font-size: 12px;
    font-weight: 600;
}

.password-requirements {
    list-style: none;
    padding: 0;
}

.password-requirements li {
    padding: 8px 0;
    color: #64748b;
}

.password-requirements li i {
    color: #10b981;
    margin-right: 8px;
}

.col-md-4 {
    width: 33.333%;
}

.col-md-6 {
    width: 50%;
}

.col-md-8 {
    width: 66.666%;
}

.offset-md-3 {
    margin-left: 25%;
}

.mt-3 {
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .col-md-4,
    .col-md-6,
    .col-md-8 {
        width: 100%;
    }
    
    .offset-md-3 {
        margin-left: 0;
    }
}

/* Tabs */
.tabs {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tab-nav {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    border-bottom: 1px solid #e2e8f0;
}

.tab-nav li {
    margin: 0;
}

.tab-nav li a {
    display: block;
    padding: 15px 25px;
    color: #64748b;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.tab-nav li a i {
    margin-right: 8px;
}

.tab-nav li a:hover {
    color: var(--primary-color);
    background: #f8fafc;
}

.tab-nav li.active a {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.tab-content {
    padding: 30px;
}

/* Checkboxes */
.checkbox {
    margin: 15px 0;
}

.checkbox label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
}

.checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
}

/* Grid columns */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.row > [class*='col-'] {
    padding: 0 15px;
}

.col-md-3 {
    width: 25%;
}

hr {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 25px 0;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    padding: 24px 16px;
    box-sizing: border-box;
}

.modal.show {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 48px);
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #1e293b;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #64748b;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 12px;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: #dbeafe;
    color: #1e40af;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #e0e7ff;
    color: #3730a3;
}

.badge-secondary {
    background: #f1f5f9;
    color: #475569;
}

/* Button groups */
.btn-group {
    display: flex;
    gap: 5px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Text utilities */
.text-center {
    text-align: center;
}

.text-muted {
    color: #64748b;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

/* Contact List */
.contact-list {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 15px;
    background: #f8fafc;
}

.contact-item {
    padding: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.contact-item:last-child {
    border-bottom: none;
}

.contact-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
}

.contact-item input[type="checkbox"] {
    margin-right: 10px;
}

/* Alert */
.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

/* Text Colors */
.text-success {
    color: var(--success-color);
}

.text-warning {
    color: var(--warning-color);
}

.text-danger {
    color: var(--danger-color);
}

.text-info {
    color: var(--info-color);
}

/* Code Editor */
.code-editor {
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    line-height: 1.5;
    background: #f8f9fa;
    border: 1px solid #ced4da;
    padding: 10px;
}

/* Large Modal */
.modal-large .modal-content {
    max-width: 900px;
}

/* Row and Column Grid */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.col-md-4, .col-md-6 {
    padding: 0 10px;
    margin-bottom: 15px;
}

.col-md-4 {
    flex: 0 0 33.333%;
    max-width: 33.333%;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
}

@media (max-width: 768px) {
    .col-md-4, .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Checkbox Styling */
.checkbox {
    padding-top: 7px;
}

.checkbox label {
    font-weight: normal;
    cursor: pointer;
}

.checkbox input[type="checkbox"] {
    margin-right: 8px;
}

/* Datalist */
datalist {
    display: none;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    color: white;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 3px;
    text-transform: uppercase;
}

.badge-success {
    background: var(--success-color);
}

.badge-warning {
    background: var(--warning-color);
}

.badge-danger {
    background: var(--danger-color);
}

.badge-info {
    background: var(--info-color);
}

.badge-secondary {
    background: #6c757d;
}

/* Button Small */
.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* Button Group */
.btn-group {
    display: inline-flex;
    gap: 5px;
}

.btn-group .btn {
    margin-bottom: 0;
}

/* Text Utilities */
.text-center {
    text-align: center;
}

.text-muted {
    color: #6c757d;
}

.mt-3 {
    margin-top: 1rem;
}

/* Table Responsive */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Button Info */
.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-info:hover {
    background: #0284c7;
    color: white;
}

/* Form Text */
.form-text {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #6c757d;
}

/* Filter Form */
.filter-form .row {
    align-items: flex-end;
}

/* Button Success */
.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
    color: white;
}
