/* Decision Control Environments - Clean Sidebar Design */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 220px;
    background: #ffffff;
    border-right: 1px solid #e1e4e8;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
}

.sidebar-top {
    flex: 0 0 auto;
}

.sidebar-bottom {
    flex: 0 0 auto;
    margin-top: auto;
}

.sidebar-header {
    padding: 30px 20px;
    border-bottom: 1px solid #e1e4e8;
}

.sidebar .logo {
    height: 32px;
    width: auto;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-item {
    display: block;
    padding: 12px 20px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: #f5f7fa;
    color: #0066cc;
}

.nav-item.active {
    background: #e8f2ff;
    color: #0066cc;
    border-left-color: #0066cc;
}

.task-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: #dc3545;
    color: white;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #e1e4e8;
}

.user-info {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
}

.sign-out-btn {
    width: 100%;
    padding: 8px 12px;
    background: white;
    border: 1px solid #dc3545;
    color: #dc3545;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.sign-out-btn:hover {
    background: #dc3545;
    color: white;
}

/* Main Content */
.main-content {
    margin-left: 220px;
    flex: 1;
    padding: 40px;
}

.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 14px;
    color: #666;
}

/* Status Badges */
.status-badges {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.offline {
    background: #ffe4e6;
    color: #dc3545;
}

.status-badge.online {
    background: #d4edda;
    color: #28a745;
}

/* Environment Grid */
.environment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* Environment Cards */
.env-card {
    background: white;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    padding: 24px;
    transition: all 0.3s;
}

.env-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.env-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.env-name {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
}

.env-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.env-badge.dev {
    background: #d4e8ff;
    color: #0066cc;
}

.env-badge.test {
    background: #d4edda;
    color: #28a745;
}

.env-badge.prod {
    background: #ffe4e6;
    color: #dc3545;
}

.env-badge.new {
    background: #e9d5ff;
    color: #8b5cf6;
}

.env-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    min-height: 40px;
}

/* Environment Stats */
.env-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 6px;
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
}

/* Launch Button */
.launch-btn {
    width: 100%;
    padding: 12px 20px;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.launch-btn:hover {
    background: #0052a3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.3);
}

.launch-btn:active {
    transform: translateY(0);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 60px;
    color: #666;
}

.loading::after {
    content: "Loading...";
    display: block;
    margin-top: 16px;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }

    .main-content {
        margin-left: 200px;
        padding: 20px;
    }

    .environment-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .sidebar {
        width: 100%;
        position: relative;
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-footer {
        display: none;
    }
}

/* Content Views */
.content-view {
    display: none;
}

.content-view.active {
    display: block;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 16px;
}

/* Unit Card */
.unit-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: all 0.2s;
}

.unit-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.unit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.unit-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.unit-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.unit-status.enabled {
    background: #d4edda;
    color: #155724;
}

.unit-status.disabled {
    background: #f8d7da;
    color: #721c24;
}

.unit-versions {
    display: none;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e1e4e8;
}

.unit-card.expanded .unit-versions {
    display: block;
}

.version-item {
    padding: 12px;
    margin: 8px 0;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.version-item:hover {
    background: #e9ecef;
}

.version-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.version-name {
    font-weight: 600;
    color: #495057;
}

.version-models {
    display: none;
    margin-top: 10px;
    padding-left: 20px;
}

.version-item.expanded .version-models {
    display: block;
}

.model-item {
    padding: 8px 12px;
    margin: 4px 0;
    background: white;
    border-left: 3px solid #0066CC;
    border-radius: 4px;
    font-size: 14px;
}

.model-name {
    font-weight: 500;
    color: #333;
}

.model-meta {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.expand-icon {
    transition: transform 0.2s;
}

.expanded .expand-icon {
    transform: rotate(90deg);
}

/* Disabled button state */
.launch-btn.disabled,
.launch-btn:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.launch-btn.disabled:hover,
.launch-btn:disabled:hover {
    background: #e9ecef;
    transform: none;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e1e4e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f5f7fa;
    color: #333;
}

.modal-body {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #0066CC;
}

.form-control[readonly] {
    background: #f8f9fa;
    color: #666;
}

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

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e1e4e8;
}

.btn {
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #667eea;
    color: white;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.btn-primary:hover {
    background: #5568d3;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
}

.btn-secondary {
    background: #e9ecef;
    color: #495057;
}

.btn-secondary:hover {
    background: #dee2e6;
}

.btn-success {
    background: #28a745;
    color: white;
}

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

.btn-danger {
    background: #dc3545;
    color: white;
}

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

/* Submit button for models */
.model-submit-btn {
    margin-top: 8px;
    padding: 6px 12px;
    background: #0066CC;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.model-submit-btn:hover {
    background: #0052a3;
}

/* Task Cards */
.task-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.task-header h3 {
    margin: 0 0 4px 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

/* Status Badges */
.status-badge {
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-approved {
    background: #d4edda;
    color: #155724;
}

.status-deployed {
    background: #d1ecf1;
    color: #0c5460;
}

.status-rejected {
    background: #f8d7da;
    color: #721c24;
}

/* Settings View */
.settings-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e1e4e8;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
}

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

.data-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #e1e4e8;
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr {
    border-bottom: 1px solid #e1e4e8;
    transition: background 0.2s;
}

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

.data-table td {
    padding: 14px 16px;
    font-size: 14px;
    color: #333;
}

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

.data-table .status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.data-table .status-badge.enabled {
    background: #d4edda;
    color: #155724;
}

.data-table .status-badge.disabled {
    background: #f8d7da;
    color: #721c24;
}

.data-table .action-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 6px;
}

.data-table .action-btn:hover {
    background: #f8f9fa;
    border-color: #0066cc;
    color: #0066cc;
}

.data-table .action-btn.delete {
    border-color: #dc3545;
    color: #dc3545;
}

.data-table .action-btn.delete:hover {
    background: #dc3545;
    color: white;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

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

.sidebar-divider {
    height: 1px;
    background: #e1e4e8;
    margin: 12px 0;
}

/* Role checkboxes in environment modal */
.role-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 8px;
    padding: 10px;
    background: #f5f7fa;
    border-radius: 6px;
    border: 1px solid #e1e4e8;
}

.role-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e1e4e8;
    cursor: pointer;
    transition: all 0.2s;
}

.role-checkbox-item:hover {
    background: #e8f2ff;
    border-color: #0066cc;
}

.role-checkbox-item input[type="checkbox"] {
    cursor: pointer;
}

.role-checkbox-item label {
    cursor: pointer;
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

/* User permissions display */
.permissions-card {
    background: white;
    border-radius: 8px;
    border: 1px solid #e1e4e8;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.permissions-info {
    max-width: 800px;
}

.permissions-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.permission-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    text-align: center;
}

.permission-badge.admin {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 2px 8px rgba(245, 87, 108, 0.3);
}

.permission-badge.dev {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 2px 8px rgba(79, 172, 254, 0.3);
}

.permission-badge.risk {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    box-shadow: 0 2px 8px rgba(250, 112, 154, 0.3);
}

.permission-badge.compliance {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
    box-shadow: 0 2px 8px rgba(48, 207, 208, 0.3);
}

.permission-badge.prod {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #333;
    box-shadow: 0 2px 8px rgba(168, 237, 234, 0.3);
}

.permission-icon {
    font-size: 18px;
}

.no-permissions {
    padding: 20px;
    text-align: center;
    color: #666;
    background: #f5f7fa;
    border-radius: 6px;
    border: 1px dashed #ddd;
}

/* Workflow Preview Styles */
.workflow-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.workflow-step {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e1e4e8;
    font-size: 14px;
}

.workflow-step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    margin-right: 12px;
    flex-shrink: 0;
}

.workflow-step-content {
    flex: 1;
}

.workflow-step-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.workflow-step-detail {
    font-size: 12px;
    color: #666;
}

.workflow-step.skippable {
    opacity: 0.7;
    border-style: dashed;
}

.workflow-step.skippable .workflow-step-number {
    background: #95a5a6;
}
