/* Reset & Base Styles */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.6;
	color: #1a1a1a;
	background-color: #f5f7fa;
}

/* Container */
.container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
}

/* Header */
.header {
	background: #1d2e3d;
	padding: 20px 24px;
	margin-bottom: 16px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	display: flex;
	flex-direction: row;
	gap: 16px;
	align-items: center;
}

.header-logo {
	height: 32px;
	width: auto;
	flex-shrink: 0;
}

.header h1 {
	font-size: 18px;
	font-weight: 600;
	color: #ffffff;
	letter-spacing: -0.02em;
}

.header nav {
	display: flex;
	gap: 8px;
	margin-left: auto;
}

.header nav a {
	color: rgba(255, 255, 255, 0.85);
	text-decoration: none;
	padding: 8px 16px;
	border-radius: 6px;
	transition: all 0.2s;
	font-size: 14px;
	font-weight: 500;
}

.header nav a:hover {
	background-color: rgba(255, 255, 255, 0.1);
	color: #ffffff;
}

.header nav .user-badge {
	color: rgba(255, 255, 255, 0.9);
	padding: 8px 16px;
	background-color: rgba(255, 255, 255, 0.15);
	border-radius: 6px;
	font-size: 14px;
	font-weight: 500;
	white-space: nowrap;
}

/* Admin Sub-Navigation */
.admin-subnav {
	background: white;
	border-bottom: 1px solid #e5e7eb;
	margin-bottom: 24px;
	padding: 0 24px;
	display: flex;
	gap: 4px;
}

.admin-subnav a {
	padding: 14px 20px;
	color: #6b7280;
	text-decoration: none;
	font-weight: 500;
	font-size: 14px;
	border-bottom: 2px solid transparent;
	transition: all 0.2s;
}

.admin-subnav a:hover {
	color: #2563eb;
	background-color: #f9fafb;
}

.admin-subnav a.active {
	color: #2563eb;
	border-bottom-color: #2563eb;
}

/* Admin Header */
.admin-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 24px;
	background: white;
	padding: 24px;
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	border: 1px solid #e5e7eb;
}

.admin-header h2 {
	font-size: 24px;
	font-weight: 600;
	color: #0a2540;
}

/* Buttons */
.btn {
	display: inline-block;
	padding: 10px 20px;
	background-color: #ffffff;
	color: #0a2540;
	text-decoration: none;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	transition: all 0.2s;
}

.btn:hover {
	background-color: #f9fafb;
	border-color: #9ca3af;
}

.btn-primary {
	background-color: #2563eb;
	color: white;
	border-color: #2563eb;
}

.btn-primary:hover {
	background-color: #1d4ed8;
	border-color: #1d4ed8;
}

.btn-danger {
	background-color: #ffffff;
	color: #dc2626;
	border-color: #dc2626;
}

.btn-danger:hover {
	background-color: #dc2626;
	color: white;
	border-color: #dc2626;
}

.btn-small {
	padding: 6px 14px;
	font-size: 13px;
}

/* Data Table */
.data-table {
	width: 100%;
	background: white;
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	border: 1px solid #e5e7eb;
	border-collapse: collapse;
	overflow: hidden;
}

.data-table thead {
	background-color: #f9fafb;
}

.data-table th {
	text-align: left;
	padding: 10px 14px;
	font-weight: 600;
	font-size: 11px;
	color: #6b7280;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	border-bottom: 1px solid #e5e7eb;
}

.data-table td {
	padding: 10px 14px;
	border-bottom: 1px solid #f3f4f6;
	color: #1f2937;
	font-size: 13px;
}

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

.data-table .actions {
	white-space: nowrap;
}

.data-table .actions > * {
	margin-right: 8px;
}

.data-table code {
	background-color: #f4f4f4;
	padding: 2px 6px;
	border-radius: 3px;
	font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, monospace;
	font-size: 13px;
}

/* Small buttons for table actions */
.btn-sm {
	padding: 4px 10px;
	font-size: 12px;
	line-height: 1.4;
}

/* Action buttons container */
.action-buttons {
	display: flex;
	gap: 6px;
	align-items: center;
}

.action-buttons .btn {
	margin: 0;
}

.action-buttons form {
	margin: 0;
}

/* Forms */
.form-container {
	background: white;
	padding: 32px;
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	border: 1px solid #e5e7eb;
	max-width: 600px;
}

.form-container h2 {
	margin-bottom: 8px;
	font-size: 22px;
	font-weight: 600;
	color: #0a2540;
}

.form-container .subtitle {
	color: #6b7280;
	margin-bottom: 24px;
	font-size: 14px;
}

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

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

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="datetime-local"],
.form-group select,
.form-group textarea,
.form-select {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 14px;
	font-family: inherit;
	transition: all 0.2s;
	color: #1f2937;
}

.form-select {
	width: auto;
	min-width: 200px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
	outline: none;
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input[readonly] {
	background-color: #f9fafb;
	color: #6b7280;
	border-color: #e5e7eb;
}

.form-group .help-text {
	display: block;
	margin-top: 4px;
	font-size: 12px;
	color: #666;
}

.form-actions {
	margin-top: 24px;
	display: flex;
	gap: 12px;
}

/* Status Legend */
.status-legend {
	background-color: #f8f9fa;
	padding: 16px;
	border-radius: 6px;
	margin: 20px 0;
}

.status-legend h3 {
	font-size: 14px;
	font-weight: 600;
	margin-bottom: 12px;
	color: #333;
}

.status-legend ul {
	list-style: none;
}

.status-legend li {
	padding: 6px 0;
	font-size: 13px;
	display: flex;
	align-items: center;
}

.status-badge {
	display: inline-block;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	margin-right: 8px;
}

.status-badge.operational {
	background-color: #0d9488;
}

.status-badge.degraded {
	background-color: #f59e0b;
}

.status-badge.maintenance {
	background-color: #3b82f6;
}

.status-badge.down {
	background-color: #ef4444;
}

.status-badge.active {
	background-color: #10b981;
	color: white;
	width: auto;
	height: auto;
	padding: 3px 8px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 500;
}

.status-badge.inactive {
	background-color: #6b7280;
	color: white;
	width: auto;
	height: auto;
	padding: 3px 8px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 500;
}

.status-badge.scheduled {
	background-color: #3b82f6;
	color: white;
	width: auto;
	height: auto;
	padding: 3px 8px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 500;
}

.status-badge.expired {
	background-color: #9ca3af;
	color: white;
	width: auto;
	height: auto;
	padding: 3px 8px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 500;
}

.type-badge {
	display: inline-block;
	padding: 3px 8px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 500;
	text-transform: capitalize;
}

.type-badge.type-info {
	background-color: #dbeafe;
	color: #1e40af;
}

.type-badge.type-warning {
	background-color: #fef3c7;
	color: #92400e;
}

.type-badge.type-maintenance {
	background-color: #e0e7ff;
	color: #3730a3;
}

/* Messages */
.message-container {
	background: white;
	padding: 40px;
	border-radius: 8px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	text-align: center;
	max-width: 500px;
	margin: 40px auto;
}

.message-container h2 {
	margin-bottom: 16px;
	font-size: 24px;
}

.message-container p {
	margin-bottom: 24px;
	color: #666;
}

.message-container.success h2 {
	color: #0d9488;
}

.message-container.error h2 {
	color: #ef4444;
}

/* Empty State */
.empty-state {
	background: white;
	padding: 60px 40px;
	border-radius: 8px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	text-align: center;
	color: #666;
}

/* Footer */
footer {
	margin-top: 60px;
	padding: 20px;
	text-align: center;
	color: #9ca3af;
	font-size: 13px;
}

/* Public Status Page */
.status-header {
	background: white;
	padding: 12px 32px;
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	border: 1px solid #e5e7eb;
	margin-bottom: 16px;
	text-align: center;
	position: relative;
}

.overall-status {
	font-size: 32px;
	font-weight: 600;
	margin: 0;
}

.overall-status.status-operational {
	color: #0d9488;
}

.overall-status.status-degraded {
	color: #f59e0b;
}

.overall-status.status-maintenance {
	color: #3b82f6;
}

.overall-status.status-down {
	color: #ef4444;
}

.last-updated {
	position: absolute;
	top: 12px;
	right: 32px;
	color: #9ca3af;
	font-size: 12px;
	margin: 0;
}

/* Two-column layout */
.two-column-layout {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin-bottom: 32px;
	align-items: stretch;
}

.services-column h3,
.events-column h3 {
	font-size: 20px;
	font-weight: 600;
	color: #0a2540;
	margin-bottom: 16px;
}

.right-column {
	display: flex;
	flex-direction: column;
	gap: 16px;
	height: 100%;
}

.announcements-section {
	display: none;
	width: 100%;
	margin-bottom: 24px;
}

.announcements-box {
	background: white;
	padding: 24px;
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	border: 1px solid #e5e7eb;
}

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

.announcements-box h3 {
	font-size: 20px;
	font-weight: 600;
	color: #0a2540;
	margin: 0;
}

.announcements-toggle {
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 4px 8px;
	font-size: 16px;
	color: #6b7280;
	transition: color 0.2s;
}

.announcements-toggle:hover {
	color: #0a2540;
}

.toggle-icon {
	display: inline-block;
	transition: transform 0.2s;
}

.announcements-content {
	max-height: 300px;
	overflow-y: auto;
}

.announcement {
	padding: 16px;
	border-radius: 6px;
	margin-bottom: 12px;
	border-left: 4px solid;
}

.announcement:last-child {
	margin-bottom: 0;
}

.announcement-info {
	background-color: #eff6ff;
	border-left-color: #3b82f6;
}

.announcement-warning {
	background-color: #fef3c7;
	border-left-color: #f59e0b;
}

.announcement-maintenance {
	background-color: #dbeafe;
	border-left-color: #2563eb;
}

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

.announcement-title {
	font-weight: 600;
	color: #0a2540;
	font-size: 15px;
}

.announcement-date {
	font-size: 13px;
	color: #6b7280;
}

.announcement-message {
	color: #374151;
	font-size: 14px;
	line-height: 1.5;
	white-space: pre-line;
}

.events-column {
	background: white;
	padding: 24px;
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	border: 1px solid #e5e7eb;
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
}

.events-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 16px;
	flex-shrink: 0;
}

.events-header h3 {
	margin-bottom: 0;
}

.events-filter {
	padding: 6px 12px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	background: white;
	font-size: 14px;
	color: #374151;
	cursor: pointer;
	transition: all 0.2s;
}

.events-filter:hover {
	border-color: #9ca3af;
}

.events-filter:focus {
	outline: none;
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.events-feed {
	display: flex;
	flex-direction: column;
	gap: 16px;
	overflow-y: auto;
	flex: 1;
	min-height: 0;
}

.event-card {
	padding: 16px;
	border-radius: 6px;
	border: 1px solid #e5e7eb;
	background: #f9fafb;
}

.event-card-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 8px;
	gap: 12px;
}

.event-service-name {
	font-weight: 600;
	color: #0a2540;
	font-size: 14px;
}

.event-time {
	font-size: 13px;
	color: #6b7280;
	white-space: nowrap;
}

.event-status-info {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 6px;
}

.event-message {
	color: #374151;
	font-size: 14px;
	line-height: 1.5;
	white-space: pre-line;
}

/* Mobile responsive */
@media (max-width: 768px) {
	.two-column-layout {
		grid-template-columns: 1fr;
	}

	.events-column {
		max-height: 600px;
	}
}

.services-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.service-card {
	background: white;
	padding: 16px;
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	border: 1px solid #e5e7eb;
}

.service-top-bar {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 2px;
}

.service-info-left {
	flex: 1;
}

.service-name {
	font-size: 15px;
	font-weight: 600;
	color: #0a2540;
	margin-bottom: 0;
	line-height: 1.3;
}

.service-name .service-description {
	font-weight: 400;
	color: #6b7280;
	font-size: 13px;
}

.status-indicator {
	display: inline-block;
	padding: 6px 14px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
}

.status-indicator.status-operational {
	background-color: #ccfbf1;
	color: #115e59;
}

.status-indicator.status-degraded {
	background-color: #fef3c7;
	color: #92400e;
}

.status-indicator.status-maintenance {
	background-color: #dbeafe;
	color: #1e40af;
}

.status-indicator.status-down {
	background-color: #fee2e2;
	color: #991b1b;
}

.uptime-badges {
	display: flex;
	flex-direction: column;
	gap: 4px;
	align-items: flex-end;
}

.uptime-badge {
	font-size: 13px;
	font-weight: 500;
	color: #6b7280;
}

.service-timeline {
	margin-top: 2px;
}

.timeline-svg {
	display: block;
	width: 100%;
}

.timeline-bar {
	cursor: pointer;
	transition: opacity 0.2s;
}

.timeline-bar:hover {
	opacity: 1 !important;
}

.timeline-legend {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-top: 8px;
	font-size: 12px;
	color: #9ca3af;
}

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

.legend-row-top {
	/* Period labels on same line */
}

.legend-row-bottom {
	/* Uptime and toggle on same line */
}

.legend-item {
	line-height: 22px;
}

.legend-uptime {
	font-weight: 500;
	color: #6b7280;
	font-size: 13px;
	line-height: 22px;
}

.timeline-period-toggle {
	display: flex;
	border: 1px solid #d1d5db;
	border-radius: 4px;
	overflow: hidden;
	height: 22px;
}

.timeline-period-btn {
	padding: 2px 8px;
	border: none;
	background: white;
	font-size: 11px;
	font-weight: 500;
	color: #6b7280;
	cursor: pointer;
	transition: all 0.2s;
	border-right: 1px solid #d1d5db;
}

.timeline-period-btn:last-child {
	border-right: none;
}

.timeline-period-btn:hover {
	background: #f9fafb;
}

.timeline-period-btn.active {
	background: #bfdbfe;
	color: #1e40af;
}

.timeline-loading,
.timeline-error {
	padding: 20px;
	text-align: center;
	color: #6b7280;
	font-size: 14px;
}

.loading-state {
	background: white;
	padding: 60px 40px;
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	border: 1px solid #e5e7eb;
	text-align: center;
	color: #6b7280;
}

.error-state {
	background: white;
	padding: 60px 40px;
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	border: 1px solid #e5e7eb;
	text-align: center;
	color: #ef4444;
}

/* Recent Events */
.recent-events {
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid #e5e7eb;
}

.recent-events-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 16px;
}

.recent-events-header h4 {
	font-size: 14px;
	font-weight: 600;
	color: #374151;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.view-history-link {
	font-size: 13px;
	color: #2563eb;
	text-decoration: none;
	font-weight: 500;
	transition: color 0.2s;
}

.view-history-link:hover {
	color: #1d4ed8;
	text-decoration: underline;
}

.events-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.event-item {
	display: flex;
	gap: 16px;
	padding: 12px;
	background-color: #f9fafb;
	border-radius: 6px;
	border-left: 3px solid transparent;
}

.event-item:hover {
	background-color: #f3f4f6;
}

.event-status {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 160px;
}

.status-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	flex-shrink: 0;
}

.status-dot.status-operational {
	background-color: #0d9488;
}

.status-dot.status-degraded {
	background-color: #f59e0b;
}

.status-dot.status-maintenance {
	background-color: #3b82f6;
}

.status-dot.status-down {
	background-color: #ef4444;
}

.event-status-label {
	font-size: 13px;
	font-weight: 600;
	color: #374151;
}

.event-details {
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1;
}

.event-time {
	font-size: 13px;
	color: #6b7280;
	font-weight: 500;
}

.event-message {
	font-size: 13px;
	color: #4b5563;
	line-height: 1.5;
	white-space: pre-line;
}

/* Responsive */
@media (max-width: 768px) {
	.header {
		flex-direction: column;
		align-items: flex-start;
		gap: 15px;
	}

	.admin-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 15px;
	}

	.data-table {
		font-size: 13px;
	}

	.data-table th,
	.data-table td {
		padding: 8px 12px;
	}

	.form-actions {
		flex-direction: column;
	}

	.form-actions .btn {
		width: 100%;
	}

	.service-header {
		flex-direction: column;
		align-items: flex-start;
	}

	.service-status {
		align-items: flex-start;
		flex-direction: row;
		gap: 12px;
	}

	.uptime-badges {
		align-items: flex-start;
	}

	.overall-status {
		font-size: 24px;
	}

	.status-header {
		padding: 24px;
	}

	.service-card {
		padding: 20px;
	}

	.event-item {
		flex-direction: column;
		gap: 8px;
	}

	.event-status {
		min-width: auto;
	}

	.recent-events-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}
}

/* Events Footer */
.events-footer {
	margin-top: 16px;
	text-align: center;
	padding-top: 16px;
	border-top: 1px solid #e5e7eb;
	flex-shrink: 0;
}

/* Pagination */
.pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 16px;
	margin: 32px 0;
	padding: 20px;
}

.pagination-info {
	font-size: 14px;
	color: #6b7280;
	font-weight: 500;
}

.btn-disabled {
	padding: 10px 20px;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 500;
	background-color: #f3f4f6;
	color: #9ca3af;
	border: 1px solid #e5e7eb;
	cursor: not-allowed;
	text-decoration: none;
}

.btn-secondary {
	padding: 10px 20px;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 500;
	background-color: white;
	color: #2563eb;
	border: 1px solid #2563eb;
	cursor: pointer;
	text-decoration: none;
	transition: all 0.2s;
	display: inline-block;
}

.btn-secondary:hover {
	background-color: #2563eb;
	color: white;
}

/* History Page */
.history-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 24px;
	padding-bottom: 16px;
	border-bottom: 2px solid #e5e7eb;
}

.history-header h2 {
	font-size: 24px;
	font-weight: 600;
	color: #0a2540;
	margin: 0;
}

.history-content {
	display: flex;
	flex-direction: column;
	gap: 12px;
}
