/* ========== DEMO OVERLAY ========== */
.demo-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    backdrop-filter: blur(3px);
}
.demo-overlay.active { display: block; }

/* ========== MODAL VENTANA ========== */
.demo-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 950px;
    max-width: 96vw;
    max-height: 90vh;
    background: #e9e9e9;
    border-radius: 0;
    box-shadow: 0 10px 50px rgba(0,0,0,0.5);
    z-index: 10000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 13px;
    color: #333;
    animation: demoIn 0.2s ease;
}
.demo-modal.active { display: flex; }
@keyframes demoIn { from { opacity:0; transform:translate(-50%,-48%); } to { opacity:1; transform:translate(-50%,-50%); } }

/* Navbar */
.demo-navbar {
    background: #292929;
    border-bottom: 1px solid #000;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    flex-shrink: 0;
}
.demo-navbar .dm-left { display: flex; align-items: center; gap: 10px; }
.demo-navbar .vp-icon { width: 28px; height: 28px; background: #F47708; color: #fff; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; }
.demo-navbar .dm-empresa { color: #fff; font-size: 13px; font-weight: 600; }
.demo-navbar .dm-tag { background: rgba(244,119,8,0.2); color: #ff9a3c; padding: 2px 10px; border-radius: 2px; font-size: 10px; font-weight: 600; }
.demo-navbar .dm-right { display: flex; align-items: center; gap: 10px; }
.demo-navbar .dm-user { color: #fff; font-size: 12px; display: flex; align-items: center; gap: 6px; }
.demo-navbar .dm-user img { width: 28px; height: 28px; border-radius: 50%; }
.demo-close-x { background: transparent; border: 1px solid rgba(255,255,255,0.2); color: #888; padding: 4px 10px; border-radius: 0; font-size: 11px; cursor: pointer; font-family: inherit; }
.demo-close-x:hover { border-color: #F47708; color: #F47708; }

/* Contenido */
.demo-content { flex: 1; overflow-y: auto; padding: 14px; background: #e9e9e9; }

/* Widget */
.demo-widget { background: #FFF; border: 1px solid #D5D5D5; border-radius: 0; margin-bottom: 10px; }
.demo-widget-head { padding: 8px 14px; background: #0480be; color: #fff; font-size: 14px; font-weight: 400; }
.demo-widget-body { padding: 10px; }
.demo-widget-toolbar { padding: 8px 10px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid #eee; }

/* Filtros */
.demo-filters { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.demo-filters select, .demo-filters input[type="text"] { padding: 5px 8px; border: 1px solid #ccc; border-radius: 0; font-size: 12px; font-family: inherit; }
.demo-filters input[type="text"] { width: 160px; }
.demo-filters select { min-width: 130px; }

/* Botones Bootstrap 3 */
.dbtn { display: inline-flex; align-items: center; gap: 3px; padding: 5px 12px; border: none; border-radius: 0; font-size: 12px; font-family: inherit; cursor: pointer; font-weight: 600; text-shadow: 0 -1px 0 rgba(0,0,0,0.2); color: #fff; }
.dbtn-xs { padding: 3px 7px; font-size: 11px; }
.dbtn-success { background: linear-gradient(to bottom, #5cb85c, #449d44); border: 1px solid #419641; }
.dbtn-success:hover { background: #449d44; }
.dbtn-info { background: linear-gradient(to bottom, #5bc0de, #31b0d5); border: 1px solid #2aabd2; }
.dbtn-info:hover { background: #31b0d5; }
.dbtn-danger { background: linear-gradient(to bottom, #d9534f, #c9302c); border: 1px solid #c12e2a; }
.dbtn-danger:hover { background: #c9302c; }
.dbtn-warning { background: linear-gradient(to bottom, #ffbb1c, #e8a300); border: 1px solid #de9b00; }
.dbtn-warning:hover { background: #e8a300; }
.dbtn-primary { background: linear-gradient(to bottom, #ff9900, #cc7a00); border: 1px solid #c27400; }
.dbtn-primary:hover { background: #cc7a00; }
.dbtn-default { background: linear-gradient(to bottom, #fff, #e6e6e6); border: 1px solid #ccc; color: #333; text-shadow: none; }
.dbtn-default:hover { background: #e6e6e6; }
.dbtn-group { display: flex; gap: 2px; }

/* Tabla */
.dtable-wrap { overflow-x: auto; }
.dtable { width: 100%; border-collapse: collapse; font-size: 9pt; background: #fff; }
.dtable th { background: #f9f9f9; border: 1px solid #ddd; padding: 7px 8px; font-weight: 700; font-size: 9pt; text-transform: uppercase; color: #333; text-align: left; }
.dtable td { border: 1px solid #ddd; padding: 6px 8px; vertical-align: middle; }
.dtable tr:nth-child(even) td { background: #f9f9f9; }
.dtable tr:hover td { background: #f5f5f5; }
.dtable .pull-right { float: right; }

/* Dots */
.dot { display: inline-block; width: 13px; height: 13px; border-radius: 50%; float: left; margin-top: 2px; }
.dot-green { background: #00aa00; }
.dot-yellow { background: #ffff00; }
.dot-red { background: #ff0000; }
.dot-blue { background: blue; }

/* Thumbnail artículo */
.art-thumb { width: 36px; height: 36px; background: #eee; border-radius: 2px; display: inline-flex; align-items: center; justify-content: center; color: #ccc; font-size: 16px; margin-right: 6px; vertical-align: middle; border: 1px solid #ddd; }

/* Form box */
.demo-form-box { background: #fff; border: 1px solid #D5D5D5; max-width: 700px; margin: 0 auto; }
.demo-form-box .dfb-head { padding: 9px 15px; background: #0480be; color: #fff; font-size: 15px; display: flex; justify-content: space-between; align-items: center; font-weight: 400; }
.demo-form-box .dfb-head button { background: none; border: none; color: #fff; font-size: 18px; cursor: pointer; opacity: 0.7; }
.demo-form-box .dfb-head button:hover { opacity: 1; }
.demo-form-box .dfb-body { padding: 14px; }
.demo-form-box .dfb-foot { padding: 10px 14px; border-top: 1px solid #eee; display: flex; gap: 6px; justify-content: flex-end; }

/* Form fields */
.dfg { margin-bottom: 8px; }
.dfg label { display: block; margin-bottom: 2px; font-weight: 600; font-size: 12px; color: #555; }
.dfg input, .dfg select, .dfg textarea { width: 100%; padding: 6px 10px; border: 1px solid #ccc; border-radius: 0; font-size: 13px; font-family: inherit; }
.dfg input:focus, .dfg select:focus { outline: none; border-color: #66afe9; box-shadow: 0 0 4px rgba(102,175,233,0.4); }
.dfg-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dfg-ta { width: 100%; padding: 6px 10px; border: 1px solid #ccc; border-radius: 0; font-size: 13px; font-family: inherit; resize: vertical; }

/* Tabs internos (DATOS / AVANZADO) */
.demo-tabs-inner { display: flex; border-bottom: 1px solid #ddd; margin-bottom: 12px; }
.dti { padding: 8px 16px; background: none; border: 1px solid transparent; border-bottom: none; cursor: pointer; font-size: 12px; font-family: inherit; color: #337ab7; margin-bottom: -1px; border-radius: 0; }
.dti:hover { background: #eee; border-color: #ddd #ddd transparent; }
.dti.active { background: #fff; border-color: #ddd #ddd #fff; color: #333; font-weight: 600; }

/* Input group */
.dinput-group { display: flex; }
.dinput-group input { flex: 1; border-radius: 0; border-right: none; }
.dinput-addon { display: flex; align-items: center; justify-content: center; width: 36px; background: #eee; border: 1px solid #ccc; border-left: none; font-size: 12px; }

/* Stats */
.demo-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 12px; }
.demo-stat { background: #fff; border: 1px solid #D5D5D5; padding: 14px; display: flex; align-items: center; gap: 12px; }
.demo-stat i { font-size: 26px; opacity: 0.5; }
.demo-stat strong { display: block; font-size: 20px; color: #333; }
.demo-stat small { font-size: 10px; color: #888; }

/* Alerts & Total */
.demo-alert { padding: 10px 14px; border: 1px solid transparent; font-size: 12px; margin: 8px 0; }
.demo-alert-ok { background: #dff0d8; color: #3c763d; border-color: #d6e9c6; }
.demo-total { background: #f5f5f5; border: 1px solid #ddd; border-top: 2px solid #F47708; padding: 8px 14px; text-align: right; font-size: 14px; }
.demo-total strong { font-size: 17px; color: #F47708; }

/* POS Layout */
.pos-layout { display: flex; gap: 10px; }
.pos-left { flex: 2; min-width: 0; }
.pos-right { flex: 1; min-width: 260px; }

/* Tabla de totales del POS */
.pos-totals { width: 100%; border-collapse: collapse; font-size: 13px; }
.pos-totals td { padding: 6px 14px; border-bottom: 1px solid #eee; }
.pos-totals td:first-child { font-weight: 600; color: #333; }
.pos-totals td:last-child { text-align: right; color: #333; }
.pos-totals .pos-total-row { background: #292929; }
.pos-totals .pos-total-row td { color: #fff; font-size: 18px; padding: 10px 14px; border: none; }

/* Report tabs */
.rep-tab-active { background: #fff; border: 1px solid #ddd; border-bottom: 1px solid #fff !important; margin-bottom: -1px; }

/* Empty */
.demo-empty { text-align: center; padding: 30px; color: #aaa; font-size: 12px; }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .demo-modal { width: 98vw; max-height: 95vh; }
    .demo-navbar .dm-tag { display: none; }
    .demo-navbar .dm-user strong { display: none; }
    .demo-content { padding: 8px; }
    .demo-widget-toolbar { flex-direction: column; align-items: flex-start; }
    .demo-filters { width: 100%; }
    .demo-filters input[type="text"] { width: 100%; }
    .dfg-row { grid-template-columns: 1fr; }
    .pos-layout { flex-direction: column; }
    .pos-right { min-width: 0; }
}
@media (max-width: 480px) {
    .demo-navbar .dm-user { display: none; }
    .demo-navbar .dm-empresa { font-size: 11px; }
}
