/* Clone estilo portal login - internet.rdsystem.es */
:root {
    --bg-page: #0f172a;
    --bg-box: #1e293b;
    --border: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --error-bg: #7f1d1d;
    --error-text: #fecaca;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-page);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-wrap {
    width: 100%;
    max-width: 420px;
}

.login-box {
    background: var(--bg-box);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.login-title {
    margin: 0 0 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
}

.login-form .form-group {
    margin-bottom: 1.25rem;
}

.login-form label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.login-form input[type="email"],
.login-form input[type="password"] {
    width: 100%;
    padding: 0.65rem 0.75rem;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-page);
    color: var(--text);
    transition: border-color 0.2s;
}

.login-form input:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group-check input[type="checkbox"] {
    width: auto;
    accent-color: var(--accent);
}

.form-group-check label {
    margin-bottom: 0;
    cursor: pointer;
}

.btn {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary {
    background: var(--accent);
    color: white;
    margin-top: 0.5rem;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.forgot-link {
    margin: 1.25rem 0 0;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.forgot-link a {
    color: var(--accent);
    text-decoration: none;
}

.forgot-link a:hover {
    text-decoration: underline;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid #991b1b;
}

.alert-success {
    background: #14532d;
    color: #bbf7d0;
    border: 1px solid #166534;
}

.reset-link-wrap {
    margin: 0.75rem 0;
    word-break: break-all;
}

.reset-link {
    color: var(--accent);
    font-size: 0.85rem;
}

/* ----- Layout tipo rdsystem: page-container, header, sidebar, content ----- */
body.page-header-fixed {
    display: block;
    min-height: 100vh;
    padding: 0;
    justify-content: flex-start;
}

.page-container {
    min-height: 100vh;
    padding-left: 220px;
    background: #1a2332;
}

/* Header */
.header.navbar-default {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #242f3f;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1020;
}

.navbar-header { display: flex; align-items: center; }
.navbar-brand {
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.25rem;
}
.navbar-brand-text { color: var(--text); }
.navbar-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 6px;
}
.navbar-toggle .icon-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-muted);
    margin: 4px 0;
}

.navbar-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.navbar-nav .nav-link-icon {
    padding: 12px 14px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 1.1rem;
}
.navbar-nav .nav-link-icon:hover { color: var(--text); }

.dropdown.navbar-user { position: relative; }
.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    border: none;
    background: none;
}
.dropdown-toggle img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}
.user-avatar-placeholder {
    display: none;
    font-size: 28px;
    color: var(--text-muted);
}
.dropdown-toggle .caret {
    margin-left: 4px;
    border-top: 4px solid currentColor;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
}
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 180px;
    background: var(--bg-box);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 0;
    margin-top: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    z-index: 1050;
}
.dropdown.show .dropdown-menu { display: block; }
.dropdown-item {
    display: block;
    padding: 8px 16px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
}
.dropdown-item:hover { background: rgba(255,255,255,0.06); }
.mr-2 { margin-right: 8px; }

/* Sidebar */
#sidebar.sidebar {
    position: fixed;
    left: 0;
    top: 60px;
    bottom: 0;
    width: 220px;
    background: #2d353c;
    overflow-y: auto;
    z-index: 1010;
}
.sidebar .nav {
    list-style: none;
    margin: 0;
    padding: 0;
}
.sidebar .nav > li > a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}
.sidebar .nav > li > a i { width: 20px; text-align: center; }
.sidebar .nav > li > a:hover {
    color: #fff;
    background: rgba(0,0,0,0.2);
}
.sidebar .nav > li.active > a {
    color: #fff;
    background: rgba(0,0,0,0.25);
    border-left-color: #00acac;
}
/* Submenú Planes */
.sidebar .nav > li.has-sub > a .caret {
    margin-left: auto;
    border-top: 4px solid currentColor;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
    transition: transform 0.2s;
}
.sidebar .nav > li.has-sub.expanded > a .caret {
    transform: rotate(180deg);
}
.sidebar .nav > li.has-sub > a {
    position: relative;
}
.sidebar .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}
.sidebar .nav > li.has-sub.expanded .sub-menu {
    max-height: 200px;
}
.sidebar .sub-menu li a {
    display: block;
    padding: 10px 20px 10px 44px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
}
.sidebar .sub-menu li a:hover {
    color: #fff;
    background: rgba(0,0,0,0.15);
}
.sidebar .sub-menu li.active a {
    color: #fff;
    background: rgba(0,0,0,0.2);
    border-left-color: #00acac;
}
.nav-divider { height: 1px; background: rgba(0,0,0,0.2); margin: 8px 0; list-style: none; }

.nav-profile {
    position: relative;
    padding: 20px;
    min-height: 90px;
}
.sidebar-cover {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d353c 100%);
    opacity: 0.9;
}
.nav-profile .image {
    position: relative;
    margin-bottom: 8px;
}
.nav-profile .image a { text-decoration: none; }
.nav-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0,0,0,0.3);
    color: rgba(255,255,255,0.8);
    font-size: 1.25rem;
}
.nav-profile .info {
    position: relative;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
}
.nav-profile .info small {
    display: block;
    color: rgba(255,255,255,0.6);
    font-size: 0.75rem;
    font-weight: 400;
}

.sidebar-bg {
    position: fixed;
    left: 0;
    top: 60px;
    bottom: 0;
    width: 220px;
    background: #2d353c;
    z-index: 1000;
}

/* Content */
#content.content {
    margin-left: 0;
    padding: 80px 25px 25px;
    min-height: 100vh;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
    font-size: 0.85rem;
}
.breadcrumb.float-xl-right { justify-content: flex-end; }
.breadcrumb-item + .breadcrumb-item::before { content: '/'; padding: 0 8px; color: var(--text-muted); }
.breadcrumb-item a { color: var(--accent); text-decoration: none; }
.breadcrumb-item a:hover { text-decoration: underline; }
.breadcrumb-item.active { color: var(--text-muted); }

.page-header {
    margin: 0 0 20px;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
}

/* Widget stats (estilo rdsystem) */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px 20px;
}
.col-xl-3, .col-md-6 {
    padding: 0 10px;
    margin-bottom: 20px;
}
.col-xl-3 { flex: 0 0 25%; max-width: 25%; }
.col-xl-12 { flex: 0 0 100%; max-width: 100%; padding: 0 10px; }
@media (max-width: 1200px) {
    .col-xl-3 { flex: 0 0 50%; max-width: 50%; }
}
@media (max-width: 768px) {
    .col-xl-3, .col-md-6 { flex: 0 0 100%; max-width: 100%; }
    .page-container { padding-left: 0; }
    #sidebar.sidebar { transform: translateX(-100%); transition: transform 0.2s; }
    body.sidebar-toggled #sidebar.sidebar { transform: translateX(0); }
    .navbar-toggle { display: block; }
    #content.content { padding-top: 70px; }
}

.widget.widget-stats {
    padding: 20px;
    border-radius: 8px;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.widget-stats .stats-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    opacity: 0.3;
}
.widget-stats .stats-info h4 {
    margin: 0 0 4px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}
.widget-stats .stats-info p {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
}
.widget-stats > div:not(.stats-icon):not(.stats-info) {
    margin-top: 8px;
    font-size: 0.85rem;
    opacity: 0.9;
}
.widget-stats .stats-progress {
    height: 4px;
    background: rgba(0,0,0,0.2);
    border-radius: 2px;
    margin-top: 10px;
    overflow: hidden;
}
.widget-stats .stats-link {
    margin-top: 12px;
}
.widget-stats .stats-link a {
    color: rgba(255,255,255,0.95);
    text-decoration: none;
    font-size: 0.9rem;
}
.widget-stats .stats-link a:hover { text-decoration: underline; }
.widget-stats .progress .progress-bar { height: 100%; border-radius: 2px; background: rgba(255,255,255,0.7); transition: width 0.3s; }
.text-uppercase { text-transform: uppercase; }

.bg-blue { background: #348fe2; }
.bg-pink { background: #ec458d; }
.bg-lime { background: #8dc63f; }
.bg-dark { background: #2d353c; }
.bg-teal { background: #00acac; }
.bg-orange { background: #e4862a; }
.bg-indigo { background: #5b69bc; }
.bg-red { background: #b64848; }

.d-none { display: none !important; }
@media (min-width: 768px) {
    .d-md-inline { display: inline !important; }
}

/* Panel */
.panel.panel-default {
    background: var(--bg-box);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 20px;
}
.panel-heading {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.panel-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}
.panel-body { padding: 20px; }
.panel-body.border-panel { border: none; }

/* ----- Dashboard (legacy / fallback) ----- */
.body-dashboard { display: block; min-height: 100vh; padding: 0; }
.main-content {
    margin-left: 220px;
    padding: 1.5rem 2rem;
    max-width: 900px;
}
.page-title { margin: 0 0 1.5rem; font-size: 1.35rem; }
.sidebar-brand { font-weight: 700; padding: 0 1.25rem 1rem; }
.sidebar-nav { padding: 0 0.5rem; }
.sidebar-link {
    display: block;
    padding: 0.6rem 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
}
.sidebar-link:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.sidebar-link.active { background: var(--accent); color: white; }
.sidebar-footer { padding: 1rem 1.25rem 0; border-top: 1px solid var(--border); }
.sidebar-user { display: block; font-size: 0.8rem; color: var(--text-muted); }

.dashboard-wrap {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.dashboard-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.btn-logout {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--border);
    color: var(--text);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-logout:hover {
    background: #475569;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.card {
    background: var(--bg-box);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.card-highlight {
    grid-column: 1 / -1;
}

.card h2 {
    margin: 0 0 0.75rem;
    font-size: 1.1rem;
}

.card p {
    margin: 0;
    color: var(--text-muted);
}

.card p + p {
    margin-top: 0.35rem;
}

.link-more {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--accent);
    text-decoration: none;
}

.link-more:hover {
    text-decoration: underline;
}

.text-success { color: #86efac; }

.progress-bar {
    height: 8px;
    background: var(--bg-page);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 0.3s;
}

.progress-inline {
    display: inline-block;
    width: 60px;
    height: 6px;
    background: var(--bg-page);
    border-radius: 3px;
    overflow: hidden;
    vertical-align: middle;
    margin-right: 4px;
}

.progress-inline .progress-fill {
    height: 6px;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 4px;
    text-transform: capitalize;
}

.badge-success { background: #166534; color: #bbf7d0; }
.badge-warning { background: #854d0e; color: #fef08a; }
.badge-danger { background: #991b1b; color: #fecaca; }

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.data-table th,
.data-table td {
    padding: 0.65rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
}

.data-table tbody tr:hover {
    background: rgba(255,255,255,0.02);
}

.form-inline .form-group {
    margin-bottom: 1rem;
}

.form-inline .btn {
    width: auto;
    margin-top: 0.5rem;
}

.input-disabled {
    background: var(--bg-page) !important;
    color: var(--text-muted);
    cursor: not-allowed;
}

.login-form input[type="text"] {
    width: 100%;
    padding: 0.65rem 0.75rem;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-page);
    color: var(--text);
}

.login-form input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 0.75rem 1rem;
    }
    .sidebar-brand { margin-bottom: 0.5rem; width: 100%; border: none; }
    .sidebar-nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 0; flex: none; }
    .sidebar-footer { border: none; padding: 0 0 0 auto; display: flex; align-items: center; gap: 0.5rem; }
    .main-content { margin-left: 0; padding: 1rem; }
}
