@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

/* Root Variables - wbos-admin.html design */
:root {
    --bg: #f5f4f0;
    --surface: #ffffff;
    --surface2: #f8f7f4;
    --border: #e4e2db;
    --border2: #d0cec6;
    --text: #1a1916;
    --text2: #5c5a54;
    --text3: #9c9a94;
    --blue: #185FA5;
    --blue-bg: #e8f1fa;
    --blue-text: #0c447c;
    --teal: #0f6e56;
    --teal-bg: #e2f5ee;
    --teal-text: #085041;
    --amber: #854f0b;
    --amber-bg: #faeeda;
    --amber-text: #633806;
    --green: #3b6d11;
    --green-bg: #eaf3de;
    --green-text: #27500a;
    --red: #a32d2d;
    --red-bg: #fcebeb;
    --red-text: #791f1f;
    --radius: 8px;
    --radius-lg: 12px;
}

html, body {
    font-family: 'DM Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: var(--blue);
    text-decoration: none;
}

a:hover {
    color: var(--blue-text);
}

/* Buttons */
.btn {
    border-radius: var(--radius);
    font-weight: 500;
    padding: 7px 14px;
    font-size: 13px;
}

.btn-primary {
    background-color: var(--blue);
    border-color: var(--blue);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--blue-text);
    border-color: var(--blue-text);
}

.btn-success {
    background-color: var(--green);
    border-color: var(--green);
    color: #fff;
}

.btn-secondary {
    background-color: var(--text2);
    border-color: var(--text2);
}

/* Cards */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    background: var(--surface);
}

.card-header {
    background: var(--surface2);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

/* Tables */
table {
    font-size: 13px;
}

th {
    font-size: 11px;
    font-weight: 600;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: var(--surface2);
}

/* Forms */
.form-control, .form-select {
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    padding: 7px 10px;
    font-size: 13px;
    transition: border-color 0.15s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 0.2rem rgba(24, 95, 165, 0.25);
}

.form-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text2);
    margin-bottom: 4px;
}

/* Badges */
.badge {
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.bg-success {
    background-color: var(--green-bg) !important;
    color: var(--green-text) !important;
}

.bg-primary {
    background-color: var(--blue-bg) !important;
    color: var(--blue-text) !important;
}

.bg-warning {
    background-color: var(--amber-bg) !important;
    color: var(--amber-text) !important;
}

.bg-danger {
    background-color: var(--red-bg) !important;
    color: var(--red-text) !important;
}

.bg-secondary {
    background-color: #f0eeea !important;
    color: var(--text2) !important;
}

/* Alerts */
.alert {
    border-radius: var(--radius);
    border: 1px solid;
    font-size: 13px;
}

.alert-info {
    background-color: var(--blue-bg);
    color: var(--blue-text);
    border-color: #c2d8f0;
}

.alert-danger {
    background-color: var(--red-bg);
    color: var(--red-text);
    border-color: #f5c6c6;
}

.alert-success {
    background-color: var(--green-bg);
    color: var(--green-text);
    border-color: #c5e0a9;
}

/* Content area */
.content {
    padding: 1.5rem;
}

/* Validation */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--green);
}

.invalid {
    outline: 1px solid var(--red);
}

.validation-message {
    color: var(--red);
    font-size: 12px;
}

/* Nav tabs */
.nav-tabs .nav-link {
    color: var(--text2);
    border: none;
    border-bottom: 2px solid transparent;
}

.nav-tabs .nav-link.active {
    color: var(--blue);
    border-bottom: 2px solid var(--blue);
    font-weight: 500;
    background: transparent;
}

.nav-tabs .nav-link:hover:not(.active) {
    color: var(--text);
    border-color: transparent;
}

/* Blazor Error UI */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* Utilities */
.text-muted {
    color: var(--text2) !important;
}

.fw-medium {
    font-weight: 500;
}

.fw-bold {
    font-weight: 600;
}

/* Tree View Styling */
.tree-container {
    margin-top: 1rem;
}

.tree-node {
    margin-bottom: 0.75rem;
}

.tree-node-header {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border: 2px solid;
    border-radius: var(--radius-lg);
    cursor: pointer;
    background: var(--surface);
    transition: all 0.2s;
}

.tree-node-header:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tree-toggle {
    margin-right: 0.75rem;
    font-size: 12px;
    color: var(--text2);
    user-select: none;
}

/* Distributor Node - Amber Border */
.node-distributor .tree-node-header {
    border-color: var(--amber);
    background: var(--amber-bg);
}

.node-distributor strong {
    color: var(--amber-text);
    font-size: 15px;
}

/* Organisation Node - Blue Border */
.node-org .tree-node-header {
    border-color: var(--blue);
    background: var(--blue-bg);
}

.node-org strong {
    color: var(--blue-text);
    font-size: 14px;
}

/* Sub-Org Node - Teal Border */
.node-suborg .tree-node-header {
    border-color: var(--teal);
    background: var(--teal-bg);
}

.node-suborg strong {
    color: var(--teal-text);
    font-size: 13px;
}

/* Site Node - Default Border */
.node-site .tree-node-header {
    border-color: var(--border2);
    background: var(--surface);
}

.node-site strong {
    color: var(--text);
    font-size: 13px;
}

.tree-children {
    margin-left: 2rem;
    margin-top: 0.75rem;
}

/* Distributor List Card Styling */
.distributor-card {
    border-left: 4px solid var(--amber);
}

.distributor-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    transition: all 0.2s;
}
