/* Project P&L Management System - Main Stylesheet */
/* Optimized for full-screen monitor display with small text for tables */

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

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #16a085;
    --light-gray: #ecf0f1;
    --dark-gray: #7f8c8d;
    --border-color: #bdc3c7;
    --text-color: #2c3e50;
    --bg-color: #ffffff;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f6fa;
    color: var(--text-color);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
}

/* Container */
.container {
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
    padding: 0 15px;
}

.container-fluid {
    width: 100%;
    padding: 0 15px;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #34495e 100%);
    color: white;
    padding: 15px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 22px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    color: var(--warning-color);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background: rgba(255,255,255,0.1);
    border-radius: 5px;
}

.user-role {
    font-size: 11px;
    opacity: 0.8;
}

/* Navigation */
.navigation {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 0;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 20px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s;
    font-size: 13px;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: var(--secondary-color);
    color: white;
}

.nav-menu i {
    font-size: 16px;
}

/* Main Content */
.main-content {
    padding: 20px 0;
    min-height: calc(100vh - 140px);
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #34495e 100%);
    color: white;
    padding: 15px 20px;
    border-bottom: 3px solid var(--secondary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: 20px;
}

.card-footer {
    background: var(--light-gray);
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s;
    text-decoration: none;
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn i {
    font-size: 14px;
}

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

.btn-primary:hover {
    background: #2980b9;
}

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

.btn-success:hover {
    background: #229954;
}

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

.btn-danger:hover {
    background: #c0392b;
}

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

.btn-warning:hover {
    background: #d68910;
}

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

.btn-info:hover {
    background: #138d75;
}

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

.btn-group {
    display: flex;
    gap: 5px;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 13px;
    color: var(--text-color);
}

.form-label.required::after {
    content: '*';
    color: var(--danger-color);
    margin-left: 4px;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 13px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-control-sm {
    padding: 5px 10px;
    font-size: 12px;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

select.form-control {
    cursor: pointer;
}

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

.form-row-2 {
    grid-template-columns: repeat(2, 1fr);
}

.form-row-3 {
    grid-template-columns: repeat(3, 1fr);
}

.form-row-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Table Styles - Optimized for full screen with small text */
.table-responsive {
    overflow-x: auto;
    margin-top: 15px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    background: white;
}

.table thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, #34495e 100%);
    color: white;
}

.table thead th {
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    white-space: nowrap;
    border-bottom: 2px solid var(--secondary-color);
}

.table tbody td {
    padding: 8px;
    border-bottom: 1px solid #e8e8e8;
    font-size: 11px;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-striped tbody tr:nth-child(odd) {
    background-color: #fafafa;
}

.table-bordered {
    border: 1px solid var(--border-color);
}

.table-bordered th,
.table-bordered td {
    border: 1px solid var(--border-color);
}

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

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

.text-nowrap {
    white-space: nowrap;
}

/* P&L Table Specific - Extra small text for maximum data display */
.pnl-table {
    font-size: 10px;
}

.pnl-table thead th {
    padding: 8px 5px;
    font-size: 10px;
}

.pnl-table tbody td {
    padding: 6px 5px;
    font-size: 10px;
}

.pnl-table input {
    padding: 4px 6px;
    font-size: 10px;
}

/* Action Buttons in Tables */
.action-buttons {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.action-btn {
    padding: 4px 8px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.3s;
    color: white;
}

.action-btn i {
    font-size: 11px;
}

.action-btn:hover {
    transform: scale(1.1);
}

.btn-view {
    background: var(--info-color);
}

.btn-edit {
    background: var(--warning-color);
}

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

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    flex-wrap: wrap;
    gap: 15px;
}

.pagination-info {
    font-size: 12px;
    color: var(--dark-gray);
}

.pagination {
    display: flex;
    gap: 5px;
    list-style: none;
}

.pagination a {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 12px;
    transition: all 0.3s;
}

.pagination a:hover {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.pagination a.active {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.per-page-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}

.per-page-selector select {
    padding: 5px 10px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 12px;
}

/* Search and Filter */
.search-filter-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 15px;
    flex-wrap: wrap;
}

.search-box {
    display: flex;
    gap: 10px;
    flex: 1;
    max-width: 400px;
}

.search-box input {
    flex: 1;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-primary {
    background: var(--secondary-color);
    color: white;
}

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

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

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

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

/* Alerts */
.alert {
    padding: 12px 20px;
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert i {
    font-size: 18px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid var(--info-color);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 15px 20px;
    background: var(--primary-color);
    color: white;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    background: var(--light-gray);
    border-radius: 0 0 8px 8px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

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

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
}

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

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

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

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

.stat-content h3 {
    font-size: 28px;
    margin: 0;
    color: var(--primary-color);
}

.stat-content p {
    margin: 5px 0 0;
    color: var(--dark-gray);
    font-size: 13px;
}

/* Summary Section */
.summary-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.summary-item {
    background: rgba(255,255,255,0.1);
    padding: 15px;
    border-radius: 5px;
}

.summary-item label {
    font-size: 11px;
    opacity: 0.9;
    display: block;
    margin-bottom: 5px;
}

.summary-item .value {
    font-size: 22px;
    font-weight: bold;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utility Classes */
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.mr-1 { margin-right: 10px; }
.ml-1 { margin-left: 10px; }

.p-1 { padding: 10px; }
.p-2 { padding: 20px; }
.p-3 { padding: 30px; }

.text-muted {
    color: var(--dark-gray);
}

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

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

.text-warning {
    color: var(--warning-color);
}

.fw-bold {
    font-weight: bold;
}

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

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

.gap-1 {
    gap: 10px;
}

.gap-2 {
    gap: 20px;
}

/* Footer */
.footer {
    background: var(--primary-color);
    color: white;
    text-align: center;
    padding: 15px 0;
    margin-top: 40px;
    font-size: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .search-filter-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        max-width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-menu {
        flex-wrap: wrap;
    }
    
    .user-menu {
        flex-direction: column;
        gap: 10px;
    }
}

@media print {
    .header, .navigation, .btn, .pagination-container, .search-filter-section {
        display: none;
    }
    
    .main-content {
        padding: 0;
    }
}
