/* RPA Test ERP - main styles. IE11 compatible (no CSS variables in critical paths, no grid). */

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    font-size: 14px;
    color: #222;
    background: #f1f4f8;
    height: 100%;
}

#app-shell {
    min-height: 100%;
}

/* Header */
#app-header {
    background: #1f2d3d;
    color: #fff;
    padding: 0 16px;
    height: 56px;
    line-height: 56px;
    display: block;
    position: relative;
    border-bottom: 1px solid #15202b;
}

#app-header .brand {
    display: inline-block;
    font-weight: bold;
    margin-right: 24px;
    vertical-align: middle;
}

#app-header .brand .logo {
    color: #4fc3f7;
    margin-right: 6px;
}

#app-header .user-area {
    position: absolute;
    right: 16px;
    top: 0;
    height: 56px;
    line-height: 56px;
}

#app-header .user-area #user-name {
    margin-right: 12px;
    color: #c8d1da;
}

#app-header .user-area button {
    background: #ef5350;
    color: #fff;
    border: none;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 3px;
}

#app-header .user-area button:hover { background: #d32f2f; }

#app-header .user-area .lang-select {
    margin-right: 12px;
    padding: 4px 6px;
    border: 1px solid #4a5a6a;
    border-radius: 3px;
    background: #2a3b50;
    color: #e8edf2;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    vertical-align: middle;
}

/* Top tabs */
.top-tabs {
    display: inline-block;
    vertical-align: middle;
}

.top-tab {
    display: inline-block;
    color: #c8d1da;
    text-decoration: none;
    padding: 0 14px;
    height: 56px;
    line-height: 56px;
    border-bottom: 3px solid transparent;
}

.top-tab:hover {
    color: #fff;
    background: #2a3b50;
}

.top-tab.active {
    color: #fff;
    border-bottom-color: #4fc3f7;
    background: #2a3b50;
}

/* Main content area */
#page-container {
    padding: 20px;
    min-height: calc(100vh - 56px - 32px);
    position: relative;
}

.page-loading {
    position: absolute;
    top: 20px;
    left: 50%;
    margin-left: -40px;
    background: #ffeb3b;
    padding: 6px 12px;
    border-radius: 3px;
    z-index: 100;
    font-weight: bold;
}

#app-footer {
    background: #e0e6ed;
    color: #5a6877;
    padding: 6px 16px;
    height: 32px;
    line-height: 20px;
    font-size: 12px;
    border-top: 1px solid #c5cdd6;
}

#app-footer #current-route {
    float: right;
    font-family: Consolas, "Courier New", monospace;
}

/* Page card layout */
.page-card {
    background: #fff;
    border: 1px solid #d4dae0;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 16px;
}

.page-card h1, .page-card h2 {
    margin-top: 0;
}

.page-card h1 { font-size: 22px; color: #1f2d3d; }
.page-card h2 { font-size: 17px; color: #2a3b50; border-bottom: 1px solid #e0e6ed; padding-bottom: 6px; margin-top: 20px; }

.row {
    display: block;
    margin-bottom: 12px;
}

.row:after {
    content: "";
    display: block;
    clear: both;
}

.col-half { width: 49%; display: inline-block; vertical-align: top; margin-right: 1%; }
.col-third { width: 32%; display: inline-block; vertical-align: top; margin-right: 1%; }
.col-quarter { width: 24%; display: inline-block; vertical-align: top; margin-right: 1%; }
.col-full { width: 100%; display: block; }

label.field {
    display: block;
    margin-bottom: 12px;
}

label.field > span.label-text {
    display: block;
    font-weight: bold;
    margin-bottom: 4px;
    color: #2a3b50;
}

.form-grid label.field {
    margin-bottom: 14px;
}

/* Native form controls */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
input[type="color"],
textarea,
select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #b0bac4;
    border-radius: 3px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
}

textarea { min-height: 80px; resize: vertical; }

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #4fc3f7;
    box-shadow: 0 0 0 2px rgba(79,195,247,0.25);
}

input[type="checkbox"], input[type="radio"] {
    margin-right: 6px;
    vertical-align: middle;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 6px 14px;
    background: #e0e6ed;
    color: #2a3b50;
    border: 1px solid #b0bac4;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    text-decoration: none;
    line-height: 1.4;
}

.btn:hover { background: #c8d1da; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
    background: #1976d2;
    color: #fff;
    border-color: #1565c0;
}
.btn-primary:hover { background: #1565c0; }

.btn-success {
    background: #43a047;
    color: #fff;
    border-color: #2e7d32;
}
.btn-success:hover { background: #2e7d32; }

.btn-warning {
    background: #fb8c00;
    color: #fff;
    border-color: #ef6c00;
}
.btn-warning:hover { background: #ef6c00; }

.btn-danger {
    background: #e53935;
    color: #fff;
    border-color: #c62828;
}
.btn-danger:hover { background: #c62828; }

.btn-link {
    background: transparent;
    border: none;
    color: #1976d2;
    padding: 2px 6px;
    text-decoration: underline;
}

.btn-sm { padding: 3px 8px; font-size: 12px; }

/* Tables */
table.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #d4dae0;
}

table.data-table th, table.data-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e0e6ed;
    text-align: left;
    vertical-align: middle;
}

table.data-table th {
    background: #f5f7fa;
    font-weight: bold;
    color: #2a3b50;
    cursor: pointer;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

table.data-table th .sort-indicator {
    font-size: 10px;
    color: #8a99ab;
    margin-left: 4px;
}

table.data-table tr:hover td { background: #f5f9fc; }
table.data-table tr.selected td { background: #e3f2fd; }

.table-toolbar {
    display: block;
    margin-bottom: 10px;
}
.table-toolbar:after { content: ""; display: block; clear: both; }
.table-toolbar .left { float: left; }
.table-toolbar .right { float: right; }

.pagination {
    margin-top: 12px;
    text-align: center;
}

.pagination .btn { margin: 0 2px; }
.pagination .btn.active { background: #1976d2; color: #fff; border-color: #1565c0; }
.pagination .page-info { display: inline-block; padding: 0 10px; color: #5a6877; }

/* Status badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}
.badge-active   { background: #c8e6c9; color: #2e7d32; }
.badge-pending  { background: #fff9c4; color: #f57f17; }
.badge-shipped  { background: #bbdefb; color: #1565c0; }
.badge-cancelled{ background: #ffcdd2; color: #c62828; }
.badge-inactive { background: #cfd8dc; color: #455a64; }

/* Alerts (static, page-level) */
.alert {
    padding: 10px 14px;
    border-radius: 3px;
    margin-bottom: 12px;
    border-left: 4px solid #888;
}
.alert-info    { background: #e3f2fd; border-color: #1976d2; color: #0d47a1; }
.alert-success { background: #e8f5e9; border-color: #43a047; color: #1b5e20; }
.alert-warning { background: #fff8e1; border-color: #fb8c00; color: #e65100; }
.alert-danger  { background: #ffebee; border-color: #e53935; color: #b71c1c; }

/* Dashboard cards */
.dash-card {
    background: #fff;
    border: 1px solid #d4dae0;
    border-radius: 4px;
    padding: 16px;
    display: inline-block;
    width: 23%;
    margin-right: 1%;
    vertical-align: top;
    margin-bottom: 12px;
}
.dash-card .label { color: #8a99ab; font-size: 12px; text-transform: uppercase; }
.dash-card .value { font-size: 26px; font-weight: bold; color: #1f2d3d; margin: 6px 0; }
.dash-card .delta { font-size: 12px; }
.dash-card .delta.up { color: #43a047; }
.dash-card .delta.down { color: #e53935; }

/* Lazy product grid */
.product-grid { display: block; }
.product-grid:after { content: ""; display: block; clear: both; }

.product-card {
    width: 23%;
    margin-right: 1%;
    margin-bottom: 14px;
    float: left;
    background: #fff;
    border: 1px solid #d4dae0;
    border-radius: 4px;
    padding: 10px;
    min-height: 180px;
}
.product-card .thumb {
    width: 100%;
    height: 100px;
    background: #e0e6ed center center no-repeat;
    background-size: cover;
    border-radius: 3px;
    margin-bottom: 8px;
    color: #8a99ab;
    text-align: center;
    line-height: 100px;
    font-size: 11px;
}
.product-card .pname { font-weight: bold; margin-bottom: 4px; }
.product-card .pprice { color: #1976d2; font-weight: bold; }
.product-card .pcat { color: #8a99ab; font-size: 12px; }

#load-more-sentinel {
    text-align: center;
    padding: 14px;
    color: #8a99ab;
}

/* Internal tabs widget */
.tabs-container {
    border: 1px solid #d4dae0;
    background: #fff;
    border-radius: 4px;
}
.tabs-nav {
    background: #f5f7fa;
    border-bottom: 1px solid #d4dae0;
    padding: 0;
}
.tabs-nav .tab-item {
    display: inline-block;
    padding: 10px 18px;
    cursor: pointer;
    border-right: 1px solid #d4dae0;
    background: #f5f7fa;
}
.tabs-nav .tab-item.active {
    background: #fff;
    border-bottom: 2px solid #1976d2;
    font-weight: bold;
    color: #1565c0;
}
.tabs-panel {
    padding: 16px;
    display: none;
}
.tabs-panel.active { display: block; }

/* Misc */
.muted { color: #8a99ab; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mr-1 { margin-right: 8px; }
.hidden { display: none !important; }

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #c8d1da;
    border-top-color: #1976d2;
    border-radius: 50%;
    -webkit-animation: spin 0.8s linear infinite;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}
@-webkit-keyframes spin { to { -webkit-transform: rotate(360deg); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Tree view */
.tree, .tree ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}
.tree ul.tree-children {
    padding-left: 18px;
    border-left: 1px dashed #c8d1da;
    margin-left: 9px;
}
.tree-node { display: block; }
.tree-row {
    display: block;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 3px;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    white-space: nowrap;
}
.tree-row:hover { background: #e3f2fd; }
.tree-row.selected { background: #1976d2; color: #fff; }
.tree-toggle {
    display: inline-block;
    width: 16px;
    text-align: center;
    color: #5a6877;
    font-size: 10px;
}
.tree-node.tree-leaf > .tree-row .tree-toggle { visibility: hidden; }
.tree-icon {
    display: inline-block;
    width: 22px;
    text-align: center;
    color: #fb8c00;
    font-family: Consolas, "Courier New", monospace;
    font-size: 11px;
    background: #fff3e0;
    border: 1px solid #ffe0b2;
    border-radius: 2px;
    margin-right: 6px;
    padding: 0 3px;
}
.tree-node.tree-leaf > .tree-row .tree-icon {
    color: #1976d2;
    background: #e3f2fd;
    border-color: #bbdefb;
}
.tree-row.selected .tree-icon { background: #1565c0; color: #fff; border-color: #0d47a1; }
.tree-label { font-weight: bold; }
.tree-node.tree-leaf > .tree-row .tree-label { font-weight: normal; }
.tree-count, .tree-meta {
    color: #8a99ab;
    font-size: 12px;
    margin-left: 8px;
    font-weight: normal;
}
.tree-row.selected .tree-count,
.tree-row.selected .tree-meta { color: #bbdefb; }
.tree-toolbar {
    margin-bottom: 10px;
}
.tree-toolbar input[type="search"] {
    width: 280px;
    display: inline-block;
}

/* Context menu */
.context-menu {
    position: fixed;
    background: #fff;
    border: 1px solid #b0bac4;
    border-radius: 3px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
    z-index: 2000;
    min-width: 220px;
    padding: 4px 0;
    display: none;
    font-size: 13px;
}
.context-menu.open { display: block; }
.context-menu-header {
    padding: 6px 14px;
    font-size: 11px;
    color: #8a99ab;
    text-transform: uppercase;
    border-bottom: 1px solid #e0e6ed;
    background: #f5f7fa;
    font-weight: bold;
}
.context-menu-item {
    padding: 7px 14px;
    cursor: pointer;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    color: #2a3b50;
}
.context-menu-item:hover {
    background: #1976d2;
    color: #fff;
}
.context-menu-item.danger { color: #c62828; }
.context-menu-item.danger:hover { background: #c62828; color: #fff; }
.context-menu-item.disabled { color: #b0bac4; cursor: not-allowed; }
.context-menu-item.disabled:hover { background: transparent; color: #b0bac4; }
.context-menu-separator {
    height: 1px;
    background: #e0e6ed;
    margin: 4px 0;
}
.context-menu-shortcut {
    float: right;
    color: #8a99ab;
    font-size: 11px;
    margin-left: 18px;
}
.context-menu-item:hover .context-menu-shortcut { color: #bbdefb; }
.context-menu-item.danger:hover .context-menu-shortcut { color: #ffcdd2; }

/* ============================================================
   Flying dropdown menu groups
   ============================================================ */

.top-menu-group {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    height: 56px;
}

.top-group-trigger {
    display: inline-block;
    color: #c8d1da;
    padding: 0 16px;
    height: 56px;
    line-height: 56px;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-transition: color 0.15s ease, background 0.15s ease;
    transition: color 0.15s ease, background 0.15s ease;
}

.top-menu-group:hover .top-group-trigger {
    color: #fff;
    background: #2a3b50;
}

.top-menu-group.has-active .top-group-trigger {
    color: #fff;
    background: #2a3b50;
    border-bottom-color: #4fc3f7;
}

.group-caret {
    font-size: 9px;
    margin-left: 4px;
    display: inline-block;
    vertical-align: middle;
    -webkit-transition: -webkit-transform 0.2s ease;
    -ms-transition: -ms-transform 0.2s ease;
    transition: transform 0.2s ease;
}

.top-menu-group:hover .group-caret {
    -webkit-transform: rotate(180deg);
    -ms-transform: rotate(180deg);
    transform: rotate(180deg);
}

/* ---- Fly-out dropdown panel ---- */

.top-menu-fly {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 210px;
    background: #182534;
    border: 1px solid #0d1821;
    border-top: 3px solid #4fc3f7;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.25);
    z-index: 600;
    overflow: hidden;

    /* hidden state */
    opacity: 0;
    visibility: hidden;
    -webkit-transform: translateY(-10px);
    -ms-transform: translateY(-10px);
    transform: translateY(-10px);

    /* hide transition: animate out, then flip visibility */
    -webkit-transition: opacity 0.18s ease,
                        -webkit-transform 0.18s ease,
                        visibility 0s linear 0.18s;
    transition: opacity 0.18s ease,
                transform 0.18s ease,
                visibility 0s linear 0.18s;
}

.top-menu-group:hover .top-menu-fly {
    opacity: 1;
    visibility: visible;
    -webkit-transform: translateY(0);
    -ms-transform: translateY(0);
    transform: translateY(0);

    /* show transition: flip visibility immediately, then animate in */
    -webkit-transition: opacity 0.18s ease,
                        -webkit-transform 0.18s ease,
                        visibility 0s linear 0s;
    transition: opacity 0.18s ease,
                transform 0.18s ease,
                visibility 0s linear 0s;
}

/* ---- Items inside dropdown ---- */

.top-menu-fly .top-tab {
    display: block;
    padding: 11px 14px 11px 12px;
    height: auto;
    line-height: 1.35;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-left: 3px solid transparent;
    color: #a8b8cb;
    white-space: nowrap;
    -webkit-transition: background 0.12s ease, border-left-color 0.12s ease, color 0.12s ease;
    transition: background 0.12s ease, border-left-color 0.12s ease, color 0.12s ease;
}

.top-menu-fly .top-tab:last-child {
    border-bottom: none;
}

.top-menu-fly .top-tab:hover {
    background: #243447;
    border-left-color: #4fc3f7;
    color: #fff;
}

.top-menu-fly .top-tab.active {
    background: #1e3044;
    border-left-color: #4fc3f7;
    color: #fff;
}

/* ---- Letter-badge icons inside fly items ---- */

.fly-icon {
    display: inline-block;
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    margin-right: 9px;
    vertical-align: middle;
    -webkit-transition: -webkit-transform 0.12s ease;
    transition: transform 0.12s ease;
}

.top-menu-fly .top-tab:hover .fly-icon,
.top-menu-fly .top-tab.active .fly-icon {
    -webkit-transform: scale(1.15);
    -ms-transform: scale(1.15);
    transform: scale(1.15);
}

.fly-icon-blue   { background: #1565c0; color: #bbdefb; }
.fly-icon-green  { background: #2e7d32; color: #c8e6c9; }
.fly-icon-orange { background: #bf360c; color: #ffccbc; }
.fly-icon-purple { background: #6a1b9a; color: #e1bee7; }
.fly-icon-teal   { background: #00695c; color: #b2dfdb; }
.fly-icon-cyan   { background: #00838f; color: #b2ebf2; }
.fly-icon-red    { background: #b71c1c; color: #ffcdd2; }

/* IE-specific tweaks */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
    /* IE 10+ specific */
    #page-container { min-height: 600px; }
}
