/* PortLines — estilos globais */

:root {
    --pl-primary:    #0d6efd;
    --pl-dark:       #1a1d23;
    --pl-sidebar-bg: #1e2330;
    --pl-sidebar-w:  260px;
    --pl-topbar-h:   60px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f4f6fb;
    margin: 0;
}

/* ── Sidebar ── */
#sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--pl-sidebar-w);
    height: 100vh;
    background: var(--pl-sidebar-bg);
    color: #c8cdd8;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: width .25s;
    overflow: hidden;
}

#sidebar .sidebar-brand {
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: var(--pl-topbar-h);
    border-bottom: 1px solid rgba(255,255,255,.07);
    flex-shrink: 0;
}

#sidebar .sidebar-brand img { height: 32px; }
#sidebar .sidebar-brand span {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    margin-left: 10px;
    white-space: nowrap;
}

#sidebar .sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

#sidebar .nav-section {
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #5a6375;
    padding: 16px 20px 4px;
}

#sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 20px;
    color: #c8cdd8;
    text-decoration: none;
    border-radius: 0;
    font-size: .875rem;
    transition: background .15s, color .15s;
    white-space: nowrap;
}

#sidebar .nav-link i { width: 18px; text-align: center; font-size: .9rem; }
#sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
#sidebar .nav-link.active  { background: rgba(13,110,253,.2); color: #5ea1ff; border-right: 3px solid var(--pl-primary); }

#sidebar .sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,.07);
    font-size: .8rem;
    color: #5a6375;
}

/* ── Topbar ── */
#topbar {
    position: fixed;
    top: 0;
    left: var(--pl-sidebar-w);
    right: 0;
    height: var(--pl-topbar-h);
    background: #fff;
    border-bottom: 1px solid #e5e9f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 999;
}

.topbar-title { font-weight: 600; font-size: 1rem; color: #2d3748; }

/* ── Main content ── */
#main-content {
    margin-left: var(--pl-sidebar-w);
    padding-top: var(--pl-topbar-h);
    min-height: 100vh;
}

.page-content { padding: 28px 28px; }

/* ── Cards ── */
.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px 24px;
    border: 1px solid #e5e9f0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-card .stat-label { font-size: .8rem; color: #6b7280; margin-top: 2px; }

/* ── Tables ── */
.table-card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e5e9f0;
    overflow: hidden;
}

.table-card .table-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e5e9f0;
}

.table-card .table-header h6 { margin: 0; font-weight: 600; }

.table { margin: 0; }
.table th { background: #f8fafc; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; border-color: #e5e9f0; }
.table td { vertical-align: middle; border-color: #f0f2f5; font-size: .875rem; }
.table tbody tr:hover { background: #f8fafc; }

/* ── Forms ── */
.form-card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e5e9f0;
    padding: 28px;
}

.form-label { font-weight: 500; font-size: .875rem; color: #374151; }
.form-control, .form-select { border-color: #d1d9e0; font-size: .875rem; }
.form-control:focus, .form-select:focus { border-color: var(--pl-primary); box-shadow: 0 0 0 3px rgba(13,110,253,.12); }

/* ── Badges ── */
.badge { font-size: .7rem; font-weight: 600; padding: .35em .6em; }

/* ── Botões ── */
.btn { font-size: .875rem; border-radius: 7px; }
.btn-sm { font-size: .78rem; }

/* ── Login page ── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e2330 0%, #0d6efd 100%);
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

.login-card .logo { display: block; margin: 0 auto 24px; max-height: 60px; }
.login-card h4 { font-weight: 700; text-align: center; margin-bottom: 4px; }
.login-card .subtitle { text-align: center; color: #6b7280; font-size: .875rem; margin-bottom: 28px; }

/* ── Tickets ── */
.ticket-message { border-radius: 8px; padding: 14px 16px; margin-bottom: 14px; }
.ticket-message.from-admin { background: #eff6ff; border-left: 3px solid #3b82f6; }
.ticket-message.from-client { background: #f0fdf4; border-left: 3px solid #22c55e; }
.ticket-message.internal { background: #fffbeb; border-left: 3px solid #f59e0b; }

/* ── Responsive ── */
@media (max-width: 768px) {
    #sidebar { width: 0; }
    #topbar, #main-content { left: 0; margin-left: 0; }
    #sidebar.open { width: var(--pl-sidebar-w); }
}
