/* Palette and type come from tokens.css + design-system.css aliases. */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    display: flex;
    height: 100vh;
    background-color: var(--background);
    color: var(--text);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

/* Sidebar Layout */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--rv-color-secondary, #1C1917);
    border-right: 1px solid color-mix(in srgb, #ffffff 12%, transparent);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 10;
    color: #F5F0E8;
}

.brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: #F5F0E8;
    border-bottom: 1px solid color-mix(in srgb, #ffffff 12%, transparent);
    letter-spacing: -0.02em;
}

.brand-logo {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-md);
    margin-right: 10px;
    object-fit: cover;
}

.nav-menu {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
}

.sidebar-footer {
    padding: 12px 24px 16px;
    font-size: 12px;
    color: color-mix(in srgb, #F5F0E8 65%, transparent);
    border-top: 1px solid color-mix(in srgb, #ffffff 12%, transparent);
}

.nav-group-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 700;
    padding: 0 24px;
    margin: 16px 0 8px 0;
}

.nav-group-title:first-child {
    margin-top: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
    color: color-mix(in srgb, #F5F0E8 72%, transparent);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--rv-motion-base) ease;
}

.nav-link:hover {
    color: #F5F0E8;
    background-color: color-mix(in srgb, #ffffff 8%, transparent);
}

.nav-link.active {
    color: #F5F0E8;
    background-color: color-mix(in srgb, var(--primary) 35%, transparent);
    border-right: 3px solid var(--primary);
}

/* Main Wrapper */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Header Layout */
.header {
    height: var(--header-height);
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    flex-shrink: 0;
}

.header-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    letter-spacing: -0.02em;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-role {
    font-size: 13px;
    color: var(--text-muted);
}

.avatar {
    width: 32px;
    height: 32px;
    background-color: var(--background);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
}

/* Content Area */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
}

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

.display-title {
    font-family: var(--font-heading);
    font-size: 40px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 12px 0;
    letter-spacing: -0.03em;
}

.subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
    max-width: 650px;
    line-height: 1.5;
}

.header-actions {
    margin-top: 0;
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.public-logo {
    display: block;
    margin-bottom: 16px;
    border-radius: 12px;
}

/* Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: var(--rv-button-height);
    padding: 0 16px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background-color var(--rv-motion-fast) ease;
}

.icon {
    display: block;
    flex-shrink: 0;
}

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

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

/* Data List */
.list-container {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.list-header {
    display: grid;
    grid-template-columns: 2.5fr 2fr 1.5fr 1fr 1fr;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background-color: #FAFAFB;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
}

.list-item {
    display: grid;
    grid-template-columns: 2.5fr 2fr 1.5fr 1fr 1fr;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    align-items: center;
    transition: background-color 0.15s ease;
}

.list-item:hover {
    background-color: rgba(249, 250, 251, 0.6);
}

.list-item:last-child {
    border-bottom: none;
}

/* Column Specifics */
.job-name {
    display: block;
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.job-script {
    display: block;
    font-family: monospace;
    font-size: 12px;
    color: var(--text-muted);
}

.place-name {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
}

.place-device {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
}

.cron-expression {
    display: block;
    font-family: monospace;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
    letter-spacing: 0.1em;
}

.cron-translation {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
}

.col-age {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.col-status {
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
}

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

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

/* Status Dots */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-dot.success {
    background-color: var(--success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.status-dot.danger {
    background-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.status-dot.warning {
    background-color: var(--warning);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.public-home {
    max-width: 720px;
    margin: 0 auto;
    padding: 64px 24px;
}

.callback-sample {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    overflow-x: auto;
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 12px;
    line-height: 1.5;
}

.table-scroll {
    overflow-x: auto;
}

.form-stack {
    max-width: 720px;
}

@media (max-width: 800px) {
    body {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .nav-menu {
        display: flex;
        flex-wrap: wrap;
        padding: 8px 0;
        overflow-y: visible;
    }

    .nav-link {
        border-right: none;
        padding: 10px 16px;
    }

    .nav-link.active {
        border-right: none;
        border-bottom: 3px solid var(--primary);
    }

    .header {
        padding: 0 16px;
        height: auto;
        min-height: var(--header-height);
        flex-wrap: wrap;
        gap: 8px;
    }

    .content {
        padding: 16px;
    }

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

    .form-stack {
        max-width: none;
    }
}
