@font-face {
    font-family: 'Titillium Web';
    src: url('TitilliumWeb-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Titillium Web', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 300;
    background-color: #2a2f3a;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    color: #e8eef1;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    color: #e8eef1;
    font-size: 18px;
    font-weight: 300;
    letter-spacing: 1px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #a0aab8;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Titillium Web', sans-serif;
    font-weight: 300;
    font-size: 12px;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #e8eef1;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.tab-btn.active {
    background: rgba(255, 255, 255, 0.2);
    color: #e8eef1;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Section header */
.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.section-header h2 {
    margin-right: auto;
    font-size: 14px;
    color: #e8eef1;
    font-weight: 300;
}

/* Buttons */
.btn {
    background: rgba(52, 73, 94, 0.8);
    color: #fff;
    border: 1px solid rgba(52, 73, 94, 0.9);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 300;
    font-size: 12px;
    font-family: 'Titillium Web', sans-serif;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.btn:hover {
    background: rgba(52, 73, 94, 0.95);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.btn.small {
    padding: 4px 8px;
    font-size: 11px;
}

.btn.danger {
    background: rgba(231, 76, 60, 0.8);
    border-color: rgba(231, 76, 60, 0.9);
    color: #fff;
}

.btn.danger:hover {
    background: rgba(231, 76, 60, 0.95);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

th, td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 12px;
}

th {
    background: rgba(255, 255, 255, 0.08);
    color: #8a9baa;
    font-weight: 300;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.5px;
}

tr:hover {
    background: rgba(255, 255, 255, 0.08);
}

tr:last-child td {
    border-bottom: none;
}

td.empty {
    text-align: center;
    color: #6a7a8a;
    padding: 40px;
}

/* Status badges */
.status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 300;
    letter-spacing: 0.5px;
    backdrop-filter: blur(5px);
}

.status.queued {
    background: rgba(241, 196, 15, 0.25);
    color: #f1c40f;
    border: 1px solid rgba(241, 196, 15, 0.4);
}

.status.running {
    background: rgba(52, 152, 219, 0.25);
    color: #5dade2;
    border: 1px solid rgba(52, 152, 219, 0.4);
}

.status.complete {
    background: rgba(46, 204, 113, 0.25);
    color: #58d68d;
    border: 1px solid rgba(46, 204, 113, 0.4);
}

.status.timeout {
    background: rgba(230, 126, 34, 0.25);
    color: #eb984e;
    border: 1px solid rgba(230, 126, 34, 0.4);
}

.status.error {
    background: rgba(231, 76, 60, 0.25);
    color: #ec7063;
    border: 1px solid rgba(231, 76, 60, 0.4);
}

.status.unknown {
    background: rgba(127, 140, 154, 0.25);
    color: #aab7c4;
    border: 1px solid rgba(127, 140, 154, 0.4);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(20, 25, 35, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: rgba(45, 55, 72, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 12px;
    width: 380px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

.modal-content.large {
    width: 900px;
}

.modal-header {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
    flex: 1;
    font-size: 14px;
    font-weight: 300;
    color: #e8eef1;
}

.close-btn {
    background: none;
    border: none;
    color: #8a9baa;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #e8eef1;
}

.modal-content form,
.modal-content .section-header,
.modal-content table {
    padding: 15px;
}

.modal-content .section-header {
    padding-bottom: 0;
}

.modal-content table {
    padding-top: 0;
}

/* Forms */
.form-group {
    margin-bottom: 10px;
}

.form-group label {
    display: block;
    margin-bottom: 3px;
    color: #a0aab8;
    font-size: 11px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #e8eef1;
    font-size: 12px;
    font-family: 'Titillium Web', sans-serif;
    font-weight: 300;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.12);
}

.form-group input[type="file"] {
    padding: 5px 8px;
}

.form-group input::placeholder {
    color: #6a7a8a;
}

/* Settings */
.settings-form {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 15px;
    border-radius: 10px;
    max-width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Task output */
#task-output-section {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#task-output-section h3 {
    margin-bottom: 10px;
    font-size: 14px;
    color: #a0aab8;
    font-weight: 300;
}

#task-output {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 10px;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 12px;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #58d68d;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Select dropdown styling */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%238a9baa' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 26px;
}

select option {
    background: #2a2f3a;
    color: #e8eef1;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 10px;
    padding: 20px 25px;
    width: 100%;
    max-width: 280px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 15px;
    color: #e8eef1;
    font-weight: 300;
    font-size: 16px;
    letter-spacing: 1px;
}

.login-box .form-group {
    margin-bottom: 10px;
}

.login-btn {
    width: 100%;
    padding: 6px 12px;
    font-size: 12px;
    margin-top: 10px;
}

.error-message {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid rgba(231, 76, 60, 0.4);
    color: #ec7063;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    text-align: center;
}

.success-message {
    background: rgba(46, 204, 113, 0.2);
    border: 1px solid rgba(46, 204, 113, 0.4);
    color: #58d68d;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    text-align: center;
}

/* Logout button */
.logout-btn {
    background: rgba(231, 76, 60, 0.6);
    border-color: rgba(231, 76, 60, 0.7);
    padding: 6px 12px;
    font-size: 12px;
}

.logout-btn:hover {
    background: rgba(231, 76, 60, 0.85);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* =====================================================
   Agent Page Styles
   ===================================================== */

/* Agent page layout */
.agent-page {
    height: 100vh;
    overflow: hidden;
}

.agent-page .container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 15px 20px;
    box-sizing: border-box;
}

.agent-page header {
    margin-bottom: 10px;
}

.agent-page header h1 {
    font-size: 20px;
}

.agent-page .section-header {
    margin-bottom: 8px;
    flex-shrink: 0;
}

.agent-page .section-header h2 {
    font-size: 16px;
}

/* Back link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #a0aab8;
    text-decoration: none;
    margin-bottom: 10px;
    font-size: 12px;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: #e8eef1;
}

/* Agent info grid */
.agent-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.info-label {
    font-size: 10px;
    color: #a0aab8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 13px;
    color: #e8eef1;
}

.info-value select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e8eef1;
    font-size: 12px;
}

/* Status indicator */
.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-indicator.online {
    background: #27ae60;
    box-shadow: 0 0 10px rgba(39, 174, 96, 0.5);
}

.status-indicator.offline {
    background: #e74c3c;
}

/* Task form */
.task-form {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 15px;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.task-form h3 {
    margin-bottom: 10px;
    font-weight: 300;
    font-size: 14px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.task-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.task-form .form-group label {
    font-size: 11px;
    color: #a0aab8;
}

.task-form .form-group input,
.task-form .form-group select,
.task-form .form-group textarea {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 6px 10px;
    color: #e8eef1;
    font-family: inherit;
    font-size: 12px;
}

.task-form .form-group textarea {
    min-height: 50px;
    resize: vertical;
}

.task-form .form-group input:focus,
.task-form .form-group select:focus,
.task-form .form-group textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
}

.task-form .btn-row {
    margin-top: 15px;
}

/* Tasks container */
#tasks-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
    min-height: 0;
}

/* Task items */
.task-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.task-id {
    font-weight: 300;
    font-size: 12px;
    color: #a0aab8;
}

.task-type {
    background: rgba(52, 73, 94, 0.6);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 11px;
    color: #a0aab8;
    margin-bottom: 6px;
}

.task-command {
    background: rgba(0, 0, 0, 0.2);
    padding: 5px 10px;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
    font-size: 11px;
    margin-bottom: 6px;
    word-break: break-all;
}

.task-output {
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 10px;
    border-radius: 6px;
    font-family: 'Consolas', monospace;
    font-size: 11px;
    white-space: pre-wrap;
    word-break: break-all;
}

.task-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.empty-tasks {
    text-align: center;
    padding: 20px;
    color: #a0aab8;
    font-size: 13px;
}

/* Collapsible output */
.collapsible {
    cursor: pointer;
}

.collapsible::before {
    content: '▶ ';
    font-size: 10px;
}

.collapsible.expanded::before {
    content: '▼ ';
}

.output-section {
    display: none;
    margin-top: 10px;
}

.output-section.visible {
    display: block;
}

/* Toggle switch */
.toggle-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.toggle-switch {
    position: relative;
    width: 40px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    transition: 0.3s;
}

.toggle-slider:before {
    position: absolute;
    content: '';
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background: #e8eef1;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background: #27ae60;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 12px;
    color: #a0aab8;
}

/* Scheduled options */
.scheduled-options {
    display: none;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.scheduled-options.visible {
    display: block;
}

/* Agent tabs */
.agent-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.agent-tab-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #a0aab8;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.agent-tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e8eef1;
}

.agent-tab-btn.active {
    background: rgba(255, 255, 255, 0.15);
    color: #e8eef1;
    border-color: rgba(255, 255, 255, 0.2);
}

.agent-tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.agent-tab-content.active {
    display: block;
}

/* Scheduled task items */
.scheduled-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.scheduled-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.scheduled-id {
    font-weight: 300;
    font-size: 12px;
    color: #a0aab8;
}

.scheduled-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 11px;
    color: #a0aab8;
}

.status.enabled {
    background: rgba(39, 174, 96, 0.2);
    color: #27ae60;
}

.status.disabled {
    background: rgba(150, 150, 150, 0.2);
    color: #aaa;
}

/* Clear all button */
.btn.clear-all {
    background: #dc3545;
}

/* =====================================================
   First Check-in / Settings Page Styles
   ===================================================== */

/* Section description text */
.section-description {
    color: #a0aab8;
    font-size: 12px;
    margin-bottom: 15px;
}

/* Full width settings form */
.settings-form.full-width {
    max-width: none;
}

/* Settings form with margin */
.settings-form.spaced {
    margin-bottom: 15px;
}

/* Settings section title */
.settings-title {
    margin-bottom: 10px;
    font-weight: 300;
    color: #e8eef1;
    font-size: 13px;
}

/* Account info row */
.account-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.account-info span {
    color: #a0aab8;
    font-size: 12px;
}

.account-info strong {
    color: #e8eef1;
    font-weight: 300;
}

/* FCT (First Check-in Task) form grid */
.fct-form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.fct-form-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

/* FCT form group */
.fct-form-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.fct-form-group label {
    font-size: 11px;
    color: #a0aab8;
}

.fct-form-group select,
.fct-form-group input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 6px 10px;
    color: #e8eef1;
    font-family: inherit;
    font-size: 12px;
}

/* Command line group */
.fct-command-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 15px;
}

.fct-command-group label {
    font-size: 11px;
    color: #a0aab8;
}

.fct-command-group input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 6px 10px;
    color: #e8eef1;
    font-family: inherit;
    font-size: 12px;
}

/* FCT status row (button + badge style) */
.fct-status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    color: #a0aab8;
}

/* FCT toggle row (legacy) */
.fct-toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.fct-toggle-label {
    font-size: 12px;
    color: #a0aab8;
}

/* FCT button row */
.fct-button-row {
    display: flex;
    gap: 10px;
}

/* Button spacing */
.btn.ml-10 {
    margin-left: 10px;
}

.header-actions .user-info {
    color: #a0aab8;
    font-size: 14px;
}

.header-actions .user-info strong {
    color: #e8eef1;
    font-weight: 300;
}
