/* General Body Styling */
body {
    color: #f39200;
    font-family: "Poppins", sans-serif;
}

/* Navbar Styling */
.navbar {
    background: linear-gradient(90deg, #0f4c75, #1b262c);
    /* Dark blue gradient */
    color: #d66902;
    box-shadow: 0 4px 8px #ff7849;
    border-bottom: 2px solid #ff7849;
    /* Dark orange border */
}

.navbar a {
    color: #ff7849;
    /* Dark orange for links */
    font-weight: bold;
    text-decoration: none;
    padding: 10px;
    transition: color 0.3s ease, text-shadow 0.3s;
}

.navbar a:hover {
    color: #f29100eb;
    /* Lighter orange on hover */
    text-shadow: 0 0 5px #ff9900;
}

.navbar .navbar-brand {
    color: #29b6f6;
    /* Soft blue for brand name */
    font-size: 20px;
    font-weight: bold;
    text-shadow: 0 0 8px #29b6f6;
}

/* Notification Icon - Clear visibility for everyone */
.navbar .notifications-icon,
.navbar .dropdown-navbar-user {
    display: inline-flex !important;
    align-items: center;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure notifications icon itself is orange and large */
.navbar .notifications-icon svg,
.navbar .notifications-icon svg.icon,
.navbar-nav .notifications-icon svg,
.navbar-nav .notifications-icon svg.icon,
.navbar .notifications-icon .icon {
    width: 22px !important;
    height: 22px !important;
    color: #f69300 !important;
    fill: #ea8c00 !important;
    stroke: #f19000 !important;
}

/* Hover effects */
.navbar .notifications-icon:hover svg,
.navbar .notifications-icon:hover svg.icon {
    color: #f19000 !important;
    fill: #e08702 !important;
    stroke: #fa9600 !important;
}

/* Notification Badge Enhancement */
.notifications-icon .badge,
.navbar .nav-item .badge {
    background-color: #ef4444 !important;
    color: white !important;
    box-shadow: 0 0 0 2px #1b262c;
    font-weight: 600;
    font-size: 0.65rem;
    padding: 3px 6px;
    border-radius: 9999px;
}

/* new adding */
/* Workspace Cards */
.workspace-card {
    display: inline-block;
    width: 30%;
    margin: 15px;
    border: 1px solid #58a6ff;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    color: #c9d1d9;
}

.workspace-card:hover {
    transform: scale(1.05);
    background: linear-gradient(145deg, #2b3137, #3a3f45);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.4);
}

.workspace-card a:hover {
    color: #ffa726;
}

@media (max-width: 768px) {
    .workspace-card {
        width: 100%;
    }

    .navbar {
        flex-direction: column;
        align-items: center;
    }
}

/* General Hover Effects */
a:hover,
button:hover,
.workspace-table tr:hover,
.navbar a:hover {
    filter: brightness(1.2);
    /* Brighten on Hover */
    transition: filter 0.3s ease-in-out;
}

/* end new adding */


/* Sidebar */
.sidebar {
    background: linear-gradient(180deg, #1a1a33, #2b2b44);
    /* Dark blue gradient */
    color: #ff7849;
}

.sidebar .sidebar-item:hover,
.sidebar .active {
    background: linear-gradient(90deg, #ff8c00, #e65100);
    /* Dark orange highlight */
    color: #f69800d8;
    border-radius: 8px;
    padding: 8px;
}

/* Cards */
.card {
    background: linear-gradient(145deg, #2b2b44, #3a3a55);
    /* Dark theme for cards */
    border-radius: 10px;
    box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.4);
    padding: 20px;
    margin: 15px;
    color: #d66902;
}

.card h3 {
    color: #29b6f6;
    /* Blue card titles */
}

.card a {
    color: #ffa726;
    /* Orange links */
    text-decoration: none;
}

.card a:hover {
    color: #ffcc80;
    /* Soft orange hover */
}

/* Button Styling */
button {
    background: #d66902;
    /* Orange Background */
    color: #0d47a1;
    /* Dark Text */
    font-weight: bold;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s, color 0.3s;
}

button:hover {
    background: #e68a00;
    /* Darker Orange */
    color: #ffffff;
    /* White Text */
}

/* Tables */
.table {
    border-collapse: collapse;
    width: 100%;
    margin: 20px 0;
    color: #ffa726;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.4);
}

.table th {
    background: linear-gradient(90deg, #1b5e20, #2e7d32);
    /* Deep green header */
    color: #d66902;
    text-align: center;
    padding: 15px;
}

.table td {
    background: linear-gradient(135deg, #2e2e4a, #3e3e5e);
    /* Subtle dark gradient */
    padding: 15px;
    text-align: center;
}

.table tr:hover {
    background: linear-gradient(90deg, #4a148c, #7b1fa2);
    /* Violet hover */
}

/* Footer */
.footer {
    background: linear-gradient(90deg, #1b262c, #0f4c75);
    /* Blue gradient */
    color: #ffffff;
    padding: 20px;
    text-align: center;
    border-top: 2px solid #29b6f6;
}

/* Status Indicators */
.status-orange {
    background: linear-gradient(90deg, #e65100, #ff8c00);
    /* Dark orange gradient */
    color: #d66902;
    border-radius: 15px;
    padding: 5px 15px;
    font-weight: bold;
}


.status-blue {
    background: linear-gradient(90deg, #08306b, #0d47a1);
    /* Deep blue gradient */
    color: #d66902;
    border-radius: 15px;
    padding: 5px 15px;
    font-weight: bold;
}

/* Hide powered by links in the footer */
.footer-powered,
.footer-powered-by {
    display: none !important;
}

/* =========================================================
   Global Link Fields Full Width Styling
   ========================================================= */

/* =========================================================
   GLOBAL LINK FIELD – FLEX-CORRECT FULL DISPLAY
   Frappe v15+ (Professional / Safe)
   ========================================================= */
/*
 * Aggressive CSS to force the Frappe Link field container to full width (col-sm-12)
 * This targets the parent element that is constraining the width.
 *
 * NOTE: This CSS should be applied as Custom CSS in Frappe.
 */

/* 1. Target the immediate parent of the Link field's wrapper (the form-column) */
/* This is necessary because Frappe's layout often uses col-sm-6 or col-sm-4 */
/* We use the !important flag as a last resort to override inline styles or other high-specificity rules */
/*
 * FINAL TARGETED CSS:
 * Aggressive CSS to force the Frappe Link field container to full width (col-sm-12)
 * ONLY within the main DocType form view, avoiding conflicts with search bars.
 *
 * This targets elements within the main form container (.form-page)
 */

/* 1. Target the column wrapper that contains the Link field, but only within the main form */
/* This is the most aggressive step to override Frappe's column width */
.form-page .form-column:has(> .frappe-control[data-fieldtype="Link"]) {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

/* 2. Ensure the control wrapper itself takes full width (do NOT force display — Frappe controls visibility) */
.form-page .frappe-control[data-fieldtype="Link"] {
    width: 100% !important;
    font-size: medium;
}

/* 3. Ensure the inner flex containers and content expand */
.form-page .frappe-control[data-fieldtype="Link"] .control-input {
    width: 100% !important;
    color: #f69300;
}

.form-page .frappe-control[data-fieldtype="Link"] .link-field {
    width: 100% !important;
    min-width: 0;
    color: #f69300;
}

/* Edit-mode input text */
.form-page .frappe-control[data-fieldtype="Link"] input.form-control {
    width: 100% !important;
    color: #f69300 !important;
}

/* 4. Read-only / selected value (plain text) */
.form-page .frappe-control[data-fieldtype="Link"] .control-value {
    color: #f69300 !important;
}

/* 5. Clickable anchor link rendered by Frappe in read mode */
.form-page .frappe-control[data-fieldtype="Link"] .control-value a,
.form-page .frappe-control[data-fieldtype="Link"] a.value-link {
    color: #f69300 !important;
    text-decoration: none;
}

.form-page .frappe-control[data-fieldtype="Link"] .control-value a:hover,
.form-page .frappe-control[data-fieldtype="Link"] a.value-link:hover {
    color: #ffb347 !important;
    text-decoration: underline;
}

/* 5. Keep the search dropdown wrapping behavior general (no form-page prefix) */
/* This ensures long search results wrap correctly everywhere */
.awesomplete ul li {
    white-space: normal !important;
}





/* =========================================================
   Frappe Desk – Safe Role-Based UI Customization
   Compatible with Frappe v15+
   ========================================================= */

/* ---------------------------------------------------------
   1️⃣ DEFAULT RESET – DO NOT HIDE CORE FIELDS GLOBALLY
--------------------------------------------------------- */
/*[data-fieldname="name"],
.form-group[data-fieldname="name"],
input[data-fieldname="name"],
.search-field[data-fieldname="name"] {
    display: block;
}

/* ---------------------------------------------------------
   2️⃣ LIST VIEW – HIDE ID (name) FOR NON-ADMINS ONLY
--------------------------------------------------------- */
body:not(.role-system-manager):not(.role-administrator) .list-row-col[data-col-name="name"] {
    display: block !important;
    opacity: 0.6 !important;
    color: #666 !important;
    font-size: 0.85em !important;
    font-weight: normal !important;
}

/* ---------------------------------------------------------
   3️⃣ LIST VIEW – SHOW ID CLEARLY FOR ADMINS
--------------------------------------------------------- */
body.role-system-manager .list-row-col[data-col-name="name"],
body.role-administrator .list-row-col[data-col-name="name"] {
    display: block !important;
    font-weight: 600;
    color: #1f7ae0;
}

/* ---------------------------------------------------------
   4️⃣ FORM VIEW – KEEP ID VISIBLE FOR ADMINS ONLY
--------------------------------------------------------- */
body:not(.role-system-manager):not(.role-administrator) .form-group[data-fieldname="name"] {
    display: none !important;
}

/* ---------------------------------------------------------
   5️⃣ GLOBAL LINK FIELDS – ORANGE COLOUR (Frappe v15)
   Covers both form view and list view link values
--------------------------------------------------------- */

/* Read-mode: the plain text or anchor Frappe renders */
.frappe-control[data-fieldtype="Link"] .control-value,
.frappe-control[data-fieldtype="Link"] .control-value a,
.frappe-control[data-fieldtype="Link"] a.value-link {
    color: #f69300 !important;
}

/* Edit-mode: the input box text */
.frappe-control[data-fieldtype="Link"] input.form-control {
    color: #f69300 !important;
}

/* List view link cells */
.list-row-col a {
    color: #f69300 !important;
}

/* Hover state */
.frappe-control[data-fieldtype="Link"] .control-value a:hover,
.frappe-control[data-fieldtype="Link"] a.value-link:hover {
    color: #ffb347 !important;
    text-decoration: underline;
}

/* ---------------------------------------------------------
   6️⃣ EXPORT DIALOG – HIDE ID FIELD FOR NON-ADMINS
--------------------------------------------------------- */
body:not(.role-system-manager):not(.role-administrator) .modal-dialog .checkbox.unit-checkbox label[title="ID"] {
    display: none !important;
}

/* ---------------------------------------------------------
   7️⃣ WORKSPACE / DESK – DO NOT HIDE MODULES OR DOCTYPES
--------------------------------------------------------- */
.desk-sidebar,
.workspace-sidebar,
.workspace-card {
    display: block !important;
}

/* ---------------------------------------------------------
   8️⃣ ADMIN VISUAL ENHANCEMENT (OPTIONAL)
--------------------------------------------------------- */
body.role-system-manager .list-row,
body.role-administrator .list-row {
    border-left: 3px solid #1f7ae0;
}

/* ---------------------------------------------------------
   9️⃣ SAFETY RULE – NEVER HIDE TITLE FIELDS
--------------------------------------------------------- */
[data-fieldname*="title"],
[data-fieldname*="subject"],
[data-fieldname*="customer"],
[data-fieldname*="name_title"] {
    display: block !important;
}


.form-control {
    white-space: normal !important;
    word-wrap: break-word;
}

/* =========================================================
   Fix Truncated Text in Child Tables (Grid Rows)
/* =========================================================
   Fix Truncated Text in Child Tables (Grid Rows)
   ========================================================= */
.grid-row {
    height: auto !important;
}

.grid-row .data-row {
    height: auto !important;
    min-height: 40px;
}

.grid-row .data-row .col {
    height: auto !important;
}

.grid-static-col {
    white-space: normal !important;
    word-wrap: break-word !important;
    max-height: none !important;
    overflow: visible !important;
    display: block !important;
    line-height: 1.5;
}

.grid-row-check {
    padding-top: 10px !important;
}

.row-index {
    padding-top: 10px !important;
}