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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    display: flex;
    min-height: 100vh;
}

/* LOGIN */
body.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111111;
}
.login-container {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    width: 380px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.login-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin-bottom: 30px;
}
.logo-icon { font-size: 32px; }
.logo-text { font-size: 26px; font-weight: 700; color: #e8890c; }

/* SIDEBAR */
.sidebar {
    width: 230px;
    min-height: 100vh;
    background: #111111;
    color: #fff;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0; top: 0; bottom: 0;
    overflow-y: auto;
    z-index: 100;
}
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 18px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-user {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-username { font-weight: 600; font-size: 14px; }
.sidebar-credits { font-size: 12px; color: #e8890c; margin-top: 2px; }
.sidebar-nav { padding: 10px 0; flex: 1; }
.nav-section {
    font-size: 10px;
    color: rgba(255,255,255,0.4);
    padding: 12px 18px 4px;
    letter-spacing: 1px;
    font-weight: 600;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s, color 0.15s;
    border-radius: 0;
}
.nav-item:hover { background: rgba(232,137,12,0.15); color: #e8890c; }
.nav-item.active { background: rgba(232,137,12,0.2); color: #e8890c; font-weight: 600; }
.nav-icon { font-size: 16px; width: 20px; }

/* MAIN CONTENT */
.main-content {
    margin-left: 230px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.topbar {
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.topbar-title { font-size: 22px; font-weight: 700; color: #1a1a2e; }
.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #555;
}
.avatar {
    width: 34px; height: 34px;
    background: #e8890c;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 14px;
}

/* PAGE CONTENT */
.page-content { padding: 28px; }
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 22px;
}
.page-title { font-size: 26px; font-weight: 700; }
.page-subtitle { font-size: 13px; color: #888; margin-top: 2px; }

/* CARDS */
.card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    overflow: visible;
}
.card-body { padding: 20px; }

/* DASHBOARD STATS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px,1fr));
    gap: 18px;
    margin-bottom: 28px;
}
.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    display: flex;
    align-items: center;
    gap: 16px;
}
.stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    background: rgba(232,137,12,0.12);
}
.stat-value { font-size: 26px; font-weight: 700; }
.stat-label { font-size: 12px; color: #888; }

/* TABLE */
.table-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    flex-wrap: wrap;
}
.search-input {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f7f7f7;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 8px 14px;
    flex: 1;
    min-width: 200px;
}
.search-input input {
    border: none; background: transparent;
    outline: none; font-size: 14px; width: 100%;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
thead th {
    background: #fafafa;
    border-bottom: 1px solid #eee;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #555;
    font-size: 13px;
}
tbody tr { border-bottom: 1px solid #f4f4f4; transition: background 0.1s; }
tbody tr:hover { background: #fdf6ee; }
tbody td { padding: 13px 16px; vertical-align: middle; }
.user-name { font-weight: 600; color: #e8890c; font-size: 14px; }
.user-sub { font-size: 12px; color: #888; }

/* BADGES */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.badge-success { background: #e8f5e9; color: #2e7d32; }
.badge-danger  { background: #fce4ec; color: #c62828; }
.badge-warning { background: #fff8e1; color: #f57f17; }
.badge-info    { background: #e3f2fd; color: #1565c0; }
.badge-secondary { background: #f3f3f3; color: #666; }

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: opacity 0.15s, transform 0.1s;
}
.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-primary { background: #e8890c; color: #fff; }
.btn-success { background: #2e7d32; color: #fff; }
.btn-danger  { background: #c62828; color: #fff; }
.btn-secondary { background: #eee; color: #555; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-actions { background: #f5f5f5; color: #333; border: 1px solid #ddd; padding: 6px 14px; border-radius: 6px; }
.w-100 { width: 100%; justify-content: center; }

/* DROPDOWN */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
    display: none;
    position: fixed;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    min-width: 190px;
    z-index: 9999;
    padding: 6px 0;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    text-decoration: none;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    transition: background 0.1s;
}
.dropdown-item:hover { background: #fdf6ee; color: #e8890c; }
.dropdown-item.whatsapp { color: #25d366; }
.dropdown-item.whatsapp:hover { background: #e8f5e9; }
.dropdown-item.danger { color: #c62828; }
.dropdown-item.danger:hover { background: #fce4ec; }
.dropdown-divider { border: none; border-top: 1px solid #f0f0f0; margin: 4px 0; }

/* MODAL */
.modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
    background: #fff;
    border-radius: 14px;
    width: 520px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(0,0,0,0.2);
}
.modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close {
    background: none; border: none; font-size: 22px;
    cursor: pointer; color: #aaa; line-height: 1;
}
.modal-close:hover { color: #333; }
.modal-body { padding: 20px 24px; }
.modal-footer {
    padding: 14px 24px 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-top: 1px solid #f0f0f0;
}

/* FORMS */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #444; }
.form-control {
    width: 100%;
    padding: 9px 13px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s;
    background: #fafafa;
}
.form-control:focus { border-color: #e8890c; background: #fff; box-shadow: 0 0 0 3px rgba(232,137,12,0.1); }
select.form-control { cursor: pointer; }

/* ALERTS */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-danger { background: #fce4ec; color: #c62828; border: 1px solid #ef9a9a; }
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #aaa;
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state-text { font-size: 16px; }

/* ADIAR SUBMENU */
.submenu {
    display: none;
    position: fixed;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    min-width: 130px;
    z-index: 10000;
    padding: 6px 0;
}
.has-submenu:hover > .submenu { display: block; }
.has-submenu { position: relative; cursor: pointer; }
.has-submenu::after { content: " ◀"; font-size: 10px; color: #aaa; }

@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .sidebar-logo .logo-text, .sidebar-user, .nav-section, .nav-item span:last-child { display: none; }
    .main-content { margin-left: 60px; }
    .form-row { grid-template-columns: 1fr; }
}

.venc-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-top:10px;}
.card-header-title{padding:14px 20px;font-weight:700;font-size:15px;border-bottom:1px solid #f0f0f0;color:#333;}
.dias-badge{display:inline-block;padding:4px 10px;border-radius:20px;font-size:12px;font-weight:600;white-space:nowrap;}
.status-red{background:#fce4ec;color:#c62828;}
.status-yellow{background:#fff8e1;color:#f57f17;}
.status-green{background:#e8f5e9;color:#2e7d32;}
.input-icon-wrap{position:relative;}
.input-icon-wrap .form-control{padding-right:40px;}
.input-icon-btn{position:absolute;right:10px;top:50%;transform:translateY(-50%);background:none;border:none;cursor:pointer;font-size:16px;color:#aaa;line-height:1;}
.input-icon-btn:hover{color:#333;}
@media(max-width:900px){.venc-grid{grid-template-columns:1fr;}}

th[data-sort]{cursor:pointer;user-select:none;}
th[data-sort]:after{content:' ⇅';font-size:11px;color:#bbb;}
th.sort-asc:after{content:' ▲';color:#e8820c;}
th.sort-desc:after{content:' ▼';color:#e8820c;}
.pagebar{display:flex;align-items:center;justify-content:space-between;padding:12px 20px;border-top:1px solid #f0f0f0;flex-wrap:wrap;gap:8px;}
.pagebar-left{display:flex;align-items:center;gap:8px;font-size:13px;color:#666;}
.pagebar-right{display:flex;align-items:center;gap:6px;}
.page-btn{border:1px solid #e8e8e8;background:#fff;border-radius:6px;padding:4px 10px;cursor:pointer;font-size:13px;}
.page-btn.active{background:#e8820c;color:#fff;border-color:#e8820c;}
.page-btn:hover:not(.active){background:#f5f5f5;}
.search-clear{background:none;border:none;cursor:pointer;font-size:16px;color:#aaa;padding:0 6px;line-height:1;}
.search-clear:hover{color:#e8820c;}
select.per-page{border:1px solid #ddd;border-radius:6px;padding:4px 8px;font-size:13px;}

.date-input-wrap{position:relative;}
.date-input-wrap input{width:100%;}

.datepicker-wrap{position:relative;display:flex;align-items:center;}
.datepicker-wrap input.date-vis{flex:1;border-radius:8px 0 0 8px;border-right:none;}
.datepicker-wrap .cal-btn{background:#f0f0f0;border:1px solid #ddd;border-left:none;border-radius:0 8px 8px 0;padding:0 10px;cursor:pointer;font-size:16px;height:42px;display:flex;align-items:center;transition:background .2s;}
.datepicker-wrap .cal-btn:hover{background:#e8820c;color:#fff;}
.datepicker-wrap input.date-native{position:absolute;opacity:0;width:1px;height:1px;pointer-events:none;}
