/* ORIC Management System - Green Theme CSS */

/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: -10px;
}

.col-md-3 { flex: 0 0 25%; max-width: 25%; padding: 10px; }
.col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; padding: 10px; }
.col-md-6 { flex: 0 0 50%; max-width: 50%; padding: 10px; }
.col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; padding: 10px; }
.col-md-12 { flex: 0 0 100%; max-width: 100%; padding: 10px; }

/* Card Components */
.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 25px rgba(0,0,0,0.12);
}

.card-header {
    background: linear-gradient(135deg, #108040 0%, #0d6835 100%);
    color: white;
    padding: 15px 20px;
    font-weight: 600;
    font-size: 1.1rem;
    border-bottom: none;
}

.card-body {
    padding: 20px;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #108040 0%, #0d6835 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.2rem;
    font-weight: bold;
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

.nav-menu li {
    margin-left: 1.5rem;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.nav-menu a:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
}

.dropdown-menu {
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.dropdown-item {
    color: #333;
    padding: 0.5rem 1rem;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #108040;
    box-shadow: 0 0 0 3px rgba(16, 128, 64, 0.1);
}

.form-control:invalid {
    border-color: #e74c3c;
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1.5;
}

.btn-primary {
    background: linear-gradient(135deg, #108040 0%, #0d6835 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0d6835 0%, #0a542b 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(16, 128, 64, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #fd7e14 0%, #dc3545 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c82333 0%, #a71d2a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-active { background: #d4edda; color: #108040; }
.status-draft { background: #fff3cd; color: #856404; }
.status-completed { background: #d1ecf1; color: #0c5460; }
.status-not-started { background: #f8d7da; color: #721c24; }
.status-in-progress { background: #d4edda; color: #108040; }
.status-admin { background: #e2e3e5; color: #383d41; }
.status-supervisor { background: #bee5eb; color: #0c5460; }
.status-employee { background: #d1ecf1; color: #0c5460; }

/* Table Styles */
.table {
    width: 100%;
    margin-bottom: 1rem;
    background-color: transparent;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    border-top: none;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Progress Bars */
.progress {
    background-color: #e9ecef;
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    background: linear-gradient(135deg, #108040 0%, #0d6835 100%);
    color: white;
    font-size: 12px;
    font-weight: 600;
    line-height: 20px;
    text-align: center;
    transition: width 0.6s ease;
    height: 100%;
}

/* Tab Navigation */
.nav-tabs {
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 20px;
    display: flex;
    list-style: none;
    padding: 0;
}

.nav-tabs .nav-item {
    margin-bottom: -2px;
}

.nav-tabs .nav-link {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: #495057;
    border: 2px solid transparent;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-tabs .nav-link:hover {
    border-color: #dee2e6;
    background-color: #f8f9fa;
}

.nav-tabs .nav-link.active {
    color: #108040;
    background-color: white;
    border-color: #dee2e6 #dee2e6 white;
    border-bottom: 2px solid white;
    font-weight: 600;
}

.tab-content {
    background: white;
    border-radius: 0 8px 8px 8px;
    padding: 20px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 15px;
    max-width: 800px;
    width: 90%;
    max-height: 90%;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    background: linear-gradient(135deg, #108040 0%, #0d6835 100%);
    color: white;
    padding: 20px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.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;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 20px;
}

/* Task Card Styles */
.task-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.task-card:hover {
    border-color: #108040;
    box-shadow: 0 2px 10px rgba(16, 128, 64, 0.1);
    transform: translateY(-1px);
}

.task-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.task-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #6c757d;
}

.task-type {
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* Quarterly Sections */
.quarters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.quarter-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    transition: all 0.3s ease;
}

.quarter-card:hover {
    border-color: #108040;
    box-shadow: 0 4px 15px rgba(16, 128, 64, 0.1);
}

.quarter-title {
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
    text-align: center;
    font-size: 14px;
}

.quarter-target {
    background: white;
    padding: 8px;
    border-radius: 5px;
    margin-bottom: 10px;
    border-left: 4px solid #108040;
    font-size: 13px;
}

.quarter-progress {
    margin-top: 8px;
}

/* Comments Section */
.comments-section {
    max-height: 400px;
    overflow-y: auto;
}

.comment {
    background: #f8f9fa;
    border-left: 4px solid #108040;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 0 8px 8px 0;
}

.comment-author {
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
}

.comment-date {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 10px;
}

.comment-text {
    color: #495057;
    line-height: 1.6;
}

/* Alert Styles */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 8px;
    position: relative;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #108040;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #108040 0%, #0d6835 100%);
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    overflow: hidden;
    width: 100%;
    max-width: 400px;
}

.login-header {
    background: linear-gradient(135deg, #108040 0%, #0d6835 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.login-header h1 {
    font-size: 24px;
    margin-bottom: 10px;
    font-weight: 600;
}

.login-header p {
    opacity: 0.9;
    font-size: 14px;
}

.login-body {
    padding: 30px;
}

/* Statistics Cards */
.stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    border: 2px solid #f8f9fa;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: #108040;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(16, 128, 64, 0.1);
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    color: #108040;
    margin-bottom: 5px;
}

.stat-label {
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
}

/* Footer Styles */
footer {
    background: linear-gradient(135deg, #108040, #0d6835);
    color: white;
    text-align: center;
    padding: 30px 20px;
    margin-top: 50px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .row {
        flex-direction: column;
    }
    
    .col-md-3, .col-md-4, .col-md-6, .col-md-8, .col-md-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .quarters-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 10px;
    }
    
    .container {
        padding: 0 10px;
    }
    
    .nav-tabs {
        flex-direction: column;
    }
    
    .nav-tabs .nav-link {
        border-radius: 8px;
        margin-bottom: 5px;
        border: 2px solid #dee2e6;
    }
    
    .nav-tabs .nav-link.active {
        border-color: #108040;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
}

/* Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #108040;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0d6835;
}

/* Filter panel (admin/performance.php) - moved from inline styles */
.filter-panel {
    background: linear-gradient(135deg, #108040 0%, #0d6835 100%);
    color: white;
    padding: 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(16,128,64,0.12);
}
.filter-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; }
.filter-group { display:flex; flex-direction:column; }
.filter-label { font-size:13px; margin-bottom:6px; opacity:0.95; }
.filter-select { padding:10px 12px; border-radius:6px; border:none; font-size:14px; }
.filter-buttons { display:flex; gap:10px; align-items:end; }
.btn-apply { background:#28a745; color:white; padding:8px 12px; border-radius:6px; border:none; }
.btn-reset { background:rgba(255,255,255,0.12); color:white; padding:8px 12px; border-radius:6px; border:none; }

/* Organization tree styles */
.org-tree { margin: 0; padding: 0; list-style: none; }
.org-tree ul { margin-left: 20px; padding-left: 12px; border-left: 1px solid rgba(0,0,0,0.06); }
.org-node { margin: 6px 0; }
.org-node .node-content { display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:8px; background: #fff; border:1px solid #eef2f1; }
.org-node .node-avatar { width:38px; height:38px; border-radius:50%; background:#f0f0f0; display:inline-block; flex-shrink:0; }
.org-node .node-label { font-weight:600; color:#2c3e50; }
.org-node .node-meta { font-size:12px; color:#6c757d; }
.org-node .node-actions { margin-left:auto; }
.org-node .toggle-btn { background:none; border:none; cursor:pointer; font-size:14px; padding:4px 8px; color:#108040; }
.org-children { margin-top:8px; }
/* collapsed children */
.org-children.collapsed { display: none; }

/* print-friendly tree */
@media print {
    .node-actions, .filter-panel, .btn, .filter-buttons { display: none !important; }
    .org-node .node-content { border: none; box-shadow: none; }
}

/* Card-style nodes used on performance.php to match previous UI */
.card-node .node-content { display: block; text-align: center; padding: 12px; border-radius: 8px; background: #fff; border:1px solid #eef2f1; }
.card-node .node-avatar { margin: 0 auto 8px; }
.card-node .node-label { font-size: 16px; font-weight: 700; }
.card-node .node-meta { font-size: 13px; color:#6c757d; margin-top:6px; }
.card-node .node-actions { margin-top:10px; display:flex; gap:8px; justify-content:center; }
.card-node .toggle-btn { position: absolute; left: 8px; top: 10px; }
.card-node { position: relative; }