/* style.css - Sistema Oficina */

:root {
    --blue-primary:  #2196F3;
    --blue-dark:     #1565C0;
    --blue-light:    #E3F2FD;
    --aqua:          #00BCD4;
    --aqua-light:    #E0F7FA;
    --gray-light:    #F5F6FA;
    --gray-mid:      #CFD8DC;
    --gray-text:     #546E7A;
    --white:         #FFFFFF;
    --danger:        #E53935;
    --success:       #43A047;
    --sidebar-width: 230px;
    --shadow:        0 2px 8px rgba(0,0,0,.10);
    --radius:        6px;
    --font:          Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font);
    font-size: 14px;
    background: var(--gray-light);
    color: #263238;
    min-height: 100vh;
}

/* LAYOUT */
.layout { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1E88E5 0%, #1976D2 60%, #1565C0 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    box-shadow: 2px 0 8px rgba(0,0,0,.18);
    transition: transform .25s;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(0,0,0,.12);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .5px;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,.10);
    flex-shrink: 0;
}

nav.sidebar-nav { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; padding: 6px 0; min-height: 0; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; }

.nav-item { list-style: none; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    color: rgba(255,255,255,.85);
    text-decoration: none;
    font-size: 13px;
    cursor: pointer;
    transition: background .15s;
    user-select: none;
}

.nav-link:hover,
.nav-link.active { background: rgba(255,255,255,.22); color: #fff; }

.nav-arrow { margin-left: auto; transition: transform .2s; display:flex; align-items:center; }
.nav-item.open > .nav-link .nav-arrow { transform: rotate(90deg); }

.submenu { display: none; list-style: none; background: rgba(0,0,0,.12); }
.nav-item.open > .submenu { display: block; }
.submenu .nav-link { padding-left: 46px; font-size: 13px; }

.sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,.10);
}

.sidebar-footer a {
    color: rgba(255,255,255,.7);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.sidebar-footer a:hover { color: #fff; }

/* MAIN */
.main-wrap {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    height: 56px;
    background: var(--white);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title { font-size: 16px; font-weight: 600; color: #263238; }

#relogio-top {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 16px;
    font-weight: 600;
    color: #263238;
    white-space: nowrap;
    pointer-events: none;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-text);
    font-size: 13px;
    margin-left: auto;
}

.avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--aqua);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.content { padding: 24px; flex: 1; }

/* CARD */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 24px;
    margin-bottom: 20px;
}

.card-title { font-size: 15px; font-weight: 600; color: #263238; margin-bottom: 16px; }

/* FORMS */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px 18px;
}

.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group.full { grid-column: 1 / -1; }

label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-text);
    text-transform: uppercase;
    letter-spacing: .4px;
}

input, select, textarea {
    padding: 8px 10px;
    border: 1px solid var(--gray-mid);
    border-radius: 4px;
    font-family: var(--font);
    font-size: 13.5px;
    color: #263238;
    background: var(--white);
    text-transform: uppercase;
    transition: border .15s, box-shadow .15s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 3px rgba(33,150,243,.12);
}

input:disabled, select:disabled {
    background: #ECEFF1;
    color: #90A4AE;
    cursor: not-allowed;
}

.radio-group { display: flex; gap: 20px; align-items: center; padding-top: 4px; }
.radio-group label { text-transform: none; font-size: 13px; font-weight: 400; color: #263238; display: flex; align-items: center; gap: 5px; cursor: pointer; }

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: none;
    border-radius: 4px;
    font-family: var(--font);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, transform .1s;
}

.btn:active { transform: scale(.97); }
.btn-primary   { background: var(--blue-primary); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-secondary { background: var(--gray-mid); color: #263238; }
.btn-secondary:hover { background: #B0BEC5; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #C62828; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }

/* SVG icons in buttons and nav */
.btn svg, .nav-link svg, .view-section svg { vertical-align: middle; flex-shrink: 0; }
.btn svg { margin-right: 2px; }

/* TABLE */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead tr { background: var(--blue-light); }
th {
    padding: 10px 12px;
    text-align: left;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--blue-dark);
    font-weight: 700;
    white-space: nowrap;
}
td { padding: 9px 12px; border-bottom: 1px solid #ECEFF1; vertical-align: middle; }
tbody tr:nth-child(odd)  { background: #FFFFFF; }
tbody tr:nth-child(even) { background: #DCDCDC; }
tbody tr:hover { background: #B2EBF2 !important; }
tbody tr:hover td { background: transparent; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.badge-pf { background: var(--aqua-light); color: #006064; }
.badge-pj { background: #FFF9C4; color: #F57F17; }

/* ALERTS */
.alert { padding: 10px 16px; border-radius: var(--radius); font-size: 13px; margin-bottom: 14px; }
.alert-danger  { background: #FFEBEE; color: var(--danger); border-left: 4px solid var(--danger); }
.alert-success { background: #E8F5E9; color: var(--success); border-left: 4px solid var(--success); }
.alert-info    { background: var(--aqua-light); color: #006064; border-left: 4px solid var(--aqua); }

/* LOGIN */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1E88E5 0%, #42A5F5 100%);
}

.login-card {
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 8px 40px rgba(0,0,0,.20);
    padding: 40px 36px;
    width: 100%;
    max-width: 380px;
}

.login-logo { text-align: center; margin-bottom: 28px; color: #1565C0; }
.login-logo h1 { font-size: 26px; letter-spacing: 2px; }
.login-logo p  { font-size: 12px; color: var(--gray-text); margin-top: 4px; }

/* PAGE HEADER */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.page-header h2 { font-size: 20px; font-weight: 700; color: #263238; }
.breadcrumb { font-size: 12px; color: var(--gray-text); margin-top: 2px; }
.breadcrumb span { color: var(--blue-primary); }

.section-divider { height: 1px; background: var(--gray-mid); margin: 20px 0; grid-column: 1/-1; }

/* RESPONSIVE */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-wrap { margin-left: 0; }
    .form-grid { grid-template-columns: 1fr; }
    .menu-toggle { display: flex !important; }
}

.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--gray-text);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 99;
}

.sidebar-overlay.visible { display: block; }
