@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=DM+Sans:wght@300;400;500;600&display=swap');
@import url('https://fonts.googleapis.com/icon?family=Material+Icons+Round');

:root {
    --verde:      #0D4F3C;
    --verde-dark: #0A3020;
    --verde-light:#E8F2EE;
    --dourado:    #C9A84C;
    --bg:         #F4F6F8;
    --branco:     #ffffff;
    --borda:      #E2E8F0;
    --texto:      #1a202c;
    --muted:      #718096;
    --radius:     12px;
    --sombra:     0 2px 16px rgba(0,0,0,0.07);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--texto); min-height: 100vh; }
a { text-decoration: none; color: inherit; }

/* HEADER */
.header {
    background: var(--verde);
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky; top: 0; z-index: 100;
}
.header-logo { display: flex; align-items: center; gap: 12px; }
.header-logo-mark {
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(201,168,76,0.15);
    border: 1.5px solid var(--dourado);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Playfair Display', serif;
    font-size: 14px; font-weight: 700; color: var(--dourado);
}
.header-logo-text { line-height: 1.2; }
.header-logo-nome { font-size: 15px; font-weight: 600; color: #fff; }
.header-logo-tag  { font-size: 10px; color: var(--dourado); font-style: italic; }
.header-right { display: flex; align-items: center; gap: 16px; }
.header-user { font-size: 13px; color: rgba(255,255,255,0.7); }
.btn-sair {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.8);
    padding: 6px 14px; border-radius: 20px;
    font-size: 13px; cursor: pointer;
    display: flex; align-items: center; gap: 6px;
    font-family: 'DM Sans', sans-serif;
    transition: background .2s;
}
.btn-sair:hover { background: rgba(255,255,255,0.2); }

/* MAIN */
.main { max-width: 900px; margin: 0 auto; padding: 32px 24px; }

/* CARDS */
.card {
    background: var(--branco);
    border-radius: var(--radius);
    border: 1px solid var(--borda);
    box-shadow: var(--sombra);
    overflow: hidden;
    margin-bottom: 20px;
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--borda);
    display: flex; align-items: center; justify-content: space-between;
}
.card-header h2 {
    font-size: 15px; font-weight: 600;
    display: flex; align-items: center; gap: 8px; color: var(--verde);
}
.card-header h2 .material-icons-round { font-size: 18px; }
.card-body { padding: 20px; }

/* FORMULÁRIOS */
.form-group { margin-bottom: 16px; }
label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px; }
input[type=text], input[type=email], input[type=password], input[type=tel] {
    width: 100%; padding: 10px 14px;
    border: 1.5px solid var(--borda); border-radius: 8px;
    font-family: 'DM Sans', sans-serif; font-size: 14px; color: var(--texto);
    transition: border-color .2s;
}
input:focus { outline: none; border-color: var(--verde); }

/* BOTÕES */
.btn {
    padding: 10px 20px; border-radius: 8px;
    font-size: 14px; font-weight: 600;
    cursor: pointer; display: inline-flex;
    align-items: center; gap: 7px; border: none;
    font-family: 'DM Sans', sans-serif; transition: all .2s;
}
.btn-primary { background: var(--verde); color: #fff; }
.btn-primary:hover { background: var(--verde-dark); }
.btn-secondary { background: var(--bg); color: var(--texto); border: 1px solid var(--borda); }
.btn-full { width: 100%; justify-content: center; padding: 12px; }

/* FLASH */
.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 20px; display: flex; align-items: center; gap: 10px; font-size: 14px; }
.flash-success { background: #F0FFF4; color: #276749; border: 1px solid #C6F6D5; }
.flash-danger  { background: #FFF5F5; color: #C53030; border: 1px solid #FED7D7; }
.flash .material-icons-round { font-size: 18px; }

/* TIMELINE DE STATUS */
.timeline {
    display: flex; align-items: center;
    margin: 24px 0; overflow-x: auto;
    padding-bottom: 8px;
}
.tl-step {
    display: flex; flex-direction: column;
    align-items: center; gap: 6px;
    flex: 1; min-width: 100px; position: relative;
}
.tl-step::after {
    content: '';
    position: absolute; top: 20px; left: 50%;
    width: 100%; height: 2px;
    background: var(--borda); z-index: 0;
}
.tl-step:last-child::after { display: none; }
.tl-dot {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--borda);
    background: var(--branco); z-index: 1;
    transition: all .3s;
}
.tl-dot .material-icons-round { font-size: 20px; color: var(--muted); }
.tl-label { font-size: 11px; font-weight: 500; color: var(--muted); text-align: center; }
.tl-step.ativo .tl-dot { background: var(--verde); border-color: var(--verde); }
.tl-step.ativo .tl-dot .material-icons-round { color: #fff; }
.tl-step.ativo .tl-label { color: var(--verde); font-weight: 700; }
.tl-step.concluido .tl-dot { background: var(--verde-light); border-color: var(--verde); }
.tl-step.concluido .tl-dot .material-icons-round { color: var(--verde); }
.tl-step.concluido::after { background: var(--verde); }
.tl-step.finalizado .tl-dot { background: #38A169; border-color: #38A169; }
.tl-step.finalizado .tl-dot .material-icons-round { color: #fff; }
.tl-step.cancelado .tl-dot { background: #FFF5F5; border-color: #E53E3E; }
.tl-step.cancelado .tl-dot .material-icons-round { color: #E53E3E; }

/* LISTA DE PROTOCOLOS */
.protocolo-item {
    display: flex; align-items: center; gap: 16px;
    padding: 16px 20px; border-bottom: 1px solid var(--borda);
    text-decoration: none; color: inherit;
    transition: background .15s;
}
.protocolo-item:last-child { border-bottom: none; }
.protocolo-item:hover { background: #FAFBFC; }
.protocolo-icon {
    width: 44px; height: 44px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.protocolo-info { flex: 1; }
.protocolo-codigo { font-size: 13px; font-weight: 700; color: var(--verde); }
.protocolo-servico { font-size: 14px; font-weight: 500; color: var(--texto); margin: 2px 0; }
.protocolo-data { font-size: 12px; color: var(--muted); }
.protocolo-status {
    font-size: 11px; font-weight: 700;
    padding: 4px 12px; border-radius: 20px;
    white-space: nowrap;
}

/* HISTÓRICO */
.historico-item {
    display: flex; gap: 14px; padding: 14px 0;
    border-bottom: 1px solid var(--borda);
}
.historico-item:last-child { border-bottom: none; }
.historico-dot {
    width: 10px; height: 10px; border-radius: 50%;
    flex-shrink: 0; margin-top: 5px;
}
.historico-data { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.historico-msg  { font-size: 14px; color: var(--texto); line-height: 1.6; }

/* UPLOAD */
.upload-zone {
    border: 2px dashed var(--borda); border-radius: var(--radius);
    padding: 24px; text-align: center; cursor: pointer;
    transition: border-color .2s;
}
.upload-zone:hover { border-color: var(--verde); }
.upload-zone .material-icons-round { font-size: 36px; color: var(--muted); display: block; margin-bottom: 8px; }
.upload-zone p { font-size: 13px; color: var(--muted); margin-bottom: 12px; }

/* BADGE STATUS */
.badge-status {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 600;
    padding: 6px 14px; border-radius: 20px;
}

/* LOGIN PAGE */
.login-wrap {
    min-height: 100vh; display: flex;
    align-items: center; justify-content: center;
    padding: 20px; background: var(--verde-dark);
}
.login-box {
    background: var(--branco); border-radius: 16px;
    padding: 40px; width: 100%; max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo-mark {
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--verde); border: 2px solid var(--dourado);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 12px;
    font-family: 'Playfair Display', serif;
    font-size: 20px; font-weight: 700; color: var(--dourado);
}
.login-logo h1 { font-size: 18px; color: var(--verde); margin-bottom: 2px; }
.login-logo p  { font-size: 12px; color: var(--muted); }
.login-divider {
    text-align: center; font-size: 12px; color: var(--muted);
    margin: 20px 0; position: relative;
}
.login-divider::before, .login-divider::after {
    content: ''; position: absolute; top: 50%;
    width: calc(50% - 30px); height: 1px; background: var(--borda);
}
.login-divider::before { left: 0; }
.login-divider::after  { right: 0; }

/* DOCUMENTOS */
.doc-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0; border-bottom: 1px solid var(--borda);
}
.doc-item:last-child { border-bottom: none; }
.doc-icon { color: var(--verde); font-size: 22px; }
.doc-nome { font-size: 13.5px; font-weight: 500; flex: 1; }
.doc-data { font-size: 11px; color: var(--muted); }
.doc-enviado-por { font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.doc-enviado-por.cliente { background: #EBF4FF; color: #2B6CB0; }
.doc-enviado-por.admin   { background: var(--verde-light); color: var(--verde); }

@media (max-width: 600px) {
    .main { padding: 20px 16px; }
    .timeline { flex-wrap: wrap; gap: 12px; }
    .tl-step::after { display: none; }
    .tl-step { flex: 0 0 calc(50% - 6px); }
}
