/* AAT Management Portal - Main Stylesheet */

:root {
    --primary-color: #507435;
    --primary-dark: #425f2c;
    --primary-light: rgba(80, 116, 53, 0.1);
    --secondary-color: #AB822D;
    --secondary-dark: #8f6d25;
    --secondary-light: rgba(171, 130, 45, 0.1);
    --light-bg: #f5f5f5;
    --white: #ffffff;
    --dark-text: #333333;
    --light-text: #ffffff;
    --gray-text: #666666;
    --danger: #dc3545;
    --success: #28a745;
    --warning: #ffc107;
    --info: #17a2b8;
    --border-color: #eeeeee;
}

/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--light-bg);
    color: var(--dark-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 14px;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

a:hover {
    color: var(--primary-dark);
}

/* Top Bar Styles */
.topbar {
    background-color: var(--primary-color);
    color: var(--light-text);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 70px;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--light-text);
    font-size: 1.5rem;
    cursor: pointer;
    display: none;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--light-text);
    font-weight: bold;
}

.user-dropdown {
    position: relative;
    cursor: pointer;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background-color: var(--white);
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-width: 150px;
    display: none;
    z-index: 1001;
}

.dropdown-menu.active {
    display: block;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    color: var(--dark-text);
    text-decoration: none;
    display: block;
}

.dropdown-item:hover {
    background-color: var(--light-bg);
}

/* Sidebar Styles */
.sidebar {
    background-color: var(--white);
    width: 250px;
    position: fixed;
    top: 70px;
    left: 0;
    bottom: 0;
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
    overflow-y: auto;
    z-index: 900;
    transition: left 0.3s ease;
}

.sidebar-menu {
    padding: 1rem 0;
}

.menu-item {
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--dark-text);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.menu-item:hover, .menu-item.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
}

.menu-item i {
    width: 20px;
    text-align: center;
}

/* Main Content Area */
.main-content {
    margin-left: 250px;
    margin-top: 70px;
    padding: 2rem;
    flex: 1;
}

.page-title {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-size: 1.8rem;
}

/* Card Styles */
.card {
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin: 0;
}

.card-body {
    padding: 1.5rem;
}

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

.stat-card {
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    margin-right: 1rem;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.stat-label {
    color: var(--gray-text);
    font-size: 0.9rem;
}

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

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

.stat-danger .stat-icon {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

.stat-success .stat-icon {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

/* Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background-color: #f9f9f9;
    font-weight: 600;
    color: var(--primary-color);
}

.data-table tr:hover {
    background-color: var(--primary-light);
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(80, 116, 53, 0.2);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.form-check-input {
    width: 1rem;
    height: 1rem;
}

.form-check-label {
    cursor: pointer;
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

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

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

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

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

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

.btn-danger:hover {
    background-color: #bd2130;
}

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

.btn-success:hover {
    background-color: #218838;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid currentColor;
}

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

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

.btn-outline-secondary {
    color: var(--gray-text);
}

.btn-outline-secondary:hover {
    background-color: #f0f0f0;
}

.btn-outline-danger {
    color: var(--danger);
}

.btn-outline-danger:hover {
    background-color: rgba(220, 53, 69, 0.1);
}

.btn-outline-success {
    color: var(--success);
}

.btn-outline-success:hover {
    background-color: rgba(40, 167, 69, 0.1);
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.875rem;
}

/* Search Form */
.search-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.search-form .form-control {
    flex: 1;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.badge-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

.badge-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: #d39e00;
}

.badge-info {
    background-color: rgba(23, 162, 184, 0.1);
    color: var(--info);
}

/* Modal Styles */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1050;
    display: none;
}

.modal-backdrop.active {
    display: flex;
}

.modal {
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin: 0;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-text);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--light-bg);
}

.login-card {
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

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

.login-logo {
    display: inline-block;
    width: 80px;
    height: 80px;
    background-color: var(--primary-color);
    border-radius: 50%;
    margin-bottom: 1rem;
    position: relative;
}

.login-logo::after {
    content: "AAT";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--light-text);
    font-weight: bold;
    font-size: 1.5rem;
}

.login-title {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--gray-text);
    font-size: 0.9rem;
}

.login-form {
    margin-bottom: 1.5rem;
}

.login-footer {
    text-align: center;
    color: var(--gray-text);
    font-size: 0.9rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
    gap: 0.25rem;
}

.page-item {
    list-style: none;
}

.page-link {
    display: block;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 4px;
}

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

.page-item.active .page-link {
    background-color: var(--primary-color);
    color: var(--light-text);
    border-color: var(--primary-color);
}

/* Alerts */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    font-weight: 500;
}

.alert p {
    margin-bottom: 0.5rem;
}

.alert p:last-child {
    margin-bottom: 0;
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success);
    border-left: 4px solid var(--success);
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger);
    border-left: 4px solid var(--danger);
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: #d39e00;
    border-left: 4px solid var(--warning);
}

.alert-info {
    background-color: rgba(23, 162, 184, 0.1);
    color: var(--info);
    border-left: 4px solid var(--info);
}

/* Workflow Visualization */
.workflow-visualization {
    overflow-x: auto;
}

/* Utilities */
.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.mt-0 {
    margin-top: 0;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar {
        left: -250px;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}
