/* CTO Signage Cloud CMS — PT Centra Teknokominfo Optima */

:root {
    --cto-navy: #0b1f3a;
    --cto-navy-soft: #142c4d;
    --cto-navy-line: #24406b;
    --cto-gold: #f5b301;
    --cto-teal: #14b8a6;
    --cto-ink: #10233d;
    --cto-muted: #6b7c93;
    --cto-surface: #f4f6fa;
    --cto-card: #ffffff;
    --cto-danger: #dc2626;
    --cto-radius: 12px;
}

html, body {
    margin: 0;
    background: var(--cto-surface);
    color: var(--cto-ink);
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
}

/* ---------------------------------------------------------------- shell */

.cms-shell {
    display: flex;
    min-height: 100vh;
}

.cms-sidebar {
    width: 264px;
    flex: 0 0 264px;
    background: linear-gradient(180deg, var(--cto-navy) 0%, #081729 100%);
    color: #e8eefb;
    display: flex;
    flex-direction: column;
}

.cms-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 18px;
    border-bottom: 1px solid var(--cto-navy-line);
}

.cms-brand-mark {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--cto-gold);
    color: var(--cto-navy);
    font-weight: 800;
    letter-spacing: 0.5px;
    font-size: 15px;
}

.cms-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.cms-brand-text strong {
    font-size: 16px;
    letter-spacing: 0.3px;
}

.cms-brand-text small {
    color: #9db2d6;
    font-size: 11px;
}

.cms-nav {
    display: flex;
    flex-direction: column;
    padding: 14px 10px 24px;
    gap: 2px;
    flex: 1;
}

.cms-nav-section {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #7d93b8;
    padding: 14px 10px 6px;
}

.cms-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: #cdd9ee;
    text-decoration: none;
    font-size: 14px;
    transition: background 120ms ease, color 120ms ease;
}

.cms-nav-link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
}

.cms-nav-link.active {
    background: var(--cto-gold);
    color: var(--cto-navy);
    font-weight: 600;
}

.cms-nav-icon {
    width: 18px;
    text-align: center;
    font-size: 13px;
}

.cms-nav-footer {
    margin-top: auto;
    padding: 14px 12px 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: #6e83a8;
    border-top: 1px solid var(--cto-navy-line);
}

/* ------------------------------------------------------------------ main */

.cms-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cms-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f3;
    padding: 12px 22px;
    flex-wrap: wrap;
}

.cms-topbar-left,
.cms-topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cms-workspace-name {
    font-weight: 600;
    font-size: 15px;
}

.cms-realtime {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--cto-muted);
}

.cms-realtime i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c3cbd8;
    display: inline-block;
}

.cms-realtime.is-live i {
    background: var(--cto-teal);
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.18);
}

.cms-usage {
    font-size: 12px;
    color: var(--cto-muted);
}

.cms-logout {
    margin: 0;
}

.cms-content {
    padding: 22px;
    flex: 1;
}

/* ----------------------------------------------------------------- cards */

.cms-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.cms-page-header h1 {
    margin: 0;
    font-size: 22px;
}

.cms-page-header p {
    margin: 4px 0 0;
    color: var(--cto-muted);
    font-size: 13px;
}

.card {
    background: var(--cto-card);
    border: 1px solid #e2e8f3;
    border-radius: var(--cto-radius);
    box-shadow: 0 1px 2px rgba(11, 31, 58, 0.04);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid #eef2f8;
    font-weight: 600;
    font-size: 14px;
}

.cms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.cms-stat {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cms-stat .value {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.1;
}

.cms-stat .label {
    color: var(--cto-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.cms-meter {
    height: 10px;
    border-radius: 999px;
    background: #e6ecf6;
    overflow: hidden;
}

.cms-meter > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--cto-teal), var(--cto-gold));
}

/* --------------------------------------------------------------- badges */

.badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 999px;
}

.badge-plan { background: #e8eefb; color: var(--cto-navy); }
.badge-trial { background: #fff4d6; color: #8a6100; }
.badge-warn { background: #fde8e8; color: var(--cto-danger); }
.badge-online { background: #d9f6f0; color: #0f766e; }
.badge-offline { background: #f1f3f7; color: #64748b; }
.badge-unpaired { background: #fff4d6; color: #8a6100; }

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

.status-dot.online { background: var(--cto-teal); }
.status-dot.offline { background: #94a3b8; }
.status-dot.unpaired { background: var(--cto-gold); }

/* --------------------------------------------------------------- tables */

.cms-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.cms-table th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--cto-muted);
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f3;
    white-space: nowrap;
}

.cms-table td {
    padding: 12px;
    border-bottom: 1px solid #f1f4f9;
    vertical-align: middle;
}

.cms-table tr:last-child td {
    border-bottom: none;
}

/* ---------------------------------------------------------- zone preview */

.zone-canvas {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #0b1f3a;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--cto-navy-line);
}

.zone-canvas .zone {
    position: absolute;
    border: 1px dashed rgba(245, 179, 1, 0.7);
    background: rgba(20, 184, 166, 0.12);
    color: #e8eefb;
    font-size: 11px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.zone-canvas .zone strong {
    color: var(--cto-gold);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

/* ------------------------------------------------------ pairing + dropzone */

.pairing-code {
    font-family: "SFMono-Regular", ui-monospace, Menlo, monospace;
    font-size: 40px;
    font-weight: 700;
    letter-spacing: 10px;
    color: var(--cto-navy);
    background: #f4f6fa;
    border: 1px dashed var(--cto-navy-line);
    border-radius: 12px;
    padding: 14px 22px;
    text-align: center;
}

.dropzone {
    border: 2px dashed #c3cfe3;
    border-radius: var(--cto-radius);
    padding: 28px;
    text-align: center;
    color: var(--cto-muted);
    background: #fbfcfe;
    transition: border-color 120ms ease, background 120ms ease;
}

.dropzone.is-over {
    border-color: var(--cto-teal);
    background: #f0fbf9;
}

.media-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
    background: #0b1f3a;
}

.swatch {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    background: #eef2f8;
    color: var(--cto-navy);
    font-weight: 600;
}

.slide-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #e2e8f3;
    border-radius: 10px;
    background: #fff;
    margin-bottom: 8px;
}

.slide-row .order {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--cto-navy);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.slide-row .title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.week-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(120px, 1fr));
    gap: 10px;
}

.week-column {
    background: #fbfcfe;
    border: 1px solid #e2e8f3;
    border-radius: 10px;
    padding: 10px;
    min-height: 140px;
}

.week-column h4 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--cto-muted);
    margin: 0 0 8px;
}

.schedule-chip {
    background: #e8eefb;
    border-left: 3px solid var(--cto-teal);
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 11px;
    margin-bottom: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.schedule-chip .time {
    font-weight: 700;
    color: var(--cto-navy);
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 20% 20%, #16375f 0%, #0b1f3a 55%, #061224 100%);
    padding: 24px;
}

.login-card {
    width: min(460px, 100%);
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 24px 60px rgba(3, 12, 26, 0.45);
}

.login-card h1 {
    font-size: 22px;
    margin: 0 0 4px;
}

.login-card .sub {
    color: var(--cto-muted);
    font-size: 13px;
    margin-bottom: 18px;
}

.preview-frame {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #0b1f3a;
    border-radius: 10px;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: #e8eefb;
    text-align: center;
    padding: 12px;
}

.watermark-overlay {
    position: absolute;
    right: 12px;
    bottom: 10px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.72);
    letter-spacing: 0.4px;
}

@media (max-width: 900px) {
    .cms-shell { flex-direction: column; }
    .cms-sidebar { width: 100%; flex: none; }
    .week-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
}